Directory / smolagents
smolagents
Verified
Hugging Face’s small, first-class code-agent library.
smolagents is Hugging Face’s open library for agents that write and run Python as their tool interface. It is deliberately small. You host it. Models can be HF, local, or commercial APIs.
- Model independence
- Multi-model
- Deployment
- Self-hosted
- Open source
- Yes
- License
- Apache-2.0
- Pricing model
- Free
- Added / updated
- 19 Aug 2026 / 19 Aug 2026
huggingface.co/docs/smolagents · Docs · Source
Editorial take
Code-as-action is a different execution bet than JSON tool calls. smolagents is the readable library for that bet. Running model-written Python is a sandbox problem. Do not `exec` your way to a factory on the API box.
Strengths
- Tiny Apache-2.0 library, code-first agents.
- HF ecosystem and local models.
- Good for research and internal tools.
Limitations
- You must sandbox the interpreter. The library will not save you.
- Not a team product.
- Easy to demo, easy to pwn yourself.