NeMo-Speech.cpp/docs/tts/configuration.md at main · NVIDIA/NeMo-Speech.cpp

GitHub

Configuration for MagpieTTS + NanoCodec. nemo-speech serve hosts HTTP; the separate riva_server hosts Riva-compatible gRPC. Either process can load ASR, TTS, and NMT together. For how keys are set (YAML, environment, and CLI precedence), see

Server configuration

. To download the models and extract the tokenizer, see

TTS models

.

Serving

nemo-speech serve --config config/tts.example.yamlor with flags for HTTP:

nemo-speech serve \ --tts.magpie-model models/magpie-tts/magpie_tts_multilingual_357m.v2602.f16.gguf \ --tts.codec-model models/nano-codec/nemo_nano_codec_22khz_1.89kbps_21.5fps.decoder.f16.gguf \ --tts.tokenizer-model-dir models/magpie-tts/extracted \ --host 127.0.0.1 --port 8080 \ --tts.language-code en-US --tts.voice-name JohnFor Riva-compatible gRPC, use the same engine options with riva_server and --bind 0.0.0.0:50051.

--tts.tokenizer-model-dir is the extracted MagpieTTS .nemo directory - see

TTS models

for how to obtain it.

--tts.tn-model-dir optionally enables Sparrowhawk text normalization before tokenization (written form to spoken form, for example I have 2 apples to I have two apples). It requires a -DNEMO_SPEECH_WITH_NORM=ON build and a TN grammar directory containing tokenize_and_classify.far and verbalize.far. For multiple languages, pass a parent containing language-named children such as en/, fr/, and vi/, each with those two FARs; post_process.far is used when present. The older split layout (classify/tokenize_and_classify.far, verbalize/verbalize.far) remains supported.

The optional riva_server supports RivaSpeechSynthesis.Synthesize, SynthesizeOnline, and GetRivaSynthesisConfig. It takes plain text in SynthesizeSpeechRequest.text and returns LINEAR_PCM s16le at the NanoCodec sample rate. The loaded Magpie tokenizer/model determines the supported languages. Both v2602 and v2607 support en, es, de, fr, it, vi, zh, hi, and ja. Arabic (ar-AE, ar-SA, and ar-MSA), Korean (ko), and Brazilian Portuguese (pt-BR) require a matching v2607 tokenizer and model; v2602 does not support or advertise those codes. Japanese and Mandarin also require the respective NEMO_SPEECH_TTS_WITH_JA and NEMO_SPEECH_TTS_WITH_ZH build options, both of which default to OFF. Native tokenizers are cached by language. Mandarin uses bundled Jieba and pypinyin-compatible data together with the model's pinyin-to-phoneme dictionary. Set MAGPIE_MANDARIN_G2P_DIR only to override the bundled Mandarin data directory.

GetRivaSynthesisConfig advertises the TTS languages supported by the loaded Magpie tokenizer/model in language_code and exposes the per-language dotted voice names in voices_by_language. The legacy voice_name, subvoices, and voices parameters remain available for clients that assemble voice names themselves.

TTS auto-enables when tts.magpie-model, tts.codec-model, and tts.tokenizer-model-dir are all set; force with tts.enabled.

Voices

Voice names are case-insensitive. The runtime accepts a local speaker name, a zero-based speaker index, or a model-qualified name such as magpietts.John. tts.voice-name selects the default; otherwise tts.speaker is used.

The HTTP model inventory lists the available local names. On /v1/audio/speech, default and supported OpenAI voice aliases such as alloy select that configured local default; they are not additional voices. See the

HTTP API reference

.

Text normalization

Install the shared Sparrowhawk/OpenFST normalizer and enable it in the build:

scripts/build_itn_deps.sh scripts/configure.sh cpu-tts -DNEMO_SPEECH_WITH_NORM=ON cmake --build --preset cpu-ttsPass the grammar directory to the CLI or server:

nemo-speech synthesize "I have 2 apples." \ --magpie-model models/magpie-tts/magpie_tts_multilingual_357m.v2602.f16.gguf \ --codec-model models/nano-codec/nemo_nano_codec_22khz_1.89kbps_21.5fps.decoder.f16.gguf \ --tokenizer-dir models/magpie-tts/extracted \ --tn-model-dir models/tn_configs \ --output normalized.wavThe equivalent YAML setting is:

