Install
pip install smolagentsThe 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
pip install smolagentsVersion
v1.26.0 · May 2026 · Python 3.10+
Best for
Learning, prototyping, simple automation, code-first workflows.
CodeAgent, ToolCallingAgent, InferenceClientModel, LiteLLMModel, tool, MultiStepAgent) verified against installed smolagents==1.26.0 (.routine-envs/check-0529-smolagents); no DeprecationWarning emissions.InferenceClientModel default model updated to Qwen/Qwen3-Next-80B-A3B-Thinking. All key symbols (CodeAgent, ToolCallingAgent, InferenceClientModel, LiteLLMModel, tool, MultiStepAgent) verified against installed smolagents==1.25.0 (.routine-envs/check-0519-py); no DeprecationWarning emissions.HfApiModel removed; raises ImportError. Use InferenceClientModel for all HuggingFace-hosted model access. Expanded model compatibility; token_counts tracking fix for managed agents; vision model support for web browsing agents.from smolagents import CodeAgent, tool
@tooldef 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 →
| Date | Version | Changes |
|---|---|---|
| 2026-05-29 | 1.26.0 | Version bumped 1.25.0 → 1.26.0; “What’s new” heading updated; v1.26.0 bullet added; comprehensive guide header updated; revision history entry added. CodeAgent, ToolCallingAgent, InferenceClientModel, LiteLLMModel, tool, MultiStepAgent verified against installed smolagents==1.26.0 (.routine-envs/check-0529-smolagents); no DeprecationWarning. |
| 2026-05-19 | 1.25.0 | Version bumped 1.24.0 → 1.25.0; “What’s new” updated; InferenceClientModel default model change noted. CodeAgent, ToolCallingAgent, InferenceClientModel, LiteLLMModel, tool, MultiStepAgent verified against installed smolagents==1.25.0 (.routine-envs/check-0519-py); no DeprecationWarning. |
| 2026-04-21 | 1.24.0 | Index redesigned with Zero → Hero + Jump-to-topic grid. |
| January 16, 2026 | 1.24.0 | Expanded model providers; tool call perf; multi-agent patterns. |
| November 2025 | 1.23.0 | Initial documented version. |