Skip to content

SmolAgents

The smallest complete agent framework. A CodeAgent writes Python to accomplish tasks; a ToolCallingAgent uses JSON tool-calling. The entire core is ~1,000 lines — readable, hackable, and a great first step into agents.

Install

Terminal window
pip install smolagents

Version

v1.24.0 · January 2026 · Python 3.10+

Best for

Learning, prototyping, simple automation, code-first workflows.

  • Expanded model provider coverage (Anthropic, Gemini, Ollama improvements).
  • Tool call performance optimisations.
  • Multi-agent orchestration patterns stabilised.
from smolagents import CodeAgent, tool
@tool
def add_numbers(a: int, b: int) -> int:
"""Add two numbers together."""
return a + b
agent = CodeAgent(tools=[add_numbers])
result = agent.run("What is 15 + 27?")
print(result)

Ready? Start Zero → Hero Step 1 →


DateVersionChanges
2026-04-211.24.0Index redesigned with Zero → Hero + Jump-to-topic grid.
January 16, 20261.24.0Expanded model providers; tool call perf; multi-agent patterns.
November 20251.23.0Initial documented version.