Skip to content

Require mlx-swift-lm 3.33 and record MLX reasoning as transcript entries - #449

Open
james-333i wants to merge 1 commit into
huggingface:mainfrom
james-333i:feat/mlx-reasoning-entries
Open

james-333i wants to merge 1 commit into
huggingface:mainfrom
james-333i:feat/mlx-reasoning-entries

Conversation

@james-333i

Copy link
Copy Markdown
Contributor

mlx-swift-lm 3.33 adds two cases to Generation: .reasoning(String) and .steering(SteeringEvent). MLXLanguageModel switches over that enum in respond and in the streaming tool loop, so neither compiles against 3.33 today.

This moves the pin to 3.33 and handles both cases.

Reasoning

3.33 delivers thinking text separately from .chunk, with the delimiters already removed. This collects it per round and records it as a Transcript.Entry.reasoning, following the Ollama backend:

  • In a tool round, the entry is appended before the round's tool calls and passed to profileDidProduceEntries, so onReasoning runs for MLX.
  • In the final round, the entry is appended so it reaches the response and the last snapshot.
  • Transcript.Reasoning.Origin gains an mlx case so other providers do not replay it as their own.

Replay is unchanged. convertTranscriptToMLXChat already skips reasoning entries.

Steering

Only MLXLMCommon.ChatSession emits steering events. This backend drives generation directly and never creates one, so the case is ignored.

3.33 also adds a loader for Hadamard-rotated ternary checkpoints (prism_hadamard_qwen35), which is what prompted the update.

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