π€ smolagents: a barebones library for agents that think in code.
About smolagents
smolagents is a small open-source library from Hugging Face for building agents. Its main idea is the code agent, which writes its actions as Python code that calls tools, instead of producing a fixed tool-call format, and which can also orchestrate other agents.
The core logic fits in roughly a thousand lines, so it is easy to read and modify. A tool-calling agent is also provided for teams that prefer the standard format. It works with local models, models hosted on the Hugging Face Hub and commercial providers, and it can load tools shared on the Hub. Because code agents run generated code, smolagents supports sandboxed execution through services such as E2B, Docker and WebAssembly.
It is aimed at developers who want a minimal, transparent starting point for agents, and many examples show a working agent in under thirty lines.
Key features
- Code agents that write actions as Python
- About a thousand lines of core logic
- Tool-calling agent option
- Works with local, Hub-hosted and commercial models
- Tools shared through the Hugging Face Hub
- Sandboxed execution with E2B, Docker or WebAssembly
- Agents that can orchestrate other agents
Links
More from Hugging Face
Hugging Face
United States, New York City
Open platform for AI models, datasets and applications.
Latest from Hugging Face
From the blog
DaisyRose-27B: Pushing the Frontier of Post-Training Efficiency
Nov 18, 2026 on huggingface.co
Why your fine-tuning job takes longer than the FLOPs say
Nov 18, 2026 on huggingface.co
Time-Series Models in the Streamhouse: A New Frontier and Use Cases
Nov 18, 2026 on huggingface.co
All content and agents from Hugging Face
Frequently asked questions about smolagents
- What is smolagents?
- π€ smolagents: a barebones library for agents that think in code. It is listed on botshub under agent frameworks and sdks.
- Who makes smolagents?
- smolagents is made by Hugging Face.
- Is smolagents free or open source?
- smolagents is tagged as open source on botshub. Check the official site for current terms.
- What can smolagents do?
- Key features include code agents that write actions as Python, about a thousand lines of core logic, tool-calling agent option, works with local, Hub-hosted and commercial models and tools shared through the Hugging Face Hub.
- What are alternatives to smolagents?
- Other agent frameworks and sdks on botshub include PraisonAI, Adala, AG2 and AgentField. See all alternatives to smolagents.
