smolagents review
smolagents is a minimal Python library from Hugging Face for building agents that write their actions as Python code to call tools.
TL;DR
smolagents is an open-source Python library for building and running agents in a few lines of code. It is for developers who want minimal abstractions and any LLM. Its CodeAgent writes actions as Python code instead of JSON tool calls, with sandboxed execution via E2B, Blaxel, Modal or Docker.
- 30.2kGitHub stars
- +133new stars, week of Oct 25
- 152.7kdownloads a week, +29% vs 4-week avg
- #15in Agent frameworks this week
smolagents at a glance
- Category
- Agent frameworks
- Maintained by
- Hugging Face (organization, @huggingface on GitHub)
- License
- Apache 2.0
- Language
- Python, Makefile
- Repository
- github.com/huggingface/smolagents
- Website
- huggingface.co/docs/smolagents
- PyPI package
- smolagents 1.26.0
- Latest release
- v1.26.0 on GitHub, May 29, 2026
- First published
- Dec 5, 2024
What smolagents does
- smolagents provides a CodeAgent that writes its actions as Python code snippets, so tool calls become Python function calls.
- smolagents also offers a ToolCallingAgent that writes actions as JSON/text blobs, for cases where that style fits better.
- smolagents works with any LLM: local transformers or Ollama models, Hub inference providers, or OpenAI, Anthropic and others via LiteLLM.
- smolagents can use tools from MCP servers, from LangChain, or a Hugging Face Hub Space as a tool.
- smolagents lets you share and pull tools or agents to and from the Hugging Face Hub.
- smolagents agents accept text, vision, video and audio inputs.
- smolagents includes CLI commands: smolagent for a general multi-step CodeAgent and webagent for a helium-based web-browsing agent.
How it works
smolagents runs as a Python library or from the CLI. A CodeAgent follows a ReAct loop. The model generates a Python code action from memory, the code runs, and execution logs return to memory until the agent calls final_answer. Models connect through InferenceClientModel, LiteLLMModel, OpenAIModel, TransformersModel, AzureOpenAIModel or AmazonBedrockModel. Code can run in E2B, Blaxel, Modal or Docker sandboxes.
How to install and start using smolagents
With pip (default toolkit)
pip install "smolagents[toolkit]"Requirements
- Python 3.10 or later
- Access to an LLM, either a local model or a provider API key such as ANTHROPIC_API_KEY or OPENROUTER_API_KEY
- A sandbox such as E2B, Blaxel, Modal or Docker is recommended for running agent code
First steps
- Install smolagents with the default toolkit using pip.
- Create a model, for example InferenceClientModel, and a CodeAgent with tools such as WebSearchTool.
- Call agent.run with your task to execute the agent.
- Run smolagent without a prompt to launch the interactive setup wizard for agent type, tools and model.
Who smolagents is for
- Python developers who want an agent framework with minimal abstractions they can read and modify.
- Teams wanting to switch between open and closed LLMs without changing agent code.
- Developers building agents whose actions use loops, conditionals and function nesting in code.
- Users of the Hugging Face Hub who want to share agents and tools as Spaces.
Limitations to know
- smolagents' built-in LocalPythonExecutor is not a security sandbox and must not be used to run untrusted code.
- smolagents CodeAgent executes arbitrary code, so safe use needs a sandbox like E2B, Blaxel, Modal or Docker.
- smolagents is a Python library and requires Python 3.10 or later.
Is smolagents growing? Usage data
In the week of Oct 25–31, 2026, smolagents ranked #143 on the Devtoolwatch Board and #15 in Agent frameworks, with a momentum score of 55 out of 100. Its main package had 152.7k downloads that week, +29% against its own 4-week average.
Show the weekly numbers
| Week of | New stars |
|---|---|
| Aug 9, 2026 | 103 |
| Aug 16, 2026 | 123 |
| Aug 23, 2026 | 129 |
| Aug 30, 2026 | 145 |
| Sep 6, 2026 | 126 |
| Sep 13, 2026 | 123 |
| Sep 20, 2026 | 112 |
| Sep 27, 2026 | 165 |
| Oct 4, 2026 | 120 |
| Oct 11, 2026 | 137 |
| Oct 18, 2026 | 139 |
| Oct 25, 2026 | 133 |
On Hacker News
- Qwen 3.8 27B, 1438 points and 793 comments (Aug 14, 2026)
- Kimi-K3 on HuggingFace, 1382 points and 544 comments (Jul 27, 2026)
- DeepSeek-v3.2: Pushing the frontier of open large language models [pdf], 982 points and 465 comments (Dec 1, 2025)
- DeepSeek-v4.1-Flash-1017, 959 points and 721 comments (Oct 17, 2026)
- GLM-5.3 is now open-weight, 806 points and 280 comments (Aug 28, 2026)
The Board ranks tools by four signals each week: new stars, new stars for the repo's size, added downloads and download growth beyond the market. How the ranking works.
smolagents alternatives
Other AI agent frameworks on the Board in the week of Oct 25–31, 2026, by momentum:
| Rank | Tool | Stars | Downloads/wk |
|---|---|---|---|
| #1 | Harness²Harness² is a Python framework from Google Research for recursive agent harnessing, refining an agent's prompts, tools, memory and… | 21.7k | – |
| #2 | HyperFramesHyperFrames is an open-source framework that turns HTML, CSS, media, and seekable animations into deterministic MP4 videos, built for AI… | 76.6k | 1.5M |
| #3 | AgentScopeAgentScope is a Python agent framework with an SDK for building ReAct agents and an agent service backend with a web UI. | 35k | 51.4k |
| #4 | AG-UIAG-UI is an open, event-based protocol that standardizes how AI agents connect to user-facing frontend applications. | 16.9k | 4.6M |
| #5 | LangGraphLangGraph is a low-level orchestration framework and runtime for building, managing, and deploying long-running, stateful agents in… | 44.2k | 18.5M |
| #6 | BifrostOpen-source, high-performance AI gateway that works as your LLM gateway, MCP gateway and agent gateway. One OpenAI-compatible API for… | 9.3k | – |
Recent smolagents releases
smolagents FAQ
Is smolagents free and open source?
Yes. smolagents's source code is on GitHub (huggingface/smolagents) under the Apache 2.0 license, so you can use it for free. Its website also links to a pricing page (https://huggingface.co/pricing) for any paid plans.
How do I install smolagents?
Run pip install "smolagents[toolkit]". The smolagents package needs Python 3.10 or newer. The install section above has the other options from the project's README.
Is smolagents still maintained?
Yes. The huggingface/smolagents repository was last updated on Oct 6, 2026, and the latest release, v1.26.0 on GitHub, came out on May 29, 2026.
How popular is smolagents?
smolagents has 30.2k GitHub stars as of Nov 1, 2026. It gained 133 new stars in the week of Oct 25–31, 2026, against a 12-week average of 130 a week. Its main package had 152.7k downloads that week, +29% against its own 4-week average. That made it #15 among AI agent frameworks on the Devtoolwatch Board.
smolagents vs LangGraph: how do they compare?
smolagents and LangGraph are both tracked by Devtoolwatch as AI agent frameworks. smolagents has 30.2k GitHub stars and LangGraph has 44.2k. In the week of Oct 25–31, 2026, smolagents's main package had 152.7k downloads and LangGraph's had 18.5M. LangGraph is a low-level orchestration framework and runtime for building, managing, and deploying long-running, stateful agents in Python or JavaScript. LangGraph review.
smolagents vs LangChain: how do they compare?
smolagents and LangChain are both tracked by Devtoolwatch as AI agent frameworks. smolagents has 30.2k GitHub stars and LangChain has 148.8k. In the week of Oct 25–31, 2026, smolagents's main package had 152.7k downloads and LangChain's had 41.1M. LangChain review.
What are the best alternatives to smolagents?
Other AI agent frameworks on the Devtoolwatch Board in the week of Oct 25–31, 2026, by momentum: Harness² (#1), HyperFrames (#2), AgentScope (#3), AG-UI (#4), LangGraph (#5). The alternatives table above has their numbers.
How does smolagents work?
smolagents runs a ReAct-style loop. The model generates a Python code action from the agent's memory, the code executes, and logs go back into memory. The loop ends when the agent calls the final_answer tool, whose argument is returned.
Is smolagents open source?
Yes. The smolagents documentation describes it as an open-source Python library, and the repository is published by Hugging Face on GitHub.
Is smolagents safe to run in production?
smolagents executes model-written code, so the README says you should run agent code in a sandbox. Supported options are E2B, Blaxel, Modal and Docker. The built-in LocalPythonExecutor is not a security boundary.
Which LLMs does smolagents support?
smolagents supports any LLM. Options include local transformers or Ollama models, Hub inference providers, OpenAI-compatible servers, Azure OpenAI, Amazon Bedrock, and OpenAI, Anthropic and others through LiteLLM.
Why do smolagents agents write actions in code?
smolagents' README states that code actions use 30% fewer steps than JSON tool-call dictionaries and reach higher performance on difficult benchmarks. Code also allows loops and function nesting in one action.
Sources
- huggingface/smolagents on GitHub
- smolagents README
- smolagents on PyPI
- smolagents website
- Release v1.26.0 (May 29, 2026)
- Release v1.25.0 (May 14, 2026)
- Release v1.24.0 (Jan 16, 2026)
- Hacker News: Qwen 3.8 27B
- Hacker News: Kimi-K3 on HuggingFace
- Hacker News: DeepSeek-v3.2: Pushing the frontier of open large language models [pdf]
- Devtoolwatch Board, the week of Oct 25–31, 2026
smolagents README badge
Maintainers can show the tool's weekly Board rank in their README:
[](https://index.devtoolwatch.com/tools/smolagents/)How this page is made: Devtoolwatch writes each review from the project's README, releases, package metadata and website, with an AI model, then checks every claim against the source it cites and drops what the sources don't support. The numbers come from Devtoolwatch's daily GitHub snapshots, GitHub's stargazer history, and the npm and PyPI download APIs. Spotted an error? Email [email protected].