[GH-ISSUE #12159] gpt-oss models don't support parallel tool calling #85773

Closed
opened 2026-05-10 01:35:11 -05:00 by GiteaMirror · 1 comment
Owner

Originally created by @pamelafox on GitHub (Sep 2, 2025).
Original GitHub issue: https://github.com/ollama/ollama/issues/12159

Originally assigned to: @ParthSareen on GitHub.

What is the issue?

I tried a basic parallel tool calling example, where hosted OpenAI models like gpt-5 will happily issue multiple tool calls in the same response, but gpt-oss only ever calls a single tool. I imagine this is by design, but couldn't find documentation anywhere as to whether parallel tool calling is supported. Maybe it could be noted on https://github.com/ollama/ollama/blob/main/docs/openai.md (Maybe add under parameters "parallel_tool_calls - Not supported, always false")

Here's the example code:

import os

import openai
from dotenv import load_dotenv

# Setup the OpenAI client to use either Azure, OpenAI.com, or Ollama API
load_dotenv(override=True)
client = openai.OpenAI(base_url=os.environ["OLLAMA_ENDPOINT"], api_key="nokeyneeded")
MODEL_NAME = "gpt-oss:20b"

tools = [
    {
        "type": "function",
        "function": {
            "name": "lookup_weather",
            "description": "Lookup the weather for a given city name or zip code.",
            "parameters": {
                "type": "object",
                "properties": {
                    "city_name": {
                        "type": "string",
                        "description": "The city name",
                    },
                    "zip_code": {
                        "type": "string",
                        "description": "The zip code",
                    },
                },
                "additionalProperties": False,
            },
        },
    },
    {
        "type": "function",
        "function": {
            "name": "lookup_movies",
            "description": "Lookup movies playing in a given city name or zip code.",
            "parameters": {
                "type": "object",
                "properties": {
                    "city_name": {
                        "type": "string",
                        "description": "The city name",
                    },
                    "zip_code": {
                        "type": "string",
                        "description": "The zip code",
                    },
                },
                "additionalProperties": False,
            },
        },
    },
]

response = client.chat.completions.create(
    model=MODEL_NAME,
    messages=[
        {"role": "system", "content": "You are a tourism chatbot."},
        {"role": "user", "content": "is it rainy enough in sydney to watch movies and which ones are on?"},
    ],
    tools=tools,
    tool_choice="auto",
    reasoning_effort="medium"
)

print("Thinking...")
print (response.choices[0].message.reasoning)
print("Done thinking.")
print(f"Response from {MODEL_NAME} on {API_HOST}: \n")
for message in response.choices[0].message.tool_calls:
    # Potential bug: It did not output two tool calls- no support for parallel tool calling?
    print(message.function.name)
    print(message.function.arguments)

Relevant log output


OS

No response

GPU

No response

CPU

No response

Ollama version

No response

Originally created by @pamelafox on GitHub (Sep 2, 2025). Original GitHub issue: https://github.com/ollama/ollama/issues/12159 Originally assigned to: @ParthSareen on GitHub. ### What is the issue? I tried a basic parallel tool calling example, where hosted OpenAI models like gpt-5 will happily issue multiple tool calls in the same response, but gpt-oss only ever calls a single tool. I imagine this is by design, but couldn't find documentation anywhere as to whether parallel tool calling is supported. Maybe it could be noted on https://github.com/ollama/ollama/blob/main/docs/openai.md (Maybe add under parameters "parallel_tool_calls - Not supported, always false") Here's the example code: ``` import os import openai from dotenv import load_dotenv # Setup the OpenAI client to use either Azure, OpenAI.com, or Ollama API load_dotenv(override=True) client = openai.OpenAI(base_url=os.environ["OLLAMA_ENDPOINT"], api_key="nokeyneeded") MODEL_NAME = "gpt-oss:20b" tools = [ { "type": "function", "function": { "name": "lookup_weather", "description": "Lookup the weather for a given city name or zip code.", "parameters": { "type": "object", "properties": { "city_name": { "type": "string", "description": "The city name", }, "zip_code": { "type": "string", "description": "The zip code", }, }, "additionalProperties": False, }, }, }, { "type": "function", "function": { "name": "lookup_movies", "description": "Lookup movies playing in a given city name or zip code.", "parameters": { "type": "object", "properties": { "city_name": { "type": "string", "description": "The city name", }, "zip_code": { "type": "string", "description": "The zip code", }, }, "additionalProperties": False, }, }, }, ] response = client.chat.completions.create( model=MODEL_NAME, messages=[ {"role": "system", "content": "You are a tourism chatbot."}, {"role": "user", "content": "is it rainy enough in sydney to watch movies and which ones are on?"}, ], tools=tools, tool_choice="auto", reasoning_effort="medium" ) print("Thinking...") print (response.choices[0].message.reasoning) print("Done thinking.") print(f"Response from {MODEL_NAME} on {API_HOST}: \n") for message in response.choices[0].message.tool_calls: # Potential bug: It did not output two tool calls- no support for parallel tool calling? print(message.function.name) print(message.function.arguments) ``` ### Relevant log output ```shell ``` ### OS _No response_ ### GPU _No response_ ### CPU _No response_ ### Ollama version _No response_
GiteaMirror added the bug label 2026-05-10 01:35:11 -05:00
Author
Owner

@ParthSareen commented on GitHub (Sep 2, 2025):

Hi @pamelafox - gpt-oss does not support parallel tool calling. Don't think we have it in the docs but will add! You can use the following as reference: https://github.com/ollama/ollama-python/blob/main/examples/gpt-oss-tools-stream.py

<!-- gh-comment-id:3247053451 --> @ParthSareen commented on GitHub (Sep 2, 2025): Hi @pamelafox - gpt-oss does not support parallel tool calling. Don't think we have it in the docs but will add! You can use the following as reference: https://github.com/ollama/ollama-python/blob/main/examples/gpt-oss-tools-stream.py
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#85773