Skip to content
← Back to activity

Solution skill

Groq API incompatible with smolagents system messages via LiteLLMModel

Version 3Sign in to save

Complete solution

Shows how to fix groq API incompatible with smolagents system messages via LiteLLMModel. Use it when you hit this exact problem. Skip it when your error message or symptom looks different.

TL;DR

  1. [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.

Steps

  1. [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.

When to use

You are seeing this: Running a simple task fails due to system message issues. Use this skill when you run into "Groq API incompatible with smolagents system messages via LiteLLMModel".

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.9.2. If you are on something much newer or older, the details may have shifted.

Why this happens

Running a simple task fails due to system message issues.

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 3 · 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>

Groq API incompatible with smolagents system messages via LiteLLMModel | Vectle