Immutable solution version
smolagents 1.5.0 broke Ollama support (regression, fixed in #406)
Complete solution
Shows how to fix smolagents 1.5.0 broke Ollama support (regression, fixed in #406). Use it when you hit this exact problem. Skip it when your error message or symptom looks different.
TL;DR
Upgrade to a release containing that fix and it should just work again. Source: https://github.com/huggingface/smolagents/issues/354 (Hugging Face smolagents) 1.5.0 shipped a regression that broke Ollama support, fixed in PR #406.
Steps
- If your Ollama-backed smolagents agent worked on 1.4.1 and broke after upgrading to 1.5.0, do not debug your model config. 1.5.0 shipped a regression that broke Ollama support, fixed in PR #406. Upgrade to a release containing that fix and it should just work again.
- Source: https://github.com/huggingface/smolagents/issues/354 (Hugging Face smolagents)
When to use
You are seeing this: If your Ollama-backed smolagents agent worked on 1.4.1 and broke after upgrading to 1.5.0, do not debug your model config. Use this skill when you run into "smolagents 1.5.0 broke Ollama support (regression, fixed in #406)".
When not to use
If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.
Versions
Versions mentioned in the source: 1.4.1, 1.5.0. If you are on something much newer or older, the details may have shifted.
Why this happens
The original report does not dig into a root cause. It documents the symptom and the fix that resolved it.
Sources
- https://github.com/huggingface/smolagents/issues/354
Evidence
In gh:huggingface/smolagents#354, the issue was: v1.4.1 is working with the following code, but v1.5.0 don't work anymore (ollama version is 0.5.7): from smolagents import CodeAgent; from smolagents import tool, LiteLLMModel, DuckDuckGoSearchTool, PythonInterpreterTool, VisitWebpageTool. model = LiteLLMModel(modelid="ollamachat/qwen2.5", apibase="YOURHOST", num_ctx=102400). agent = CodeAgent(tools=[], model=model. The verified answer: If your Ollama-backed smolagents agent worked on 1.4.1 and broke after upgrading to 1.5.0, do not debug your model config. 1.5.0 shipped a regression that broke Ollama support, fixed in PR #406. Upgrade to a release containing that fix and it should just work again.. Issue URL: https://github.com/huggingface/smolagents/issues/354
By @issueatlas · Version 2 · Exact version
Embed this skill
Add this card to a website or documentation page. It links to the current skill on Vectle.
<a href="https://vectle.com/skills/skl_fWiCoGh65GmSUtL9ZoUZ4Q" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">smolagents 1.5.0 broke Ollama support (regression, fixed in #406) <span>— Vectle</span></a>