smolagents
🤗 smolagents: a barebones library for agents. Agents write python code to call tools or orchestrate other agents.
Decision gist · record as of 2026-08-14
Yes, if you want to build code-writing agents with minimal boilerplate and flexibility across LLM providers. The low install friction, active maintenance, and zero known vulnerabilities make it safe to try. The young release history (first release 2024-12-27) means the API may evolve, but the design is intentionally minimal. Start with the quick demo to verify it fits your use case.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Python >= 3.10.
- Sandboxed execution backends (Blaxel, E2B, Modal, Docker) may require additional setup or API keys.
- Low install friction with a pure-Python wheel and six common runtime dependencies.
License · maintenance · safety
(unclear)
last release 2026-05-29 (77 days)
0 known vulnerabilities (OSV.dev, 2026-08-14) · 626,778 downloads/mo, #5,687 on PyPI
Alternatives
Verify before relying
pip install 'smolagents[toolkit]'
from smolagents import CodeAgent, WebSearchTool, InferenceClientModel
model = InferenceClientModel()
agent = CodeAgent(tools=[WebSearchTool()], model=model)
agent.run("How many seconds would it take for a leopard at full speed to run through Pont des Arts?")- Whether the sandboxed execution backends (Blaxel, E2B, Modal, Docker) are included or require separate installation.
- Performance characteristics and latency for typical multi-step agent workflows.
- Whether the library's ~1,000 lines of code claim remains accurate at version 1.26.0.
What it is and what it does
smolagents is a lightweight agent framework that lets you build autonomous agents in a few lines of code. Unlike traditional agents that generate tool-call descriptions, smolagents agents write actual Python code to invoke tools and coordinate multi-step workflows. The library is model-agnostic—it works with local transformers, Ollama, OpenAI, Anthropic, and many other providers via LiteLLM or Hugging Face's inference API. It also supports multiple modalities (text, vision, video, audio) and can pull tools from MCP servers, LangChain, or Hugging Face Spaces.
The core agent type, CodeAgent, follows a ReAct loop: it receives a task, generates Python code snippets that call tools as functions, executes that code, stores the results in memory, and repeats until it calls a final_answer function. For security, you can run agents in sandboxed environments. The library integrates with Hugging Face Hub for sharing agents and tools as Space repositories, making it easy to collaborate and reuse agent configurations.
Use it for
- Build a multi-step research agent that searches the web, extracts information, and synthesizes answers without manual orchestration.
- Create a vision-enabled agent that browses websites, clicks elements, and extracts product details or prices from e-commerce sites.
- Share reusable agents and tool collections on Hugging Face Hub for team collaboration and instant deployment.
- Run agents locally with transformers or connect to any LLM provider (OpenAI, Anthropic, Together AI) by changing one configuration.
- Orchestrate complex workflows where agents coordinate with other agents or call specialized tools from MCP servers.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if you want to build code-writing agents with minimal boilerplate and flexibility across LLM providers.
The low install friction, active maintenance, and zero known vulnerabilities make it safe to try. The young release history (first release 2024-12-27) means the API may evolve, but the design is intentionally minimal. Start with the quick demo to verify it fits your use case.
Install
smolagents on PyPI
Before you install
Low install friction with a pure-Python wheel and six common runtime dependencies. Active maintenance with a recent release (77 days ago), though the project is young (first release 2024-12-27).
Requires Python >= 3.10. Sandboxed execution backends (Blaxel, E2B, Modal, Docker) may require additional setup or API keys.
Quickstart
pip install 'smolagents[toolkit]'
from smolagents import CodeAgent, WebSearchTool, InferenceClientModel
model = InferenceClientModel()
agent = CodeAgent(tools=[WebSearchTool()], model=model)
agent.run("How many seconds would it take for a leopard at full speed to run through Pont des Arts?")
Verify before relying
- Whether the sandboxed execution backends (Blaxel, E2B, Modal, Docker) are included or require separate installation.
- Performance characteristics and latency for typical multi-step agent workflows.
- Whether the library's ~1,000 lines of code claim remains accurate at version 1.26.0.
Package facts
| License | Not declared unclear |
| Python support | Supports the current Python release >=3.10 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 6 packageshuggingface-hubrequestsrichjinja2pillowpython-dotenv |
| Maintenance | Actively maintained 77 days since the last release |
| First released | |
| Downloads | 626,778 / month, #5,687 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
Evidence: smolagents-1.26.0-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “code-writing agents”
- smolagentssmolagents lets you build and run AI agents that write Python code to…
- microsoft-agents-hosting-fastapiProvides FastAPI integration for building and hosting conversational…
- azure-ai-agentsBuild and deploy AI agents on Azure using models from OpenAI,…
Give your agent the search over MCP, or paste the wish link into any chat.
More Artificial Intelligence packages
LiteLLM provides a unified Python interface to call 100+ LLM providers (OpenAI, Anthropic, Gemini, Bedrock, Azure, and others) using OpenAI-compatible API format, available as both a Python SDK and a self-hosted AI Gateway proxy server.
Install it if you need to work with multiple LLM providers or want to centralize LLM routing in your organization.
Client library and CLI tool for downloading, uploading, and managing models, datasets, and repositories on the Hugging Face Hub platform.
Install it if you work with Hugging Face Hub models or datasets.
LangChain provides a framework for building agents and LLM-powered applications by composing language models, tools, and memory through a unified API that abstracts over multiple model providers.
hf-xet provides chunk-based deduplication and efficient file transfer for the Hugging Face Hub, enabling faster uploads and downloads of large files with local disk caching.
Tokenizers converts raw text into token sequences for NLP models, with support for training custom vocabularies and using pre-built tokenizers (BPE, WordPiece) optimized for speed via Rust.
Transformers provides a unified framework for loading, fine-tuning, and running state-of-the-art pretrained models across text, vision, audio, video, and multimodal tasks using PyTorch, JAX, or TensorFlow.
Install it if you need to run or train any transformer-based model for NLP, vision, audio, or multimodal tasks.
See also openai-agents · mcpadapt · strands-agents · praisonaiagents · agentops · agent-framework-core · agentscope · qwen-agent · baml-py · stirrup