2024-12-31 · HuggingFace

Introducing smolagents: simple agents that write actions in code.

agents

read at source ↗ huggingface.co

Introducing smolagents: simple agents that write actions in code.

Source: HuggingFace Date: 2024-12-31 URL: https://huggingface.co/blog/smolagents

Summary

Library release: smolagents, HF’s lightweight successor to transformers.agents. Key design choice: agents write executable Python code as actions (CodeAgent) rather than JSON tool calls (ToolCallingAgent), with benchmarks showing code agents outperform JSON-based agents across models. Core agent logic is ~thousands of lines. Supports HF Hub models, OpenAI, Anthropic, and 100+ LLMs via LiteLLM. Tools are shareable to/from HF Hub.

Implications

Thread: transformers library trajectory / agentic patterns. smolagents is HF’s formal commitment to code-as-action as the primary agentic paradigm — a significant bet against JSON tool-calling. The composability argument (Python code can chain, loop, and reference previous outputs naturally; JSON can’t) is the core technical claim. The LiteLLM integration means smolagents is model-agnostic from day one, which differentiates it from more locked-in frameworks. The Hub integration for tools is the ecosystem play: over time, a HF Hub tool library could become as significant as the model library. Watch whether the CodeAgent paradigm gets adopted outside HF’s own tooling.

← all signals