mirror of
https://github.com/usestrix/strix.git
synced 2026-10-05 02:41:38 +00:00
fix: route ollama models through ollama_chat so tool calling works
The bare ollama/ prefix routes through LiteLLM's /api/generate endpoint, which has no function-calling support. With litellm.drop_params=True the agent's tools are dropped silently, so the model never sees them, replies with plain text, and the scan ends after one toolless turn. ollama_chat/ uses /api/chat, where tool-capable models can drive the agent loop. Fixes #526
This commit is contained in:
parent
cc23eeb65d
commit
863ec50968
1 changed files with 8 additions and 0 deletions
|
|
@ -39,6 +39,14 @@ class StrixProvider(MultiProvider):
|
|||
prefix=prefix,
|
||||
stripped_model_name=stripped_model_name,
|
||||
)
|
||||
if prefix == "ollama" and stripped_model_name:
|
||||
# Route Ollama through LiteLLM's chat endpoint. The bare ``ollama/``
|
||||
# provider hits ``/api/generate``, which has no function-calling
|
||||
# support, so with ``litellm.drop_params=True`` Strix's tools are
|
||||
# dropped silently and the agent stops after one toolless turn.
|
||||
# ``ollama_chat/`` uses ``/api/chat``, where tool-capable models can
|
||||
# actually drive the agent loop.
|
||||
return self._get_fallback_provider("litellm"), f"ollama_chat/{stripped_model_name}"
|
||||
return self._get_fallback_provider("litellm"), original_model_name
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue