[GH-ISSUE #4588] Tool calling feature support #2879

Closed
opened 2026-04-12 13:13:51 -05:00 by GiteaMirror · 2 comments
Owner

Originally created by @Goekdeniz-Guelmez on GitHub (May 23, 2024).
Original GitHub issue: https://github.com/ollama/ollama/issues/4588

since there are more and more models that support function/tool calling. I think it would be a great feature for that support. It can be hard because the models could need Special tokens. My thought is that you can be able to set these spetial tokens or customizations in the Modelfile, something like:

PARAMETER tool_calls_start ""
PARAMETER tool_calls_end ""
PARAMETER tool_results_start ""
PARAMETER tool_results_end ""
...

or (my preferred one):

TOOL_CALLS """"[TOOL_CALLS] {response}"""
AVAILABLE_TOOLS """[AVAILABLE_TOOLS] {available tools list} [/AVAILABLE_TOOLS]"""
TOOL_RESULTS """[TOOL_RESULTS] {tool response} [/TOOL_RESULTS]""""

The API could be the same with OpenAI's or something different.

Originally created by @Goekdeniz-Guelmez on GitHub (May 23, 2024). Original GitHub issue: https://github.com/ollama/ollama/issues/4588 since there are more and more models that support function/tool calling. I think it would be a great feature for that support. It can be hard because the models could need Special tokens. My thought is that you can be able to set these spetial tokens or customizations in the Modelfile, something like: ```text PARAMETER tool_calls_start "" PARAMETER tool_calls_end "" PARAMETER tool_results_start "" PARAMETER tool_results_end "" ... ``` or (my preferred one): ```text TOOL_CALLS """"[TOOL_CALLS] {response}""" AVAILABLE_TOOLS """[AVAILABLE_TOOLS] {available tools list} [/AVAILABLE_TOOLS]""" TOOL_RESULTS """[TOOL_RESULTS] {tool response} [/TOOL_RESULTS]"""" ``` The API could be the same with OpenAI's or something different.
GiteaMirror added the feature request label 2026-04-12 13:13:51 -05:00
Author
Owner

@jmorganca commented on GitHub (May 23, 2024):

merging with https://github.com/ollama/ollama/issues/3137

<!-- gh-comment-id:2128062492 --> @jmorganca commented on GitHub (May 23, 2024): merging with https://github.com/ollama/ollama/issues/3137
Author
Owner

@jmorganca commented on GitHub (May 23, 2024):

Thank you for the issue 😊 !

<!-- gh-comment-id:2128062639 --> @jmorganca commented on GitHub (May 23, 2024): Thank you for the issue 😊 !
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#2879