Skip to content

LFM2.5 outputs [func(arg='value')] Pythonic syntax, not JSON#91

Merged
davidkoski merged 2 commits intoml-explore:mainfrom
tpae:main
Feb 10, 2026
Merged

LFM2.5 outputs [func(arg='value')] Pythonic syntax, not JSON#91
davidkoski merged 2 commits intoml-explore:mainfrom
tpae:main

Conversation

@tpae
Copy link
Copy Markdown
Contributor

@tpae tpae commented Feb 1, 2026

Proposed changes

I was trying hard to debug why LFM2.5 still didn't call the tools correctly. After studying this: https://github.com/Liquid4All/cookbook/tree/main/examples/flight-search-assistant

It turns out LFM2 uses Pythonic syntax, not JSON.

I was able to verify this to be fully working now.

Checklist

Put an x in the boxes that apply.

  • I have read the CONTRIBUTING document
  • I have run pre-commit run --all-files to format my code / installed pre-commit prior to committing changes
  • I have added tests that prove my fix is effective or that my feature works
  • I have updated the necessary documentation (if needed)

@tpae
Copy link
Copy Markdown
Contributor Author

tpae commented Feb 1, 2026

cc @davidkoski @awni

Looks like this fix should be added to mlx-lm also.

@tpae
Copy link
Copy Markdown
Contributor Author

tpae commented Feb 5, 2026

Hey @davidkoski , any chance this will be merged? any feedback for me

@davidkoski
Copy link
Copy Markdown
Collaborator

Hey @davidkoski , any chance this will be merged? any feedback for me

Yes, the change looks good at first glance. Just working through a temporary backlog so it is delayed :-)

I am rerunning CI (we/github had some infrastructure issues that made it fail). I will give a closer look provide feedback when I get a chance, but it may be ready to go.

@davidkoski davidkoski merged commit 0edf11a into ml-explore:main Feb 10, 2026
3 of 4 checks passed
viktike pushed a commit to viktike/mlx-swift-lm that referenced this pull request Mar 7, 2026
…ore#91)

* added prefix matching for flexible parsing

* convert to pythonic tool converter
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