Skip to content

Fix LFM2.5 tool parser inference#1260

Open
blairhudson wants to merge 1 commit intoml-explore:mainfrom
blairhudson:fix/lfm25-tool-parser-inference
Open

Fix LFM2.5 tool parser inference#1260
blairhudson wants to merge 1 commit intoml-explore:mainfrom
blairhudson:fix/lfm25-tool-parser-inference

Conversation

@blairhudson
Copy link
Copy Markdown

LFM2.5 tokenizers expose <|tool_call_start|> and <|tool_call_end|> tokens, but do not provide chat-template metadata that lets mlx-lm infer a tool parser. As a result, server responses can emit raw tool-call markup in message.content instead of OpenAI-compatible tool_calls.

This adds tokenizer-vocab based parser inference for that marker pair and maps it to the existing pythonic tool parser.

Tests:

  • uv run --with-editable . --with unittest-xml-reporting python -m unittest tests.test_tool_parsing tests.test_tokenizers.TestTokenizers.test_tool_calling

@blairhudson blairhudson mentioned this pull request May 8, 2026
3 tasks
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