tts: magpie-model: /models/magpie-tts/magpie_tts_multilingual_357m.v2602.f16.ggufcodec-model: /models/nano-codec/nemo_nano_codec_22khz_1.89kbps_21.5fps.decoder.f16.gguftokenizer-model-dir: /models/magpie-tts/extractedtn-model-dir: /models/tn_configslanguage-code: en-USThe grammar directory may be a single-language Sparrowhawk TN directory or a multilingual root such as models/tn_configs, with immediate language-named children (en/, fr/, vi/, and so on). Each language directory must contain tokenize_and_classify.far and verbalize.far; post_process.far is optional.

If a TN model directory is set in a build without NEMO_SPEECH_WITH_NORM=ON, startup logs a warning and text passes through unchanged.

Local synthesis

Use the unified CLI for synthesis without a server:

nemo-speech synthesize "Hello from Magpie." \ --magpie-model models/magpie-tts/magpie_tts_multilingual_357m.v2602.f16.gguf \ --codec-model models/nano-codec/nemo_nano_codec_22khz_1.89kbps_21.5fps.decoder.f16.gguf \ --tokenizer-dir models/magpie-tts/extracted \ --speaker 0 --output magpie.wavSee the

CLI guide

for the common workflow. The optional synthesize_text example additionally exposes the stable C ABI and pre-tokenized input path when built with NEMO_SPEECH_BUILD_EXAMPLES=ON.

Key reference

All keys nest under tts.. Defaults shown; CLI alias listed where one exists.

Models and identity

keyCLI aliasdefaultmeaningtts.enabled-autotrue / false / autotts.magpie-model--MagpieTTS GGUF token generator (required)tts.codec-model--NanoCodec decoder GGUF (required)tts.tokenizer-model-dir--extracted Magpie .nemo dir (required)tts.tokenizer.sentence-limit.<lang>-per language (en 45 ... ja 40)sentence-chunking threshold in words (characters for zh/ja); subkeys en, es, fr, vi, it, de, zh, hi, ja, ar, ko, pttts.tn-model-dir--enables Sparrowhawk TN with this grammar dir; requires NEMO_SPEECH_WITH_NORM=ONtts.language-code-en-USdefault text language codetts.voice-name--default voice name or speaker indextts.speaker-0default baked speaker indexSampling and decoding

keyCLI aliasdefaultmeaningtts.seed--1RNG seed; -1 = current timetts.steps--1max decoder frames; -1 = model defaulttts.top-k--1top-k sampling; -1 = model defaulttts.temperature-model defaultsampling temperaturetts.cfg-scale-model defaultclassifier-free guidance scaletts.use-cfg / tts.no-cfg-onenable / disable CFGtts.use-local-transformer / tts.no-local-transformer-onlocal transformertts.use-kv-cache / tts.no-kv-cache-ondecoder KV cacheCodec streaming

keyCLI aliasdefaultmeaningtts.chunk-frames-4codec frames per streamed audio chunktts.codec-queue-depth-4codec worker queue depthtts.codec-history-frames--1rolling codec history framestts.codec-future-frames-1rolling codec future framestts.window-ms-0overlap-add window (ms)tts.flush-partial-chunk-trueemit a final partial codec chunktts.use-stateful-codec / tts.no-stateful-codec-onfast layer-state codectts.codec-cpu-falseforce NanoCodec decoder onto CPUExecution

keyCLI aliasdefaultmeaningtts.threads--threads4CPU threads for Magpie + codec; use the dotted key with HTTP, where --threads controls request workerstts.codec-threads-0codec CPU threads; 0 = use threadstts.lt-backend-autolocal-transformer backend: auto/cpu/cudatts.lt-fp32--tts.local-transformer-fp32falserun the local transformer in FP32tts.sampling-backend-autosampling backend; auto uses CUDA when the Magpie/local-transformer path is CUDA, otherwise CPUtts.uma-mode-autoCUDA managed memory: auto/off/ontts.longform-autosentence-chunk longform mode: auto/off/onDiagnostics and warmup

keyCLI aliasdefaultmeaningtts.benchmark--benchmarkfalseemit per-request metrics from riva_servertts.verbose--verbosefalsedetailed Magpie/NanoCodec logs; use global --verbose with nemo-speechtts.warmup-enabled / tts.no-warmup-onstartup tokenizer/runtime warmuptts.warmup-text-(built-in)text used for startup warmuptts.warmup-steps-8decoder frames used for startup warmup