Repository navigation
[0.8.0] - 2026-11-30
Added
-
pmetal infer --json --top-logits Kreports the first generation step's top-k raw logits (first_step_logits) (#37). Works across every engine (shared model, all native engines, MTP speculative decoding, and ANE), capturing the unpenalized, pre-temperature logits in float32 on device (or host for ANE) as[{"token_id", "token", "logit"}, ...]sorted descending. Also available viaInferSpec::top_logitsandpmetal_runtime::decode::{top_k_logits, capture_first_step_logits}. -
Full CLI, TUI, and Desktop GUI feature parity and developer SDK documentation. Expanded 13 job specs (
merge,serve,infer,train,grpo,rlkd,distill,preference,quantize,pretrain,speak,train-tts,train-asr) for full engine configurability across CLI, MCP, Python, TUI, and GUI; broughtpmetal tuito 33 tabs covering all 27 job specs (adding speech, MTP/draft/diffusion training,decide,fuse,imatrix,pack-experts, Metal 4/TB5 RDMA telemetry, and live LR steering across trainers); upgraded the Tauri desktop GUI with Metal 4 / MPP / NAX / TB5 RDMA hardware telemetry, audio/adapter model badges, multi-turnreasoning_content+ full inference parameters drawer, and live training LR/checkpoint steering (set_job_lr); and added a comprehensive Rust developer SDK guide suite underdocs/sdk/with runnable examples. -
Hot-swap multi-LoRA serving, an Ollama-compatible HTTP API, and cluster inspection endpoints in
pmetal serve.POST /v1/adapters,GET /v1/adapters, andDELETE /v1/adapters/{name}register, inspect, and unload LoRA adapters at runtime (AdapterRegistry), routed bymodelname (base:adapteror registered alias) with per-request adapter syncing on the model thread./api/chat,/api/generate,/api/tags,/api/show, and/api/versionexpose Ollama's NDJSON streaming and model-inspection wire protocol on the same inference engine. With--features distributed,GET /v1/cluster/rdma,POST /v1/cluster/previews,GET /v1/cluster/election, andGET /v1/cluster/incompatible-peerssurface live Thunderbolt RDMA readiness, heterogeneous placement previews, leader election state, and ABI/wire compatibility reports (examples/serve_multilora_ollama.shandexamples/cluster_preview.shdemonstrate both). -
Disaggregated prefill/decode serving, JACCL Thunderbolt 5 RDMA, leader election, and heterogeneous shard planning in
pmetal-distributed, pluspmetal cluster previewandpmetal cluster rdma.disaggregatedstreams KV-cache layer chunks and recurrent Mamba/GDN states from prefill workers to decode workers (DisaggregatedPrefillServer,DisaggregatedDecodeClient).rdmaprobes macOS Thunderbolt 5 RDMA capabilities (LocalRdmaCapabilities::probe) and builds JACCL mesh matrices and launch environments.electioncoordinates session-epoch leader election with sleep/wake holdback,namespaceenforces cluster wire-schema and ABI compatibility across peers, andshard_planplans heterogeneous memory/bandwidth-weighted layer placements across mixed Apple Silicon clusters. -
Metal 4 / MPP compute kernels and expanded ANE training/inference support in
pmetal-metal. Adds Metal 4 shader compilation andmetal4_opsdispatch on Metal 4 / SDK 27+ toolchains, alongside ANE FP16 numerical preflight checks, weight palettization, ANE LM-head execution, and heterogeneous GPU+ANE pipelining. -
AirLLM-style disk-backed layer streaming (
pmetal_models::layer_stream) and streamed LoRA training (pmetal_trainer::streamed_lora).SafetensorsLayerStreamerstreams transformer decoder layers from safetensors shards on demand with bounded residency plans (LayerResidencyPlan) and background prefetching so models larger than unified memory can run and train with boundary checkpoints. -
System capability inspection in the Python bindings (
pmetal.system_info) alongside hardened Tauri desktop GUI job controls, atorch_picklefuzz target (fuzz/fuzz_targets/torch_pickle.rs), and a nightly real-weights CI workflow (.github/workflows/nightly-real-weights.yml). -
pmetal serve --tts-modelserves a Qwen3-TTS voice onPOST /v1/audio/speech, in OpenAI's shape, beside the language model or alone.voiceis one of the model's nine speakers,instructionsdirects the delivery in plain words,seedpicks the take andlanguagethe language (both pmetal's extensions).response_format: "pcm"streams 16-bit 24 kHz mono as it is synthesized (thex-sample-rateheader names the rate) andwavsends the whole clip; a client that disconnects stops the synthesis.speedother than 1,stream_format: "sse"and the compressed formats are refused by name. On an M4 Max a sentence's first audio reaches the client in 53–61 ms and a clip comes at about 4x real time; the server holds 5.1 GB.pmetal_serve::{SpeechEngine, Synthesizer}put any synthesizer behind the route. -
pmetal serve --stt-modeltranscribes onPOST /v1/audio/transcriptions, in OpenAI's shape, beside the other models or alone;--stt-aligneradds word timestamps. The form'sfileis a recording at any rate and with any number of channels (mixed to mono and resampled to 16 kHz, up to 25 MB);promptis the words the recording is likely to hold, which steer the transcript;languageis an ISO 639 code or the model's name for it, or left for the model to tell.response_formatisjson(the default),textorverbose_json(task,language,duration,text), andtimestamp_granularities[]=wordadds each word'sstartandendin seconds, timed by the Qwen3-ForcedAligner model--stt-alignernames. Segment timestamps,srt,vtt,stream, and atemperatureother than 0 are refused by name.pmetal_serve::{TranscriptionEngine, Transcriber, Qwen3Transcriber}put any recognizer behind the route. -
pmetal-speech, a new crate: Qwen3-TTS text to speech.Qwen3Ttsloads a CustomVoice release (its weights, itsvocab.json/merges.txttokenizer and its codec) and generates a clip's codes frame by frame for a named speaker, a language (orauto) and a delivery in plain words ("quietly, almost a whisper"), handing each 80 ms frame over as soon as it is complete. The talker and code predictor are pmetal's own Qwen3 decoder layers; sampling is the workspace's sampler (the release's temperature, top-k and repetition penalty, the talker held to the codebook and end of speech, no end in its first two draws), and a seed gives the same reading every time. On the released 1.7B model, decoding greedily in float32, the codes are identical to the reference implementation's, frame for frame, for a plain prompt and for a whispered one.synthesizestreams the audio as it is generated (a short first piece, then larger ones;AudioChunking), and the pieces join into exactly the clip decoded whole;speakreturns the clip. On an M4 Max with the release's bf16 weights, warm, the first audio of a sentence arrives in 62–68 ms and a clip is generated at about 3.8–4.0x real time, with 4.0 GB of GPU memory in use (examples/speak.rsmeasures it). -
Every Qwen3-TTS release speaks: VoiceDesign models with a voice described in plain words, Base models with a voice cloned from a recording of it, and the 0.6B models. A request's
voiceisVoice::Speaker(CustomVoice),Voice::Designed(VoiceDesign, itsdeliverydescribing the voice) orVoice::Cloned, fromQwen3Tts::clone_voice, which runs a Base model's speaker encoder (ECAPA-TDNN) over a few seconds of the voice at any rate.SynthesisOptions::text_inputgives the talker the whole text in its prompt (CustomVoice's and VoiceDesign's default) or a token a frame (TextInput::Interleaved, a Base model's default), as the reference does.Qwen3Tts::clone_voice_with_transcriptclones from a recording and what it says: the talker reads the recording's own codes, from the codec's encoder,pmetal_vocoder::codec::Qwen3TtsCodecEncoder(Mimi's), and continues the voice from them. On the released 1.7B models in float32, the speaker vector of a clip is the reference's within 1.1e-5, the encoder's codes of a clip are the reference's, all 49 frames of 16 codebooks, and the greedy codes of a VoiceDesign voice, a cloned voice with and without its transcript, and a CustomVoice speaker with the text a token a frame are the reference's, frame for frame. A delivery instruction to a model that does not read one (0.6B, Base) is refused by name; the reference drops it silently.Qwen3Tts::generate_codestakesSynthesisOptionsin place of a sampling and a seed, andSpeechRequest::speakeris nowvoice.pmetal serve --tts-modelserves every kind: a VoiceDesign model's one voice isdesigned, whichinstructionsdescribes, and a Base model speaks the voices--tts-voice NAME=RECORDING.wavnames, cloned at load (with the recording's transcript whenRECORDING.txtsits beside it). The route takestemperature,top_k,top_pandrepetition_penalty(pmetal's extensions;temperature: 0draws greedily) and refusesinstructionsby name to a model that reads none.pmetal_serve::Synthesizernow takes aSpokenLine, its voice by name, and reportstakes_instructions;Qwen3Voicesis the Qwen3-TTS implementation, andSpeechEngine::load_qwen3_ttstakes the recordings to clone. -
Speech to text in
pmetal-speech: Qwen3-ASR, with each word timed by Qwen3-ForcedAligner.Qwen3Asrloads a release (the official one, or an MLX conversion, whose quantized weights stay packed) and transcribes 16 kHz audio.TranscribeOptions::contextsteers it toward the words a clip is likely to hold ("TurboClipboard mcpotion pmetal"): on twelve spoken sentences full of product names, it wrote 4 of their 14 names right without one and 9 with one.languagetakes the model's name for a language (English) or its ISO 639 code (en), or is left for the model to tell.Qwen3ForcedAligner::aligntimes each word of a transcript (WordTiming, in seconds) in about 50 ms for a 10 s clip. On the released 1.7B model in float32, a 10 s LibriSpeech clip's transcript is the reference implementation's, and so are its 27 word timings, to the millisecond. Across 203 LibriSpeech utterances the word error rate is 2.10% on test-clean and 5.05% on test-other in bf16, and 2.05% and 5.17% with the 8-bit conversion. On an M4 Max a 10 s clip is transcribed in 246 ms by the 8-bit 1.7B model (2.3 GB of GPU memory), in 410 ms in bf16, and in 120 ms by the 8-bit 0.6B model (examples/transcribe.rsmeasures it). The encoder attends within windows of 8 s, as the reference's vLLM backend does; its transformers encoder builds that mask but never applies it. Words are split as the reference splits them, except that en and em dashes separate words (right—quite), and a word keeps its inner punctuation (state-of-the-art). A recording longer than 20 minutes is transcribed in chunks cut at its quietest moment near each limit, as the reference cuts it, andQwen3Asr::transcribe_timedtimes the words of a recording of any length in chunks of at most 3 minutes; the transcripts are joined with a space (the reference joins them with nothing, which runs English sentences together). A recording with no speech (language None) comes back as empty text, and a transcript that falls into a loop has the loop collapsed, as the reference does. The Whisper log-mel front end (stt::LogMel) is within 1e-4 of transformers'WhisperFeatureExtractor. -
pmetal_vocoder::codec::Qwen3TtsCodecdecodes Qwen3-TTS 12 Hz speech tokens to 24 kHz audio, andQwen3TtsCodecStreamdecodes them as they are generated. Every layer of the decoder is causal, so the stream carries each convolution's left context and each attention layer's sliding window from one piece to the next, and its audio equals decoding the clip whole. (The reference's chunked decode re-decodes 25 frames of left context instead; on 12 s of speech tokens it differs from its own whole decode by up to 0.89, because the transformer's receptive field spans hundreds of frames.) On the released decoder the audio is within 6.0e-5 of the reference implementation's (98.7 dB SNR). -
A tokenizer released as
vocab.jsonandmerges.txt, with notokenizer.json, loads (Tokenizer::from_model_dir), built the way transformers converts it: aQwen2Tokenizer, as Qwen3-TTS ships, gives the same ids as transformers on English, numbers, contractions, CJK, emoji, decomposed accents and special tokens. Another tokenizer class in this form is refused by name rather than guessed. -
Word timings for Japanese and Korean, with the
japanese-word-timingsandkorean-word-timingsfeatures (ofpmetal,pmetal-serveandpmetal-speech, off by default). Japanese splits into words as the UniDic dictionary splits it, and Korean into its spaced words, each timed by its morphemes (mecab-ko-dic), both through Lindera; each feature embeds its dictionary (about 190 MB and 80 MB), which the build downloads and checks. On 20 FLEURS recordings of each language, 99% of the reference implementation's Japanese word edges fall in the same places and 99% of those are timed identically; for Korean, whose words the reference splits further (a stem from its ending), 98% of the edges both give are within 80 ms. A Japanese number is one word, where the reference times each digit. Without the features they are refused by name.examples/align.rstimes the words of a transcript you already have. -
Compressed audio in: FLAC, MP3, AAC or ALAC in M4A or MP4, Opus in Ogg, AIFF and CAF, decoded by macOS's AudioToolbox (
pmetal_vocoder::audio::read_audio)./v1/audio/transcriptionstakes them infile(up to 2 hours of audio),--tts-voiceclones from them, andpmetal_speech::stt::clip_from_bytes(which replacesclip_from_wav) reads them; a WAV file is still read by pmetal's own parser. WebM and Vorbis, which macOS does not decode, are refused. -
Qwen3Asr::transcribe_batchtranscribes several recordings at once, up to 32 chunks together as the reference batches them: each prompt is filled on its own, shifted to end where the longest does, and the rows then decode together. On an M4 Max, eight LibriSpeech clips (79 s of audio) took 1.7 s batched against 3.6 s one at a time with the 8-bit 1.7B model, each transcript the one it gets alone.examples/transcribe.rs --batchtimes both. -
Qwen3Tts::synthesize_batchspeaks several lines at once (generate_codes_batchgives their codes), each line streamed toon_audio(line, piece)as it is synthesized, drawn from its own seed and stopped on its own. Each prompt is filled alone and the lines then run together, as transcription batches. On an M4 Max, four readings of a sentence (33 s of audio) took 3.9 s batched against 7.5 s one at a time with the 1.7B model, 8.5x real time. In float32 each line's codes are exactly its codes alone, on the released 1.7B model with lines of different lengths; in bfloat16 a matrix product over several rows sums in a different order from one over a single row, so a reading can come out as a different, equally valid take (a batch of one is exactly alone).examples/speak.rs --batch Ntimes both. -
pmetal serve --cache-limit MBbounds MLX's buffer cache, the freed GPU buffers kept for reuse; serve keeps 256 MB by default (ServeSpec::cache_limit, so the TUI, GUI, MCP and Python get it too;pmetal_runtime::memory::set_buffer_cache_limitfor the SDK, whose default stays MLX's: as many as fit). A server holds several models, and an unbounded cache held about half a gigabyte more beside a Qwen3-TTS model. The speech examples take--cache-limittoo. -
Qwen3Asr::streamtranscribes as the audio arrives (TranscriptStream::{push, finish},StreamOptions), as the reference's vLLM backend streams: every 2 s of new audio, the model transcribes everything heard so far, continuing from the last transcript minus its last 5 tokens, which the new audio may change (from scratch for the first two). Unlike the reference, an update does not grow with the stream: the encoder attends within 8 s windows, so a window heard in full can no longer change, and the stream keeps those windows' encodings and the decoder's cache through them, reading only the audio since; and after a minute (segment_seconds) it closes the segment at the next pause, keeping its transcript and starting the next from scratch. On a 206 s recording an update took 174 ms at the median and 437 ms at most, and the whole stream 19 s of compute, where re-reading everything grew to 1.7 s an update and 107 s in all (8-bit 1.7B). On 203 LibriSpeech clips the final word error rate is the offline one (2.01% and 4.94%).examples/transcribe.rs --stream SECONDStimes it. -
pmetal speakandpmetal transcribe, from the job specsSpeakSpecandTranscribeSpec, so the terminal UI, the desktop app, the MCP server (speak,transcribe, 59 tools now) and Python (pmetal.SpeakSpec,pmetal.TranscribeSpec) start them as the command line does.speakwrites a WAV in a CustomVoice model's speaker, a VoiceDesign model's described voice, or a Base model's voice cloned from--reference;transcribeprints or writes the transcript, as text or as JSON with each word timed by--aligner. Thespeechfeature, on by default, carries them;japanese-word-timingsandkorean-word-timingsnow turn it on rather thanserve.SpeechSampling::withapplies a request's temperature, top-k, top-p and repetition penalty, as the speech route does. -
Qwen3Tts::finetune_speakerfine-tunes a Qwen3-TTS Base model on one speaker's recordings into a CustomVoice model that speaks as them by name.prepare_speakerturns each recording (any rate, with its text and language) into the codec's codes, and a reference clip into the speaker's vector;finetune_speakertrains the talker and the code predictor with AdamW (FinetuneOptions: epochs, batch size, learning rate, warmup, weight decay, gradient clipping, the code predictor's share of the loss, the shuffle's seed), reporting each step to aTrainingCallback, which can stop it;save_custom_voicewrites the CustomVoice model beside the Base model it came from, the speaker at codec id 3000 and the weights in bfloat16. Each recording is laid out as inference reads a CustomVoice request, so the loss on a recording is the negative log-likelihood generation gives it (to 1e-4, checked step by step on a seeded model); the reference's script differs from its own inference in four ways, listed on the speech models page. The weights train in float32, and a bfloat16 model is refused: at these learning rates most steps are smaller than bfloat16 resolves beside a weight. On an M4 Max, the released 0.6B Base model fine-tuned on 100 lines of one speaker (10 minutes) in under 2 minutes with about 20 GB of memory at its peak; on 20 new lines it read at 13.8 characters a second against the speaker's 14.5, where cloning the speaker from a recording read at 16.8 to 17.6, with the same word error rate (3.5%) and speaker similarity (0.99).examples/voice_similarity.rscompares voices by their speaker vectors. -
pmetal train-ttsfine-tunes a Qwen3-TTS Base model on one speaker from the job specTrainTtsSpec, so the terminal UI, the desktop app (a Voice page under Train), the MCP server (train_tts, 60 tools now) and Python (pmetal.TrainTtsSpec) start it as the command line does. The dataset is the reference fine-tuning script's JSONL (audio,text, and optionallylanguageandref_audio), with recordings in any formattranscribereads; the result is a CustomVoice model thatpmetal speak --voice NAMEandpmetal serve --tts-modeluse like any other. Each step's loss, learning rate and gradient norm goes to--log-events, and Ctrl-C saves the model as it stands. -
Qwen3Asr::finetuneandpmetal train-asrfine-tune a Qwen3-ASR model on recordings and their transcripts.prepare_transcriptslays each recording out as transcription reads it (the context as the system turn, the audio as the user's) with the target after it,language NAME<asr_text>TRANSCRIPTand the end of the turn; the target is the reference's data format as given, or built from plain text and a language. The audio encoder and the language model train on the target's cross-entropy, in float32, andsavewrites the official release's layout in bfloat16. The loss on a transcript is the negative log-likelihood that decoding gives it.pmetal train-asrreads the reference script's JSONL (audio,text, and optionallylanguageandprompt) and is on every surface (TrainAsrSpec, thetrain_asrMCP tool, 61 tools now, a Transcription page under Train in the desktop app). -
Speech fine-tuning resists forgetting. A fine-tune on a little data forgets what the model knew: fine-tuned on 120 sentences of new product names alone, Qwen3-ASR-1.7B learned them (4 of 14 right to 12 of 14) and its LibriSpeech word error rate tripled.
FinetuneOptionsnow hasreplay_share(part of every batch drawn from general examples), a held-out set evaluated as training goes (eval_every, reported inFinetuneReport::evaluations) with early stopping that keeps the best weights (patience), andlora_rank(low-rank adapters on the decoder layers, every other weight frozen, folded in at the end so the saved model's layout is unchanged).pmetal train-asrtakes them as--replay-dataset,--replay-share,--eval-dataset,--eval-every,--patienceand--lora-r, and by default trains rank-16 adapters at 1e-4 for two passes of 8 recordings a step (FinetuneOptions::transcription()), warning when no general recordings are given to replay. Taught six names from 496 sentences, Qwen3-ASR-1.7B went from 4 to 10 of 14 names right; with replay its LibriSpeech word error rate stayed at the release's (2.19% and 4.82% against 2.15% and 5.11%), where the reference's settings tripled it (6.48% and 14.41%), and LoRA used 14 GB against 36 GB for every weight. -
A speech models page,
docs/models/speech.md, lists the Qwen3-TTS and Qwen3-ASR releases PMetal runs, and marks every feature of the reference packages as matched, missing, or done otherwise on purpose, with the reason. -
JobEvent::set_job_id(pmetal-core),ProcessStatus::state(pmetal-supervisor) andDtype::size_in_bytes(pmetal_runtime::compat). They give a job's events another job id, name a job's state as it is serialized, and give a dtype's element width, which code outside these crates used to work out by matching every variant, as it no longer can (see below).
Changed
- The enums and structs pmetal hands back are
#[non_exhaustive](breaking). That covers every crate's error enum; the events and statuses (JobEvent,JobStatus,Phase,JobKind,ProcessStatus,EventKind,TokenEvent,FinishReason, the trainers' phases and learning-rate events); the formats, dtypes and kinds pmetal detects or reads (ModelArchitecture,GgmlType,FileType,GgufVersion,Dtype,Quantization,TorchDtype,ChatTemplateType,ModelFamilyand the like); the model dispatch enums (DynamicModel,EncoderModel,PretrainModel); and the outputs, results, statistics, metrics and reports (StepMetrics,EvalMetrics,TrainingInfo, the Hub's listings, search results and plans, the OpenAI and Anthropic response bodies, the merge, quantization and calibration reports, and the like). Outside their crates, amatchon one of these enums needs a_arm, and a pattern on one of these structs ends with... They are read, not built: code that built aStepMetrics,EvalMetricsorTrainingInfo(a custom trainer, or a callback's test) starts fromDefault::default()orTrainingInfo::startingand sets the fields it needs. Variants and fields added to them from now on are not breaking changes. Config structs, request bodies and the enums that choose an option are unchanged. - No public error type names another crate's error type: the safetensors, JSON, YAML and bitcode failures they carry are their
source(), not their payload (breaking).MergeError::{Safetensors, Serde, Yaml}(pmetal-merge),DistillError::{Safetensors, Serde, Yaml, Bitcode}(pmetal-distill),DistributedError::Serialization(pmetal-distributed),LoadError::JsonandWeightFormatError::Json(pmetal-models),DynamicLoraError::Json(pmetal-lora) andIndexError::Json(pmetal-core) carried asafetensors::SafeTensorError,serde_json::Error,serde_saphyr::Errororbitcode::Errorand converted one withFrom, so a release of any of those libraries that changed its error type was a breaking change for pmetal. Each variant holds aBox<dyn std::error::Error + Send + Sync>:source()reaches the library's error,downcast_refrecovers it (downcast_ref::<serde_json::Error>(), for one), and the message is the same. Code that relied on?to convert one of those errors writes.map_err(|e| MergeError::Serde(e.into()))and the like. pmetal_distributed::{PeerId, Multiaddr}re-export the libp2p types that its errors, discovery events and topology carry, so code can name them without depending on libp2p itself. They are still libp2p's types, so a libp2p upgrade is a breaking change forpmetal-distributeduntil 0.9.0 replaces them.- MLX's buffer cache is bounded by default, to a tenth of the device's recommended working set (about 10 GB on a 128 GB Mac). MLX keeps freed GPU buffers for reuse up to its whole memory limit, and work whose shapes vary (requests of every length, recordings, batches) fills that with buffers nothing reuses: a speech fine-tune reached a 110 GB footprint on a 0.6B model. The bridge sets the bound at the first op, so every binary and the SDK get it; a limit set with
pmetal_runtime::memory::set_buffer_cache_limitalways stands, andusize::MAXis the explicit way back to an unbounded cache; on the command line,PMETAL_CACHE_LIMIT_MB(megabytes, orunbounded) sets the default for every command.buffer_cache_limit()anddefault_buffer_cache_limit()report them.pmetal servekeeps its 256 MB (--cache-limit), which now has tests: forty chat requests of different lengths through the router, and lines and recordings of every length through the speech models, stay within it. - A Qwen3-TTS process's peak memory falls by 0.4 to 1.1 GB: the codec's checkpoint loads straight into MLX's buffers (
pmetal_vocoder::checkpoint::load_safetensors). It was read whole into host memory and converted there, and macOS's allocator kept the freed pages: the 1.7B model's peak footprint falls from 6.0 GB to 4.9 GB with MLX's buffer cache off, and to 5.7 GB with it at its default. Float64 tensors, which MLX can't hold, are still decoded on the host. pmetal servelistens at once and loads its models behind it./healthanswers from the start;/v1/modelslists a model only once it has loaded and warmed up (two tokens for a language model, a short line for a voice, so the first request is as quick as the rest), and a request for a model still loading gets503withRetry-After. A model that fails to load stops the server with its error. Before, the server bound its port only after the model had loaded.--modelis no longer required when--tts-modelis given;pmetal_serve::server::run_server_loadingdoes the same for a library caller.pmetal --versionnames the commit it was built from,pmetal 0.8.0 (8117445f), so a program that starts pmetal can tell the build it was tested against from another; a build outside a git checkout (from crates.io) prints the version alone.rustix1.1.6 (RUSTSEC-2026-0486: its xattr functions marked unwritten bytes as initialized when given a zero-length buffer).pmetal_serve::routes::AppState::engineis nowAppState::llm, an optionalModelSlotread throughAppState::llm(), so a server can hold models other than a language model, and a model that is still loading. Migration:state.engine.x()becomesstate.llm()?.x();llm()isServeError::NotServed(404) when the server serves no language model andServeError::ModelLoading(503, withRetry-After) while it loads.build_router,build_router_withandrun_serverare unchanged.Telemetry::rendertakes the engine as anOption.- The engine speed comparison in
docs/cli/infer.mdis a measured table. It gave the architectures' own engines as 1.0x to 1.6x the shared model's speed without the checkpoints behind the figures; it now gives each measured checkpoint with its revision, the machine, both engines' decode rates and the command that reproduces them. pmetal serve'spmetal_generation_tokens_per_secondsays what it measures. The figure is unchanged: completion tokens over each generation's whole time, the prompt included, which is not the decode rate. Its HELP text read "Completion tokens per second of each generation"; it anddocs/cli/serve.md, for it and for/v1/metrics'rolling_tokens_per_second, now say so.- The native engines' benchmark trials run on a cache the caller builds (breaking).
pmetal_runtime::{qwen3_native, llama4_native, deepseek_native, gpt_oss_native}::benchmark_trialtakecache: &mut NativeCache(empty, built as for generation) after the weights, and Qwen'sturboquantargument is gone, since the cache carries it;pmetal::native_inference::benchmark_nativetakes the affine cache'squant_configafterturboquant. GenerationOutput(pmetal-models) andNativeGenerationOutput(pmetal) are#[non_exhaustive], and both have a newload_timefield (breaking). Code outside their crates can no longer build them with a struct literal or take them apart with a pattern that names every field. Build aGenerationOutputwithGenerationOutput::new(token_ids, num_generated, stop_reason)and set the other public fields on it, and end a struct pattern with... ANativeGenerationOutputcomes frompmetal::native_inferenceand is read, not built. Fields added to either from now on are not breaking changes.GenerationOutput(pmetal-models) gives why a generation ended as onestop_reason(breaking). Itsstopped_by_tokenandstopped_by_lengthflags are replaced bystop_reason, aStopReason:StopToken,Length,Interrupted(the token callback stopped it) orRepetition(a repetition guard did), withas_str()for the namepmetal infer --jsongives it andDisplayfor the footer's words. A generation has exactly one reason, and one the flags could only give as twofalses is named. Readoutput.stopped_by_tokenasoutput.stop_reason == StopReason::StopToken.StopReasonis#[non_exhaustive]: reasons added later are not breaking changes, so amatchon it needs a_arm. Python'sInferResultkeeps itsstopped_by_tokenandstopped_by_length.pmetal infer's time to the first token leaves the model load out on every engine, and the load is reported on its own (#38).time_to_first_token_secondsin--jsonand the footer's "to the first token" were timed from the end of the runner's preparation. The architectures' own engines (Qwen3, Qwen3.5/3.6/3.8, Gemma 4, Llama 4, DeepSeek V3, gpt-oss) load their weights after that point, and so does the ANE, so on those the figure included the load; the shared model loads during the preparation, so on it the figure did not, while the footer said "model load included" on both (0.77 s to the first token after a 20 s load, on Nemotron 3.5). The first token is now timed from the start of generation without the load on every engine, as mlx-lm, llama.cpp and vLLM time it, and the load is a figure of its own:model_load_secondsin--json, and aModel load:line in the footer. On the native engines,--aneand native--mtp,time_to_first_token_secondsis smaller than before by the load; on the shared model it is unchanged, and so isseconds. The desktop app's TTFT, which reads the footer, changes the same way. Reported by @texchi2.
Fixed
pmetal infer's decode rate is the tokens after the first over the time from the first to the last, and both engines time their steps alike. The native engines' step metrics sorted the step times and then dropped up to ten as the warm-up; after the sort those were the fastest steps, so the average step time read high, the rate low, and the median was taken over every step. Both engines now leave out the first step in the order it ran (DecodeMetrics::from_step_times). The rate in the footer'sDecode:line, which the desktop app and the terminal UI show, anddecode_tokens_per_secondin--jsonare now(n - 1) / (last token - first token)(pmetal_runtime::decode::decode_rate), so they agree withseconds. One token has no rate:decode_tokens_per_secondisnulland the footer has noDecode:line. Runs that measure no step times (--ane,--mtp, a draft model) now get the line too, with the rate alone. The figures differ from before, most on the native engines.- The architectures' own engines time a decode step through its token's readback. Their step timer stopped once the next step was queued, before the wait for the GPU, so the footer's
avg=andp50=step times, and theDecodeMetricsthey come from, read fast: by 3% on a warm run of Qwen3.5 0.8B (4-bit) and by 26% on a cold one, where the shared model's are within 1%. A step now runs from the start of its iteration to its token's readback, without the token callback, as on the shared model, and the last token's step is timed too. The decode rate (Decode: N tok/sanddecode_tokens_per_second) comes from the token times, and this does not change it. - On the architectures' own engines, a stop token that ends a run is no longer counted as generated. A run that ended on EOS or another stop token counted it in
pmetal infer'sgenerated_tokens(--json) and "Generated N tokens", innum_generated(Python'sInferResult, and theGenerationOutputofInferenceRunner) and in the decode rate, one more than the reply has, and one that met it in the last slot the length allows saidstopped_bylength. The stop token is now left out and stops the run, as on the shared model and the ANE. The engines are Qwen3, Qwen3.5/3.6/3.8, Gemma 4, Llama 4, DeepSeek V3 and gpt-oss. - A run its caller stops says so, on every engine. After Ctrl-C or SIGTERM,
pmetal infer's footer saidStopped by: EOS tokenon the architectures' own engines andStopped by: max lengthon the shared model; it now saysStopped by: interruption, as--jsonalready gavestopped_byinterrupted. Underneath, a run whose token callback stopped it was reported as stopped by a token on the architectures' own engines, and by the length on them and on MTP when the stop came on the last token the length allows;GenerationOutput::stop_reasonis nowInterruptedon every engine, as it was on the shared model. --detect-repetition's stop is reported as one, with the newstopped_byvaluerepetition. A run the guard stopped saidstopped_byeoson the architectures' own engines andlengthon the shared model, and both counted the token that closed the loop, which the guard keeps from the reply. It now saysrepetitionin--jsonandStopped by: repetition loopin the footer, andgenerated_tokenscounts what the reply has. Consumers of--jsonshould expectstopped_byvalues to be added. In Python,InferResultfor such a run (detect_repetition=True) hasstopped_by_tokenfalse where the architectures' own engines said true, and anum_generatedone lower.pmetal infer --benchmarktimes the KV cache the run asks for on the architectures' own engines (#45). The native benchmark built every trial's cache plain:--kv-quant,--kv-k-bits/--kv-v-bits,--kv-quant-presetand--kv-qjlwere selected and logged and then not used on Qwen3, Qwen3.5/3.6/3.8, Llama 4, DeepSeek V3 and gpt-oss, and neither was--kv-turboquanton Llama 4, so the rates and the peak memory were those of the model-dtype cache. Each trial now runs on a cache built by the same function generation builds it with, from Qwen weights prepared as generation prepares them for that cache (the Hadamard preconditioning, a mixed-bit preset's outlier permutation, the QJL matrix).pmetal infer --benchmarkruns on the shared model (#38). It loaded the model and then stopped with "only implemented for the native bridge path" on every architecture without an engine of its own (Nemotron 3.5 among them) and on every run the shared model takes (--lora,--fp8,--experts-dir). The shared model is now timed as the native engines are, asmlx_lm.benchmarkdoes: a random prompt, greedy generation with the stop tokens off, one warm-up run, then the timed runs from an empty cache, each giving the prompt rate, the generation rate and the peak memory. Gemma 4's own engine still has no benchmark, and says so before it loads. What a benchmark cannot time is refused before anything loads: a run without--benchmark-prompt-tokensor with--profile-layers(both refused only after the load before), and one with--ane,--mtpor--draft-model, which a benchmark does not use (it times plain generation on the GPU, and used to do that without saying so). Reported by @texchi2.InferResult.generation_secondsin the Python bindings is the time from the first token to the last, as its documentation says (#44). It was timed from the call into the engine, so it also held the prompt's prefill and, on the architectures' own engines, which load their weights as generation starts, the model's load.pmetal.infer_with_metricswith one token now reports 0.0 seconds of generation, as it should. A run of n tokens spans n - 1 intervals, so its decode rate is(num_generated - 1) / generation_seconds, and a single token has none.
Coming in 0.9.0
- Config structs get builders and become
#[non_exhaustive]in the same release, together with the enums that choose their options, so a new setting stops being a breaking change without the structs becoming harder to build than they are today pmetal-distributedgets peer id and address types of its own in place of libp2p's, so a libp2p upgrade is no longer a breaking changepmetal-merge'sparse_dtype,patch_config_dtype,TensorWriter::with_dtypeandTensorWriter::target_dtypetake and return pmetal's own dtype in place ofsafetensors::Dtype, which they still use in 0.8
TL;DR: What's Changed
- deps: every release at least a week old, as of 2026-11-22 by @nicholasjpaterno in #35
- deps: cookie 0.18.3 in the GUI lockfile, for RUSTSEC-2026-0594 by @nicholasjpaterno in #39
- deps: parquet 60.2.0 in both lockfiles, for RUSTSEC-2026-0595 by @nicholasjpaterno in #41
- publish.sh: wait only when crates.io asks, and resume a stopped release by @nicholasjpaterno in #40
- infer: --benchmark on the shared engine, and the first token timed without the load by @nicholasjpaterno in #43
- python.yml: the Python suite runs on every pull request, and passes by @nicholasjpaterno in #47
- release.yml: publishing waits for approval in the release environment by @nicholasjpaterno in #48
- ci: documentation-only changes skip jobs instead of whole workflows by @nicholasjpaterno in #50
- infer: the native --benchmark times the KV cache the run asks for by @nicholasjpaterno in #49
- py: generation_seconds runs from the first token to the last by @nicholasjpaterno in #46
- test(py): the GIL tests wait on another Python thread instead of counting ticks by @nicholasjpaterno in #51
Full Changelog: v0.7.1...v0.8.0