🤗[v0.4.0-Milestone] Release Note: MTMD Text-to-Speech, Grammar Improvements, and Runtime State Reliability #179
JamePeng
announced in
Announcements
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
0.4.0-Milestone — MTMD Full Multimodal Milestone
Introducing llama cpp python 0.4.0 milestone.wav
Note: Generated using qwen3-tts via llama-cpp-python😉
We have reached another major milestone for
llama-cpp-python.With this release, MTMD now gains complete Text-to-Speech support, filling one of the last major gaps in the multimodal stack. The project can now handle a nearly complete set of multimodal workflows across text, images, video, speech/audio understanding, and audio generation, bringing the Python bindings much closer to a unified full-modality runtime built on top of
llama.cpp.At the same time, upstream
llama.cpphas begun adopting the0.4.xversioning series. To align with this new stage of development, the previously planned0.3.50milestone is being promoted to0.4.0-Milestone, marking the beginning of the0.4series for this project as well.Beyond TTS, this release includes substantial improvements across grammar handling, runtime state reliability, hybrid cache synchronization, cancellation, speculative decoding, multimodal prefill, embedding execution, examples, tests, documentation, and API bindings.
[0.4.0-Milestone] MTMD Text-to-Speech, Grammar Improvements, and Runtime State Reliability
feat(tts): add MTMD audio generation for
Qwen3-TTSandPocket TTSMTMDAudioGeneratorwith owned WAV and float32 PCM resultsfeat(grammar): support custom roots and lazy grammar triggers
LlamaGrammar.from_string()andfrom_file()fix(grammar): align JSON Schema conversion and chat object constraints
json_objectresponse schemas to an explicit object schemaperf(grammar): reuse optional suffixes and character fragments
build optional property suffixes in reverse order without repeated recursion
cache character ranges and hexadecimal fragments within each schema conversion
reduce duplicate rule lookups while preserving grammar output and property ordering
optimize schema conversion without changing per-token sampling
Local benchmark medians (before → after):
0.297 ms → 0.146 ms(2.0×)4.889 ms → 0.646 ms(7.6×)21.689 ms → 1.339 ms(16.2×)2.429 ms → 1.387 ms(1.8×)1.548 ms → 0.731 ms(2.1×)5,050to zero and rule registration calls drop from5,152to301.fix(state): preserve owned snapshots and valid sampling outputs
fix(cache): align hybrid checkpoint lifetime with native context changes
fix(runtime): preserve prompt reuse and coordinate state cleanup
feat(context): add threadpool management and safe native cancellation
Llama.abort()to the native abort callbackfinish_reason="abort"for cancelled completion and chat responsesKeyboardInterruptinside the generation loop as cancellation, with a diagnostic when verbose logging is enabledfix(speculative): align DFlash execution and draft checkpoint ownership
fix(multimodal): preserve prefill outputs and recover from partial failures
MTMDBaseHandlermtmd_input_partandmtmd_tokenize_from_partsfor pre-split media inputsrefactor(embedding): share execution and generation-state cleanup
LlamaEmbedding.embed()toLlama.embed()while preserving subclass defaultsrefactor(examples): rebuild low-level API examples
test: consolidate coverage and share pinned models across CI environments
docs(wiki): align runtime guides with implemented behavior
chore(vendor): update the bundled llama.cpp revision
vendor/llama.cppfrom9723942to60081bbcompatibility: clarify state reuse and multimodal speculation limits
LlamaStateis not a portable serialization format or an exact stochastic continuationreset=True; target-only snapshots cannot resume draft stateNGRAM_MAP_KandNGRAM_MAP_K4V, but still rejects MTP and DFlash-family engines; lower-level embedding support does not enable themfeat: sync llama.cpp llama/mtmd/ggml API bindings — 2026-09-19
Milestone
With TTS now integrated, the MTMD stack has effectively reached a new level of multimodal completeness:
Text → Image → Video → Audio Understanding → Audio Generation
This does not mean every model family or every cross-modal execution path is finished, but the fundamental modality coverage is now largely in place. Future work can increasingly focus on deeper integration between these modalities, performance, speculative execution, runtime reliability, and broader model compatibility rather than filling basic modality gaps.
0.4.0-Milestonetherefore represents both the completion of the major goals originally planned around the0.3.50milestone and the starting point of the new0.4.xdevelopment series.Full Comparison
34c1bfb...15f95d1
— JamePeng
All reactions