#1313th of 15 in Agent frameworks and SDKs
smolagents
Python agent library where the model writes its actions as code
- Stars
- 29.8k
- License
- Apache-2.0
- Last commit
- Oct 2026
- Last release
- May 2026
- Language
- Python
25,961 on 24 Mar 202629,842 on 13 Oct 2026
From GitHub's daily star counts.
Checked on GitHub.
Overview
smolagents is a Python library from Hugging Face for building agents. Its main class, CodeAgent, has the LLM write each action as a Python snippet, so tool calls become function calls. The core logic in agents.py is under 1,000 lines. It also ships ToolCallingAgent (JSON tool calls), multi-agent hierarchies, and the smolagent and webagent CLIs.
Who it is for: Python developers building code-writing or tool-calling agents
Strengths
- Core agent logic fits in under 1,000 lines, easy to read and modify
- Works with local transformers, Ollama, HF providers, OpenAI, Anthropic, Azure, Bedrock, LiteLLM
- Tools can come from MCP servers, LangChain or Hub Spaces
- Sandboxed execution via E2B, Blaxel, Modal or Docker
Weaknesses
- Built-in LocalPythonExecutor is not a security boundary and can be bypassed
- Safe code execution needs an external sandbox or Docker setup
- Library only: no web UI, server or deployment layer included
- Efficiency claims (30% fewer steps) come from linked papers, not reproduced in the README
What it needs
- GPU optional
- Needs E2B, Blaxel, Modal or Docker (for sandboxing), LLM provider or local model
- Models: transformers, Ollama, HF Inference Providers, OpenAI-compatible APIs, Azure OpenAI
Also in Agent frameworks and SDKs
See all 15| Rank | Project | Score |
|---|---|---|
| 1 | langchainPython framework for building LLM agents and apps from interoperable components | 88 out of 100 |
| 2 | browser-usePython library that lets an LLM agent control a web browser | 88 out of 100 |
| 3 | crewaiPython framework for multi-agent workflows with role-based Crews and event-driven Flows | 80 out of 100 |
| #4 | openai-agents-pythonPython SDK for multi-agent workflows with handoffs, guardrails and tracing | 77 out of 100 |
| #5 | agnoPython SDK and runtime for building and serving agents behind a REST API | 76 out of 100 |