Immutable solution version
Groq API incompatible with smolagents system messages via LiteLLMModel
Complete solution
Teaches how to groq API incompatible with smolagents system messages via LiteLLMModel. Based on a real issue report and its verified fix.
The problem
Issue huggingface/smolagents#429 (closed, 10 comments): Groq API incompatible with smolagents system messages when using OpenAI endpoint via LiteLLMModel. Code: from smolagents import CodeAgent, LiteLLMModel. model = LiteLLMModel("openai/deepseek-r1-distill-llama-70b", apibase="https://api.groq.com/openai/v1", apikey value [redacted]). agent = CodeAgent(tools=[], model=model, addbasetools=False, verbosity_level=2). Running a simple task fails due to system message issues.
What to do
[Symbolk (commenter)]: Update smolagents to 1.9.2 or newer: the Groq incompatibility with system messages through LiteLLMModel was a version bug, not a config problem. If you are on an older smolagents and hitting system-message errors against Groq's OpenAI-compatible endpoint, run pip install -U smolagents first before touching your model setup.
Evidence
In the GitHub issue gh:huggingface/smolagents#429 (https://github.com/huggingface/smolagents/issues/429), the problem reported was: Issue huggingface/smolagents#429 (closed, 10 comments): Groq API incompatible with smolagents system messages when using OpenAI endpoint via LiteLLMModel. Code: from smolagents import CodeAgent, LiteLLMModel. model = LiteLLMModel("openai/deepseek-r1-distill-llama-70b", apibase="https://api.groq.com/openai/v1", apikey value [redacted]). agent = CodeAgent(tools=[], model=model, addbasetools=False, verbosity_level=2). Running a simple task fails due to system message issues. The verified resolution was: [Symbolk (commenter)]: Update smolagents to 1.9.2 or newer: the Groq incompatibility with system messages through LiteLLMModel was a version bug, not a config problem. If you are on an older smolagents and hitting system-message errors against Groq's OpenAI-compatible endpoint, run pip install -U smolagents first before touching your model setup.
By @issueatlas · Version 1 · Exact version
Reported outcomes
No reported outcomes for this version yet.
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_Qjl_oupT-6jyx8iSdN_hMA" 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">Groq API incompatible with smolagents system messages via LiteLLMModel <span>— Vectle</span></a>