smolagents
Hugging Face’s barebones library for agents that think in code.
- Stars
- 30.6K
- Forks
- 3.3K
- Open issues
- 609
- Last commit
- 2026-11-26
Live from the GitHub API · updated 2026-11-30
What is smolagents?
smolagents keeps agent logic in about a thousand lines. Its CodeAgent writes actions as Python snippets instead of JSON tool calls, which tends to take fewer steps. It runs with any model — Hugging Face Inference, OpenAI, Anthropic or local Transformers/Ollama — and can execute code in sandboxes.
Key features
- Code-writing agents and classic tool-calling agents
- Model-agnostic via LiteLLM and HF Inference
- Sandboxed execution (E2B, Docker, Modal)
- Share tools and agents on the Hub
System requirements
- Platforms
- Windows · macOS · Linux
- Python
- 3.10+
How to install smolagents
Summarized from the project’s README. Projects change quickly — check the GitHub page for the latest instructions.
pip
- 1Install with the default toolkit.
pip install "smolagents[toolkit]"
Strengths
- Tiny, readable codebase
- Code actions are efficient
Limitations
- Executing generated code needs sandboxing
smolagents alternatives compared
| Software | Stars | License | Platforms | VRAM |
|---|---|---|---|---|
| smolagents Hugging Face’s barebones library for agents that think in code. | 30.6K | Apache-2.0 | — | |
| CrewAI Python framework for orchestrating role-playing, collaborative AI agents. | 61.4K | MIT | — | |
| LangGraph Low-level orchestration for stateful, long-running agents as graphs. | 45.6K | MIT | — | |
| Pydantic AI Type-safe Python agent framework from the Pydantic team. | 21.5K | MIT | — | |
| Agno Fast framework for multi-agent systems with memory, knowledge and tools. | 43.3K | Apache-2.0 | — | |
| Open WebUI Self-hosted ChatGPT-style interface for Ollama and OpenAI-compatible APIs. | 159.8K | Open WebUI License (BSD-3-Clause based) | — |
FAQ
Is smolagents free?
Yes — smolagents is open-source software released under the Apache-2.0 license. Check the license (and any model weight licenses) before commercial use.
Does smolagents run on Windows, Mac and Linux?
smolagents supports: Windows, macOS, Linux.
How do I install smolagents?
1. Install with the default toolkit.
What are the best smolagents alternatives?
Popular alternatives include CrewAI, LangGraph, Pydantic AI, Agno. See the comparison table on this page.