On this page
Overview
smolagents is a Python library for building AI agents that solve tasks by invoking tools through large language models. It provides CodeAgent, which expresses actions as Python code, and ToolCallingAgent, which uses conventional JSON or text tool calls. Models, tools, and execution backends can be swapped to match the workflow.
Features and best fit
Based on official documentation; not hands-on tested · Content checked:
Key features
Express multi-tool actions as Python code inside a ReAct loop
CodeAgent generates Python snippets that call tools inside an iterative ReAct-style loop. Branches, loops, search, calculations, and data processing can be combined in one action, while ToolCallingAgent remains available for projects that prefer conventional structured tool calls.
Sources: [2]
Select models, MCP tools, Hub integrations, and execution backends independently
The library supports Hugging Face Inference Providers, local Transformers or Ollama models, services reached through LiteLLM, and OpenAI-compatible APIs. Tools can come from MCP servers, LangChain, or Hub Spaces, while code execution can be routed to E2B, Blaxel, Modal, or Docker isolation.
Sources: [2]
Best fit
Fits teams that want a small, inspectable agent loop they can extend
smolagents is a strong fit for developers who want to understand and modify the control loop while adding their own models and tools. Projects can start with a compact prototype and expand into multi-agent hierarchies, multimodal inputs, and Hub-based sharing without adopting a large orchestration layer first.
Sources: [2]
Before adoption
Treat generated code as untrusted and design isolation and service permissions explicitly
CodeAgent output can execute arbitrary operations. The built-in LocalPythonExecutor is not a security boundary, so untrusted code needs an isolated backend such as E2B, Blaxel, Modal, or Docker. Restrict data sent to external models and tools, API-key permissions, runtime, and cost. Python 3.10 or newer is required, and optional providers and features add dependencies and credentials.
Official sources
- [1]huggingface/smolagents repository metadata(2026-10-04)
- [2]smolagents v1.26.0 README(2026-10-04)
- [3]smolagents v1.26.0 release(2026-10-04)
- [4]smolagents v1.26.0 pyproject.toml(2026-10-04)
- [5]smolagents v1.26.0 Apache-2.0 license(2026-10-04)
Supplemental curator note
Agent frameworks should be compared not only by feature count but also by how easily their control loop can be inspected and changed. smolagents makes that evaluation approachable, while safe adoption still depends on treating generated code execution as a deliberate security boundary.
Try it in 3 steps
- 1
Create an isolated virtual environment
Use Python 3.10 or newer and keep evaluation dependencies inside the project.
python -m venv .venv && source .venv/bin/activate - 2
Install the toolkit extra at the reviewed release
The toolkit extra follows the README quick demo while the version pin keeps the trial reproducible.
python -m pip install "smolagents[toolkit]==1.26.0" - 3
Verify that the command-line interface starts
Check the CLI without supplying model credentials or executing generated code.
smolagent --help
Growth
Growth trends · Last 30 days
29,667 Stars
Trend data is still being collected.
Development activity
Last 90 days · weekly
- Commits (last 30 days)
- 4
- Open PRs
- 523
Development activity is still being collected.
Built with
Categories and tags
GitHub data
GitHub dataView detailed GitHub data
- Stars
- 29,667
- Forks
- 3,042
- Watchers
- 143
- Open issues
- 349
- Contributors
- 208
- Owner type
- Organization
- Primary language
- Python
- License
- Apache-2.0
- Repository last updated
- Sep 30, 2026
Related information
Write a related articleShare a guide or use case for this OSS in Markdown. Articles are published after administrator approval.
Explore next
- LangChain147,418 Stars
3 shared tag(s) · 2 shared category(s) · Same language
compose models, tools, retrieval, and middleware into agents
Python - Aider49,359 Stars
3 shared tag(s) · 2 shared category(s) · Same language
edit code from the terminal with repository-wide context
Python - Agno42,541 Stars
3 shared tag(s) · 2 shared category(s) · Same language
treat agent development and the production runtime as one platform stack
Python - Haystack26,647 Stars
3 shared tag(s) · 2 shared category(s) · Same language
compose retrieval, routing, memory, and generation as component graphs for RAG and agent workflows
Python - TestZeus Hercules1,174 Stars
3 shared tag(s) · 2 shared category(s) · Same language
turn Gherkin scenarios into LLM-agent browser actions for end-to-end testing
Python - Dify157,795 Stars
3 shared tag(s) · 2 shared category(s)
design and publish AI workflows, retrieval, and agents on one platform
TypeScript
Report incorrect information
Tell us if any listing information is incorrect or outdated.