* MLX: reduce Qwen3.8 Flash Next memory use
For NVFP4 creation, retain source precision for sensitive QSA projections
and non-expert MTP weights. Keep routed experts and PLE at NVFP4, and
promote other eligible weights to MXFP8.
Keep NVFP4 PLE tables host-backed, transferring only selected packed rows
and their scales to MLX. Honor scalar and per-expert NVFP4 global scales
in MoE, and per-shard global scales in host-backed PLE.
Use compressed QSA block selections in fused indexed Metal attention for
long prefill batches, retaining the graph fallback. Co-locate component
loading and forward methods, with explicit quantization and cache ownership.
* mlx: skip materializing host-backed tensors
Let models exclude tensors already owned by host storage from MLX loading.
Avoid allocating and discarding the full Qwen PLE tables at startup while
preserving the resident fallback.
* address comments
These architectures were forced to num_parallel=1 because the older Go
engine's recurrent caches held one sequence. llama-server supports
multiple slots for all of them so we can allow parallelism now.
NVIDIA's libcusolver looks for its dependencies only in its own
directory, so libcublas and libnvJitLink resolved to the host's copies
and MLX failed to load when those didn't match the bundled ones. Preload
the bundled copies by full path before loading MLX.
The OpenAI-compatible endpoints filled in sampler options the client
left out: temperature and top_p fell back to 1.0, and /v1/completions
always sent frequency_penalty and presence_penalty as 0. Request
options are applied last, so these values replaced the model's packaged
defaults. /api/chat honored those defaults; /v1 did not.
Omitted options are now left unset on /v1/chat/completions,
/v1/completions and /v1/responses, so the model's parameters apply, the
same as on /api/chat. Values the client sends still win, including an
explicit 0. On /v1/completions, top_p and the penalties are now
pointers so "omitted" and "0" can be told apart.
Clients that send no sampler options now get the model's defaults
instead of 1.0/1.0. A model with no sampler parameters gets Ollama's
defaults (temperature 0.8, top_p 0.9), as on /api/chat.
Fixes#17744Fixes#18690
MLX's argpartition sorts the whole row, and a row longer than one block
of the GPU sort takes a multi-pass merge sort. TopKIndices sorts each
2048-value chunk in a single block, then only the chunks' top k, and
returns the same indices in the same order.
The sampler's top_k and top_logprobs and the DFlash2 candidate selector
use it in place of a full-vocabulary argpartition.
Fixes for running LFM3 GGUFs on the llama-server runner, plus GGUF
text-to-speech that turns on once llama.cpp is bumped past b11901.
- BOS: honor an explicit tokenizer.ggml.add_bos_token. LFM3 GGUFs (and
lfm2:24b) set it to false and expect the template's BOS, which the
lfm2 default was stripping. The lfm2 default still applies when the
key is absent. On lfm2:24b, WikiText PPL goes from 81.3 to 72.0.
- repeat_last_n -1 now maps to the context size; llama-server rejects
negative values.
- Audio-only projectors (LFM3-Audio) no longer advertise vision, so
clients don't send images the model can't take.
- /v1/audio/speech on GGUF models calls llama-server /tts chunk by
chunk. Renderers opt in through a new SpeechPrompter (voices,
voice parsing, chunking), so other speech models can add their own.
The LFM3 voice and chunking helpers move from the MLX runner into
model/renderers and are shared by both runners.
DFlash2 adds block-local dynamic convolutions and a candidate selector
to DFlash. The selector proposes each token conditioned on its
predecessor and returns each position's candidate distribution, which
verification uses to keep the output exact. Like the reference, the
draft samples with the request's temperature only.
A DFlash2 session drafts seven tokens every round on the existing
snapshot verify path instead of following the depth controller, whose
shallower picks lose more accepted tokens than they save in verify time.
qwen3.5-family targets now expose the layer taps, token embeddings and
raw logits a DFlash draft needs.
* MLX, MLX-C: version bump
The MLX-C pin now provides its own bindings for gather_qmm global_scale
and fast::gated_delta_update, so those two carried patches drop out.
Carry 0001-mlx-c-sdpa-window-size instead: sliding-window attention
added a window_size argument to fast::scaled_dot_product_attention
(ml-explore/mlx#4734) that MLX-C has not bound yet, to be regenerated
from MLX-C once the upstream binding PR merges. The SDPA wrappers gain
a window size argument; all call sites default to the full context.
* mlxrunner: dispatch sliding-window prefills to the native SDPA window
Sliding layers no longer materialize a causal∩sliding mask for prefill
chunks past the window: resolve() dispatches {causal, window} natively
when the rotating cache's L>1 concat has linearized the ring and the
mask is otherwise pure causal, via a new MaskApplier.NativeWindow hint.
Vision relaxations, padding, model arrays, and decode keep the
materialized path. No model changes; sinks compose natively.
Dynamic sizing can floor the smallest image grid below its intended 70-token budget, losing detail in small images. Round that grid up for the compact tower, capped at the next supported budget.
Keep explicit budgets and the existing sizing for larger and unified towers. Update geometry and media-expansion tests.
* mlxrunner: spell out symbols, numbers and links for Phonon
* docs: describe speech text normalization
* mlxrunner: fix Phonon misreadings inherited from xn-ptts
* mlxrunner: fix remaining Phonon misreadings
* mlxrunner: fold Phonon letters from the vocab, read #, _ and lists
* mlxrunner: add xn-ptts license notice for Phonon
* mlxrunner: move the xn-ptts license notice into normalize.go
* mlxrunner: fix remaining Phonon readings and port elongations
* docs: speech reads times and numeric dates
* mlxrunner: fix Phonon readings found in a listening pass
* docs: speech reads times and dates as written
* decision: allow empty state for vllm-d3
* server: reuse decoded state in System One tests
---------
Co-authored-by: Patrick Devine <patrick@ollama.com>
* renderers: add gemma4-nemotron renderer
Add a Gemma 4 renderer variant that renders assistant content before
its tool calls rather than after the tool responses. Models opt in with
RENDERER gemma4-nemotron; gemma4 auto-detection is unchanged.
Adds the corresponding chat template as a test fixture for Jinja parity
checks.
* mlx: support Gemma 4 targets with DFlash drafts
Load a draft-owned output head when its config requires one, while preserving the target-head path used by existing DFlash models.
Expose Gemma 4 hidden-state taps and raw logits for speculative decoding. Report safetensors target precision independently of quantized draft weights.
Replace the prerelease checkpoint path with Gradium's GA format, including default-voice import and speech conditioning. Set the 0.40.9 minimum, update the speech docs, and test import, inference setup, and rejection of the old checkpoint.
* flint: fix replies with thinking disabled
Close the thinking section when think:false so Flint answers directly. Default and think:true prompts are unchanged.
* update template