Skip to content

Pythonic tool calling for LFM2 models#864

Merged
awni merged 3 commits intoml-explore:mainfrom
viktike:pythonic_tool_calling
Feb 9, 2026
Merged

Pythonic tool calling for LFM2 models#864
awni merged 3 commits intoml-explore:mainfrom
viktike:pythonic_tool_calling

Conversation

@viktike
Copy link
Copy Markdown
Contributor

@viktike viktike commented Feb 8, 2026

This commit adds a tool parser for one-shot tool calls:

<|tool_call_start|>[func_name1(params_name1=value1)]<|tool_call_end|>

Similar to: ml-explore/mlx-swift-lm#91

This PR also fixes tool calling with non-thinking, instruct style models, where the assistant only calls the selected tool, and doesn't output any other text content in it's turn.

Copy link
Copy Markdown
Member

@awni awni left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, thanks!

@awni awni merged commit 84ae19e into ml-explore:main Feb 9, 2026
2 checks passed
0xDaizz added a commit to 0xDaizz/mlx-lm-server that referenced this pull request Feb 11, 2026
- 645a326 Bump version for next release (ml-explore#865)
- 84ae19e Pythonic tool calling for LFM2 models (ml-explore#864)
- 8f1c56e Fix DeepSeek V3.2 indexer and weight loading (ml-explore#866)
- aca4c14 Make validation set optional in training process (ml-explore#857)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.

2 participants