VoiceCraft is a token infilling neural codec language model for zero-shot speech editing and text-to-speech (TTS) using only a few seconds of reference audio. The system enables users to generate speech in novel voices or edit existing speech (deletion/insertion/substitution) while preserving speaker identity. It processes audio via EnCodec tokenization and models the token sequence with a transformer architecture featuring adaptive layer normalization and delayed pattern prediction for multi-codebook audio representation. The repository provides a complete pipeline from data preparation to deployment. Training scripts (main.py, z_scripts/*.sh) handle distributed training on datasets like Gigaspeech, while inference is accessible through standalone demos (tts_demo.py, speech_editing_demo.py), batch processing scripts (inference_tts_scale.py, inference_speech_editing_scale.py), a Gradio web interface (gradio_app.py), and a Replicate API wrapper (predict.py). Data processing modules (data/tokenizer.py, data/phonemize_encodec_encode_hf.py) manage phoneme extraction and audio tokenization using external tools like phonemizer and audiocraft's EnCodec. Key architectural strengths include reusable components such as the adaptive layer norm transformer encoder (models/modules/transformer.py), the DelayedPatternProvider for EnCodec's interleaved token structure (models/codebooks_patterns.py), and optimized training utilities like ScaledAdam optimizer and length-based batch sampling. The code demonstrates non-obvious skill in handling audio token generation challenges, though it relies on specific versions of external libraries and includes non-commercial use restrictions. Recent activity (commit 2026-05-30) indicates active maintenance with low technical drift due to dependency pinning.