qwen3-coder:latest responds with "The models does not support function calls" and other random messages #313

Closed
opened 2026-02-15 16:29:50 -05:00 by yindo · 1 comment
Owner

Originally created by @sumitkm on GitHub (Jan 20, 2026).

The Ollama models list shows qwen3-coder:latest as a model that supports tooling. But the following code fails:

from ollama import chat

...
...
class BaseToolCallingAdapter:
    def __init__(self, model_name: str, host: str) -> None:
        self.model_name = model_name
        # Chat history used by the ``Client``.  Each element is a dict with
        # ``role`` and ``content`` keys and, for tool calls, an optional
        # ``tool_name`` key.
        self.history: List[Dict[str, str]] = []
        self.host = host

        response: Message = chat(
                    model=self.model_name,
                    messages=self.history,
                    stream=False,
                    format="json",
                    think=False,
                ).message

Returns random values

prompt: hello world?
Assistant:
{
  "error": {
    "type": "invalid_request_error",
    "message": "The model does not support function calls."
  }
}
prompt: hello world?
Assistant:
{
  "error": {
    "type": "invalid_request_error",
    "message": "{\"message\":\"Operation not allowed\"}\n"
  }
}

Is the library tested against all the models that are listed?

It only seems to work correctly with gpt-oss and the llama models. I mean I wouldn't blame anyone if it wasn't tested, but the basic samples not working is a bit of a pain.

Will revert to raw requests and see if that's any better because OpenWebUI seems to work with all the models!

$ ollama --version
ollama version is 0.13.3
Originally created by @sumitkm on GitHub (Jan 20, 2026). The Ollama models list shows `qwen3-coder:latest` as a model that supports tooling. But the following code fails: ```python from ollama import chat ... ... class BaseToolCallingAdapter: def __init__(self, model_name: str, host: str) -> None: self.model_name = model_name # Chat history used by the ``Client``. Each element is a dict with # ``role`` and ``content`` keys and, for tool calls, an optional # ``tool_name`` key. self.history: List[Dict[str, str]] = [] self.host = host response: Message = chat( model=self.model_name, messages=self.history, stream=False, format="json", think=False, ).message ``` Returns random values ```bash prompt: hello world? Assistant: { "error": { "type": "invalid_request_error", "message": "The model does not support function calls." } } ``` ```bash prompt: hello world? Assistant: { "error": { "type": "invalid_request_error", "message": "{\"message\":\"Operation not allowed\"}\n" } } ``` Is the library tested against all the models that are listed? It only seems to work correctly with gpt-oss and the llama models. I mean I wouldn't blame anyone if it wasn't tested, but the basic samples not working is a bit of a pain. Will revert to raw `requests` and see if that's any better because OpenWebUI seems to work with all the models! ``` $ ollama --version ollama version is 0.13.3 ```
yindo closed this issue 2026-02-15 16:29:50 -05:00
Author
Owner

@sumitkm commented on GitHub (Jan 20, 2026):

Doesn't look like a library issue. Apologies. Raw http request fails too. So I guess my model is corrupted somehow. I'll close this for now.

@sumitkm commented on GitHub (Jan 20, 2026): Doesn't look like a library issue. Apologies. Raw http request fails too. So I guess my model is corrupted somehow. I'll close this for now.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: ollama/ollama-python#313