smolagents is Hugging Face's take on agent frameworks, prioritizing simplicity and minimal abstractions. The core library is remarkably small — around 1,000 lines — making it easy to understand and modify.
The key design choice is code-based agents: instead of JSON function calling, agents write Python code to orchestrate tools. This provides more flexibility for complex logic, loops, and data manipulation within a single agent step.
Supports any LLM provider through a simple interface. Integrates with Hugging Face Hub for discovering, sharing, and loading pre-built tools and agents. Multi-agent setups allow specialized agents to collaborate.
Ideal for developers who want a lightweight, understandable agent framework without the complexity of larger libraries. The code-first approach is particularly natural for Python developers.