Skip to content

LFM3-1.7B on MLX and GGUF; refused attachments are reported, never dropped - #58

Open
lpalbou wants to merge 6 commits into
mainfrom
lfm3-addition
Open

lpalbou wants to merge 6 commits into
mainfrom
lfm3-addition

Conversation

@lpalbou

@lpalbou lpalbou commented Dec 1, 2026

Copy link
Copy Markdown
Owner

What this adds

LFM3-1.7B (Liquid AI's text model) on the MLX route (through mlx-vlm, chosen by the model type in config.json) and on the GGUF route (llama.cpp): registry entries, prompt format, tool calls, streaming, thinking control, structured output.

What changes for every model (not only LFM3)

  • An attachment a model cannot take is refused by name instead of being dropped or replaced by a placeholder. A plain request gets HTTP 400 invalid_request_error / unsupported_feature; a streamed request gets the same as a typed error event at the start of the stream, which Core's own OpenAI-compatible client raises as UnsupportedFeatureError and does not retry. The streamed request path itself is unchanged from 2.41.0.
  • A JSON object in an answer is a tool call only when it names a tool that was offered; with no tools offered nothing is a call. A call-shaped object naming an unknown tool is still reported as unavailable_tool.
  • The 160-character buffer in the GGUF stream is removed: first token after 0.015-0.045 s on LFM3-1.7B (was 0.39 s).
  • A voice note for a model that hears, on a route that cannot carry audio, is served by the configured speech-to-text.
  • A request stopped while it waits for a busy shared model never generates.
  • mlx-vlm floor raised to 0.7.12 (LFM3 needs it); a clear error names the installed version when it is older.

Only LFM3-1.7B is opted in to the GGUF template tool block; LFM3-VL, Omni and Audio and every other family keep the 2.41.0 behaviour.

Tier and checks

Tier F (full): shared code paths.

  • Local gate scripts/ci_local.sh abstractcore --jobs 3 --allow-skipped on b0ea074f: GREEN, 11 pass, 2 skipped (Linux and Windows command sandboxes, which only GitHub runs). Python 3.9 to 3.13, local-model job, build, docs, console-tui crate and MSRV.
  • Real weights (Apple M5 Max): LFM3-1.7B GGUF 8 of 8 and MLX 8 of 8 real-weights tests; streamed tool call recognised, no call without tools; structured output one generation, 0.37-0.41 s with thinking off; a Gemma 4 GGUF tool round trip gives the same call and answer as on 2.41.0.
  • Two adversarial reviews and five follow-up passes; the last verdict was to open this pull request once the gate is green.

Not in this change, to do before a release

  • One streamed request through the server on real MLX and GGUF weights.
  • The existing Qwen3.8 MTP and prefix-cache live tests on mlx-vlm 0.7.12.
  • The root installer's llama.cpp pin (LFM3 GGUF needs llama-cpp-python 0.3.38 or newer).
  • The gateway's Telegram wording for a refused attachment.
  • Follow-ups recorded during review: the GGUF chat format is still chosen from the model's name for Qwen-named files (the Qwen3.5-0.8B tool round trip answers garbage, as on 2.41.0); on Python 3.9/3.10 the first Office document read downloads NLTK data (as on 2.41.0).

…el type, tool calls, streaming; an attachment a model cannot take is refused by name; a JSON object is a tool call only when it names an offered tool; first GGUF token no longer buffered (work in review, not yet gated)
…e the stream opens and an accepted one starts at once as before; no tools offered means no tool call; structured output on a GGUF honours the thinking setting; template tools opted in for LFM3-1.7B only
…ns at once, also when a shared model is busy); a refused streamed request arrives as a typed error event that Core's own client does not retry; a request stopped while waiting for a busy model never generates
…tream (other servers' events as before); test for a non-streamed call stopped while waiting for a busy model; changelog wording
…etches NLTK data on import); the LFM3 structured-output case skips without llama-cpp-python
…iming bounds only under ABSTRACTCORE_TIMING_STRICT=1); a stream cancelled by a Stop is logged at INFO

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant