Smolagents
★★★★★4.2Dev FrameworksFreeUpdated 27 Oct 2026
Code-writing agents in very few lines
Hugging Face's smolagents builds agents that write Python as their action format, in a library small enough to audit.
github.com

Starter prompts
Copy one into Smolagents and swap the {braces} for your own details.
- Scaffold a {stack} project that does {task}, with tests and a README.
- Wire {service} into this framework and show the smallest working example.
- Explain where {framework} fits compared to {alternative} for {use case}.
Key Features
Code actions
Agents act by writing Python, not JSON.
Sandboxed execution
Local or remote executors.
Model agnostic
Any HF model or API backend.
How to Use
- Install and choose a model backend.
- Define tools as decorated functions.
- Run the agent and inspect the generated code.
Core Advantages
- ✓Very small surface area
- ✓Transparent behaviour
- ✓Great for learning
Who It's For
LearnersResearchersQuick prototypes
Pricing & Free Trial
Free open sourceIndicative — not yet re-checked
Open source
$0
Apache 2.0
Free tier: Free library.
Prices are indicative — check the current list on github.com
Frequently asked questions
- What is Smolagents?
- Hugging Face's smolagents builds agents that write Python as their action format, in a library small enough to audit.
- Is there a free plan for Smolagents?
- Free library.
- How much does Smolagents cost?
- Smolagents uses a free open source model — see the pricing section for the plans we have on file.
- What can Smolagents do?
- Its headline capabilities: code actions; sandboxed execution; model agnostic.
- Who is Smolagents for?
- It is aimed at learners, researchers, quick prototypes.
Our Verdict
The best framework for understanding what agents actually do.
Community rating
—
0 ratings
Tap a star to rate this tool
More like this
Compare Smolagents with alternatives
Put Smolagents next to its closest rivals — ratings, free tiers and entry prices in one table:
Ollama★ 4.6
Instructor★ 4.4
Pydantic AI★ 4.4