[GH-ISSUE #2417] Tools support in ChatCompletion endpoints #1408

Closed
opened 2026-04-12 11:16:43 -05:00 by GiteaMirror · 10 comments
Owner

Originally created by @pamelafox on GitHub (Feb 8, 2024).
Original GitHub issue: https://github.com/ollama/ollama/issues/2417

Originally assigned to: @bmizerany on GitHub.

We'd love tools support so we can use ollama with our existing OpenAI-using apps. Not sure if that's possible across the board with all models.

Originally created by @pamelafox on GitHub (Feb 8, 2024). Original GitHub issue: https://github.com/ollama/ollama/issues/2417 Originally assigned to: @bmizerany on GitHub. We'd love tools support so we can use ollama with our existing OpenAI-using apps. Not sure if that's possible across the board with all models.
GiteaMirror added the compatibilityfeature request labels 2026-04-12 11:16:44 -05:00
Author
Owner

@carsonkahn-external commented on GitHub (Feb 9, 2024):

+1

<!-- gh-comment-id:1935251374 --> @carsonkahn-external commented on GitHub (Feb 9, 2024): +1
Author
Owner

@Tanmaypatil123 commented on GitHub (Feb 11, 2024):

Does that mean we should implement something similar to OpenAI's Assistant API? Like code interpreter, retreival, etc., right?

<!-- gh-comment-id:1937825819 --> @Tanmaypatil123 commented on GitHub (Feb 11, 2024): Does that mean we should implement something similar to OpenAI's Assistant API? Like code interpreter, retreival, etc., right?
Author
Owner

@pamelafox commented on GitHub (Feb 13, 2024):

My request is only that the chat completion endpoint support the tools parameter (and related tool_choice):
https://platform.openai.com/docs/api-reference/chat#chat/create-functions

I do see that assistants also support tools, but that would be a much bigger feature.

<!-- gh-comment-id:1940415294 --> @pamelafox commented on GitHub (Feb 13, 2024): My request is only that the chat completion endpoint support the tools parameter (and related tool_choice): https://platform.openai.com/docs/api-reference/chat#chat/create-functions I do see that assistants also support tools, but that would be a much bigger feature.
Author
Owner

@maxbaines commented on GitHub (Feb 28, 2024):

My request is only that the chat completion endpoint support the tools parameter (and related tool_choice): https://platform.openai.com/docs/api-reference/chat#chat/create-functions

I do see that assistants also support tools, but that would be a much bigger feature.

+1 updated link https://platform.openai.com/docs/api-reference/chat/create#chat-create-tools

<!-- gh-comment-id:1969138735 --> @maxbaines commented on GitHub (Feb 28, 2024): > My request is only that the chat completion endpoint support the tools parameter (and related tool_choice): https://platform.openai.com/docs/api-reference/chat#chat/create-functions > > I do see that assistants also support tools, but that would be a much bigger feature. +1 updated link https://platform.openai.com/docs/api-reference/chat/create#chat-create-tools
Author
Owner

@rh-id commented on GitHub (Mar 7, 2024):

+1 Mistral model

https://docs.mistral.ai/guides/function-calling/

<!-- gh-comment-id:1982395351 --> @rh-id commented on GitHub (Mar 7, 2024): +1 Mistral model https://docs.mistral.ai/guides/function-calling/
Author
Owner

@grigio commented on GitHub (Mar 7, 2024):

https://docs.mistral.ai/guides/function-calling/

is the tools argument defined in the same way in Mistral and OpenAI ?

# mistral
response = client.chat(model=model, messages=messages, tools=tools, tool_choice="auto")
..
#openai
        response = client.chat.completions.create(
            model=model,
            messages=messages,
            tools=tools,
            tool_choice=tool_choice,
        )
<!-- gh-comment-id:1984544372 --> @grigio commented on GitHub (Mar 7, 2024): > https://docs.mistral.ai/guides/function-calling/ is the tools argument defined in the same way in Mistral and OpenAI ? ``` # mistral response = client.chat(model=model, messages=messages, tools=tools, tool_choice="auto") .. #openai response = client.chat.completions.create( model=model, messages=messages, tools=tools, tool_choice=tool_choice, ) ```
Author
Owner

@Benjoyo commented on GitHub (Mar 14, 2024):

new function calling model:

https://huggingface.co/NousResearch/Hermes-2-Pro-Mistral-7B

I suggest looking at the llama cpp python implementation for functionary (a chat handler).

<!-- gh-comment-id:1997471069 --> @Benjoyo commented on GitHub (Mar 14, 2024): new function calling model: https://huggingface.co/NousResearch/Hermes-2-Pro-Mistral-7B I suggest looking at the llama cpp python implementation for functionary (a chat handler).
Author
Owner

@humcqc commented on GitHub (May 29, 2024):

+1

<!-- gh-comment-id:2138057559 --> @humcqc commented on GitHub (May 29, 2024): +1
Author
Owner

@jboz commented on GitHub (Jun 13, 2024):

any updates ? A must to have feature IMO

<!-- gh-comment-id:2166415802 --> @jboz commented on GitHub (Jun 13, 2024): any updates ? A must to have feature IMO
Author
Owner

@jmorganca commented on GitHub (Jun 25, 2024):

Thanks for the issue! Merging with #4386!

<!-- gh-comment-id:2187952578 --> @jmorganca commented on GitHub (Jun 25, 2024): Thanks for the issue! Merging with #4386!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#1408