Barebones agent library by Hugging Face. Agents that think in code with sandboxed execution.
smolagents is a barebones library from Hugging Face for building agents that think in code. It provides first-class support for Code Agents — agents that write and execute Python code as their action step rather than using JSON tool calls. Model-agnostic with sandboxed execution support via E2B, Docker, or WebAssembly. Simple by design: the core is just ~1000 lines of code, making it easy to understand and extend.