Lightweight code-first library by Hugging Face letting agents write executable Python actions
Official Hugging Face lightweight agent library, completely open source with minimal codebase
Smolagents is a lightweight, code-first agent library developed by Hugging Face. Challenging the traditional verbose JSON-based tool-calling pattern, Smolagents prompts LLMs to write raw, executable Python snippets directly as their actions. This approach drastically minimizes token overhead, unlocks native language loops and conditions, and enables clean, maintainable multi-agent systems with minimal framework bloat.