OSS TanbouSign in with GitHub

Build code-writing AI agents with a compact Python library and pluggable models, tools, and execution backends

About these scores

OSS scale score is an unbounded metric that log-compresses and weights Stars, Watchers, Forks, and Contributors. Discovery score is the current OSS scale score minus the score at discovery. Update pace is commits in the last 30 days, growth momentum is the OSS scale score difference within the recent observation window, and OSS health is a 0–100 rating based on available recency, Community Health, and release data.

Stars
29,667
Primary language
Python
License
Apache-2.0
Repository last updated
Sep 30, 2026
On this page

Overview

smolagents is a Python library for building AI agents that solve tasks by invoking tools through large language models. It provides CodeAgent, which expresses actions as Python code, and ToolCallingAgent, which uses conventional JSON or text tool calls. Models, tools, and execution backends can be swapped to match the workflow.

Features and best fit

Based on official documentation; not hands-on tested · Content checked:

Key features

Express multi-tool actions as Python code inside a ReAct loop

CodeAgent generates Python snippets that call tools inside an iterative ReAct-style loop. Branches, loops, search, calculations, and data processing can be combined in one action, while ToolCallingAgent remains available for projects that prefer conventional structured tool calls.

Sources: [2]

Select models, MCP tools, Hub integrations, and execution backends independently

The library supports Hugging Face Inference Providers, local Transformers or Ollama models, services reached through LiteLLM, and OpenAI-compatible APIs. Tools can come from MCP servers, LangChain, or Hub Spaces, while code execution can be routed to E2B, Blaxel, Modal, or Docker isolation.

Sources: [2]

Best fit

Fits teams that want a small, inspectable agent loop they can extend

smolagents is a strong fit for developers who want to understand and modify the control loop while adding their own models and tools. Projects can start with a compact prototype and expand into multi-agent hierarchies, multimodal inputs, and Hub-based sharing without adopting a large orchestration layer first.

Sources: [2]

Before adoption

Treat generated code as untrusted and design isolation and service permissions explicitly

CodeAgent output can execute arbitrary operations. The built-in LocalPythonExecutor is not a security boundary, so untrusted code needs an isolated backend such as E2B, Blaxel, Modal, or Docker. Restrict data sent to external models and tools, API-key permissions, runtime, and cost. Python 3.10 or newer is required, and optional providers and features add dependencies and credentials.

Sources: [2][4]

Official sources

  1. [1]huggingface/smolagents repository metadata(2026-10-04)
  2. [2]smolagents v1.26.0 README(2026-10-04)
  3. [3]smolagents v1.26.0 release(2026-10-04)
  4. [4]smolagents v1.26.0 pyproject.toml(2026-10-04)
  5. [5]smolagents v1.26.0 Apache-2.0 license(2026-10-04)
Supplemental curator note

Agent frameworks should be compared not only by feature count but also by how easily their control loop can be inspected and changed. smolagents makes that evaluation approachable, while safe adoption still depends on treating generated code execution as a deliberate security boundary.

Try it in 3 steps

  1. 1

    Create an isolated virtual environment

    Use Python 3.10 or newer and keep evaluation dependencies inside the project.

    python -m venv .venv && source .venv/bin/activate
  2. 2

    Install the toolkit extra at the reviewed release

    The toolkit extra follows the README quick demo while the version pin keeps the trial reproducible.

    python -m pip install "smolagents[toolkit]==1.26.0"
  3. 3

    Verify that the command-line interface starts

    Check the CLI without supplying model credentials or executing generated code.

    smolagent --help
Check the official README

Growth

Growth trends · Last 30 days

29,667 Stars

Trend data is still being collected.

Development activity

Last 90 days · weekly

Commits (last 30 days)
4
Open PRs
523

Development activity is still being collected.

Built with

Categories and tags

GitHub data

GitHub dataView detailed GitHub data
Stars
29,667
Forks
3,042
Watchers
143
Open issues
349
Contributors
208
Owner type
Organization
Primary language
Python
License
Apache-2.0
Repository last updated
Sep 30, 2026
Write a related article

Share a guide or use case for this OSS in Markdown. Articles are published after administrator approval.

Report incorrect information

Tell us if any listing information is incorrect or outdated.

After reading this page, do you know what to do next?