* ux: show multiple licenses
A model can carry several license layers, such as a base model and a
draft model from different publishers. The show API now returns them
separately in licenses, and the CLI prints each one on its own. license
is deprecated but still returned for older clients.
* address comments
Settle prior GPU work before measuring cache allocations, remove the
fixed decoder-test deadline, and test retention policy independently of
host memory pressure. Keep allocation limits and cancellation coverage
intact without changing runtime behavior.
Tests: repeated race runs on Metal v3/v4 and M1; golangci-lint.
* mlx: speed up batched Inkling target verification on Metal
Reuse expert route metadata across output tiles in wide NVFP4 and MXFP8
gathers. Share the Inkling NVFP4 route plan across gate/up and down, and
use matrix tiles when at least five routes share an expert. Run short
target projections in a single tiled dispatch while preserving per-row
FP32 reduction order and the vocabulary softcap.
Keep the published weights, trained 4-over-6 activation quantizer, and
cache dtypes. Matrix expert tiles accumulate in FP32 with a different
summation order.
* address comments
The test sampled real host memory. On a loaded CI runner a physical
shortfall (FreeMemoryAboveTarget < 0) lets trimHistory evict the
incoming request's matching history, so round 1 found no reuse.
Make batchScheduler.memory a small interface and inject a fixed ample
observation; the workspace reserve alone still drives reclamation.
Gemma 4 picks each image's soft-token budget dynamically, so small
images can use as few as 70 tokens. A checkpoint that declares a
vision_soft_tokens_per_image above the default 280 was tuned at that
resolution; use it as the minimum budget so small images aren't
downscaled below it. Checkpoints declaring 280 keep the existing
behavior.
Gemma 4 sometimes closes an array while an object inside it is still
open, as in {items:[{label:<|"|>a<|"|>]}, leaving out one "}". The call
fails to parse and is dropped. Add a repair candidate that inserts the
missing "}" at the first such spot; like the other repairs, it is used
only if the result parses as JSON.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Emit the raw tool call from the state machine and parse it in Add, so a
parse error is returned the same way the other parsers return it, and
name the tool in the error where the parser reads its arguments. Simplify
the missing-brace repair: it fixes the first spot and leaves validation to
the JSON parse, like the other repairs.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
When a Gemma 4 tool call could not be parsed or repaired, the parser
logged a warning and dropped it. The response ended with no text, no tool
call and no error, reported as a success, so the client had nothing to
act on.
Add a repair for the most common failure we saw: the model closes an
array while an object inside it is still open, leaving out one "}". When
a call still cannot be parsed, return an error that names the tool, as
the qwen3coder and glm46 parsers already do.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* inkling2: faster short histories, draft proposals and conv snapshots
Histories under 1024 keys now use the Metal split attention kernels
that already served longer ones. Below that, the stock graph widened
the whole history to FP32 and built a dense mask per query, which cost
more than the attention itself. The split sums match MLX's one-pass
reduction to rounding. Other backends are unchanged.
A single request's unpadded block takes the fused attention merge and
gate that batched requests already use.
Draft proposals skip candidates less than a tenth as likely as the
best one, and an adaptive selector projects only the rows it uses onto
the vocabulary. Verification still samples from the request's own
settings and corrects for the proposal, so outputs are unchanged.
Drafters without adaptive depth are unaffected.
Early conv snapshots share one short window instead of copying the
whole forward's input.
* avoid bogus failures on virtual metal CI systems
* inkling2: faster Metal decode, prefill and draft rounds
Add Inkling-only Metal kernels, each with a stock-graph fallback, gated
by GPU generation and size class: short BF16 products, deduplicated
NVFP4/MXFP8 expert gathers with fused SwiGLU, fused loop controllers and
residual mixing, relative-position split attention, fused short
convolutions, faster global prefill, an ordered window cache that
appends in place, and an 8-bit draft with a 4-bit vocabulary head
(proposals only; outputs stay exact).
Move the helpers that MoE architectures copied verbatim (SupportsGatherQMM, TensorAny, FreeTensorKeys, StackAndClone, TransposeExpertWeightForGatherMM, FuseExpertStacks) into mlxrunner/model, and add Root.Quantization and Root.LoadTokenizer for the quantization and tokenizer setup each model constructor repeated, including the dflash and gemma4 assistant drafts. No behavior change.
Compute the normalized residuals, query scores, and weighted sum in one
dispatch. Keep intermediate values in the threadgroup and preserve the
existing reduction order and rounding.
* mlxrunner: add Inkling 2 Mini
* mlx: fuse Inkling 2 Mini residual mixing on Metal
Fuse RMS normalization and query scoring in one kernel. Apply the
softmax weights in a second kernel to avoid storing per-query products.
* create: expose Inkling 2 Mini context length in model metadata
Copy model_max_length to max_position_embeddings during import so
ollama show reports the checkpoint's context length. Reject configs
that specify conflicting limits.
* mlxrunner: reduce Metal dispatches in Inkling 2 Mini decode
Reuse the prefill mask shader to compute relative position bias in one
dispatch for single-query attention. On M3 Ultra with Metal 3, compute
the loop controller's gain and forget projections in one matrix multiply.