fix: LFM2 multiple tool calls#316
Merged
HenryNdubuaku merged 1 commit intocactus-compute:mainfrom Feb 4, 2026
Merged
Conversation
Signed-off-by: mhayes853 <[email protected]>
Collaborator
|
@mhayes853 Thanks for this! does the tool call pass on your end? ╔══════════════════════════════════════════╗
║ MULTIPLE TOOLS TEST ║
╚══════════════════════════════════════════╝
├─ User prompt: Send a message to Blob and get the weather for San Francisco.
Response: I'm sorry, I don't have access to a tool to send messages or retrieve weather data directly. However, if you'd like the current weather for San Francisco, I can help with that using the available tool. Let me know how I can assist!
[Results]
├─ Function call: YES
├─ Correct tool: NO
"success": true,
"error": null,
"cloud_handoff": false,
"response": "I'm sorry, I don't have access to a tool to send messages or retrieve weather data directly. However, if you'd like the current weather for San Francisco, I can help with that using the available tool. Let me know how I can assist!",
"function_calls": [],
"confidence": 0.9716,
"time_to_first_token_ms": 829.07,
"total_time_ms": 1798.55,
"prefill_tps": 331.70,
"decode_tps": 52.61,
"ram_usage_mb": 51.33,
"prefill_tokens": 275,
"decode_tokens": 52,
"total_tokens": 327
└─ Status: FAILED ✗
✗ FAIL │ tool_multiple_tool_call_invocations |
Contributor
Author
|
Seems to be model dependent (I've had a 100% success rate with larger models >=1.2B params running on M1 pro). If you want, I can loosen the assertion a bit in the test for now to not expect both tool calls outright. I mainly needed it to verify that the parsing logic was fine if the model invoked both tools. |
Collaborator
|
Ok makes sense, it seems the 1.2B version is capable of that. |
ncylich
pushed a commit
that referenced
this pull request
Feb 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Parsing logic was incorrect when lfm2 would emit multiple tool calls.
eg.
The call for
get_weatheris embedded weirdly in the call forsend_message.This PR corrects the parsing logic inside the FFI utils, and adds a new test for handling multiple tool call invocations.