Hugging Face smolagents: agents that write code instead of JSON
In one sentence Hugging Face releases smolagents, a ~1000-line minimal library for LLM agents. Pushes the 'code agents' paradigm: the agent writes Python snippets instead of JSON tool calls.
Hugging Face ships smolagents, a tiny library (about 1000 lines of Python) for building LLM agents. The strong idea isn't the size but the paradigm: instead of replying with JSON like {"tool": "search", "args": {...}}, the agent writes Python code that calls your functions directly.
In practice: the model emits a snippet like result = search("LLM agents 2025"); summary = summarize(result). The snippet runs in a sandbox (local or E2B), the result goes back to the model, which picks the next step.
Why it matters: a code agent can combine multiple tools in one turn, do loops, conditionals, parsing — things JSON tool calls need several rounds for. Result: fewer model calls, lower latency, more flexible behavior.
Companies
Hugging Face
Tools
smolagents, CodeAgent, ToolCallingAgent
Tags
Sources