Compact core framework
Smolagents is described as a minimalist framework with about 1,000 lines of core code in `agents.py`, which keeps the abstraction layer small and the codebase easy to inspect.
Smolagents is a minimalist AI agent framework from Hugging Face for code-based and tool-calling agents with Python execution and sandboxed runs.
Smolagents is a minimalist AI agent framework from the Hugging Face team. Its stated purpose is to help developers build agents that can interact with the real world using only a few lines of code, while keeping the framework small and approachable.
The site centers the product on code agents: instead of producing only JSON or text actions, the agent writes and executes Python code snippets to complete tasks. Smolagents also supports traditional tool-calling agents, sandboxed execution options, and integration with models and tools from the Hugging Face ecosystem and beyond.
Smolagents is described as a minimalist framework with about 1,000 lines of core code in `agents.py`, which keeps the abstraction layer small and the codebase easy to inspect.
The framework emphasizes agents that write and run Python code snippets to carry out actions, rather than relying only on JSON or text-based tool outputs.
The site says code agents can reduce steps and LLM calls by about 30% compared with standard tool-calling methods, and can perform better on complex benchmarks.
Smolagents supports sandboxed environments such as E2B for safer execution of generated code, giving developers an isolated place to run agent actions.
The framework integrates with Hugging Face Hub for sharing and loading tools, and it can work with Hugging Face models through Transformers as well as OpenAI, Anthropic, and others through LiteLLM.
In addition to code agents, the site says smolagents also supports traditional tool-calling agents that use JSON or text blocks when that format is a better fit.
Build agents that can take actions through Python code, especially when the task benefits from reusable functions, object handling, or more complex control flow than simple tool calls.
Add custom tools such as travel planning, web search, or image generation to an agent and share those tools through the Hugging Face Hub.
Run generated agent code in a sandboxed environment when you want a safer boundary around execution during development or deployment.
Use supported model providers from Hugging Face, OpenAI, Anthropic, or other LiteLLM-compatible sources when you want flexibility in model choice.
Choose traditional tool-calling agents instead of code agents when JSON or text-block actions fit a specific workflow better.
Smolagents is presented as a minimalist AI agent framework from the Hugging Face team. It is designed to let developers define an agent, add tools, and run it with relatively little code.
The site says smolagents supports code agents, where the agent writes and executes Python code snippets, and also supports traditional tool-calling agents that use JSON or text blocks.
The pricing page shows a free Starter plan and a paid Pro plan. Starter includes 5 devices, 1 month of cloud retention, unlimited notifications, and basic integrations; Pro is listed at $12 per month with unlimited devices, 1 year of cloud retention, unlimited notifications, advanced integrations, and priority customer support.
The site describes sandboxed execution options such as E2B for safer code execution. It also shows examples built around custom tools and Hugging Face Hub sharing.