smolagents

Hugging Face’s lightweight agent library, with minimal, readable code for tool-using LLM agents that write and run Python, working with many model providers

Visit smolagents →
AI & Agents

smolagents is deliberately minimal — Hugging Face built it as a small, readable alternative to heavier agent frameworks, with agents that write and execute Python code directly to use tools rather than going through a more elaborate tool-calling abstraction layer.

Works with any model via Hugging Face’s Transformers ecosystem or an external API, and is worth reaching for specifically when you want to understand or modify the agent loop itself — the whole library is small enough to read in one sitting, unlike larger frameworks like LangChain. See What Is Smolagents? for the full picture.