---
slug: "smolagents"
name: "smolagents"
effect: "Runs agents that write their actions as Python code, with core agent logic in about 1,000 lines"
category: "agent-framework"
url: "https://huggingface.co/docs/smolagents/index"
github: "huggingface/smolagents"
pricing: "open-source"
license: "Apache-2.0"
tags: ["python", "code-agents", "hugging-face", "model-agnostic", "mcp"]
platforms: []
install_kind: "pip"
date_added: "2026-10-14"
drop_score: 34
stars: 29849
pushed_at: "2026-10-06T18:35:07Z"
signals_status: "ok"
signals_fetched_at: "2026-10-15T01:19:04.498Z"
page: "https://agenttooldrop.com/tools/smolagents"
---

# smolagents

Runs agents that write their actions as Python code, with core agent logic in about 1,000 lines

Category: Agent frameworks. Pricing: Open source. License: Apache-2.0.

## Why you would want it

smolagents keeps abstractions minimal: the agent logic fits in roughly 1,000 lines, and its CodeAgent writes its actions in code. It is model-agnostic (local transformers or Ollama models, Hugging Face inference providers, or OpenAI, Anthropic and others via LiteLLM) and can use tools from MCP servers, LangChain or Hub Spaces. Agents and tools can be pushed to and pulled from the Hugging Face Hub, and a smolagent CLI runs agents from the terminal.

## Best for

- Agents that act by writing code
- Hugging Face Hub users
- Reading and learning a compact agent loop

## Use it when

You want a small, readable agent library and agents that act by writing code, with your choice of local or hosted models.

## Skip it if

You cannot run agent code in a sandbox: the README says the built-in LocalPythonExecutor is not a security boundary and recommends E2B, Blaxel, Modal or Docker.

## Install

Install with pip:

```sh
pip install "smolagents[toolkit]"
```

Source: https://github.com/huggingface/smolagents#readme

## Live signals

Fetched 2026-10-15T01:19:04.498Z (status: ok).

- Repository: huggingface/smolagents
- Stars: 29,849
- Forks: 3,079
- Open issues and PRs: 934
- License (GitHub): Apache-2.0
- Last push: 2026-10-06
- Latest release: v1.26.0 (2026-05-29)

## Links

- Website: https://huggingface.co/docs/smolagents/index
- GitHub: https://github.com/huggingface/smolagents
- Install instructions verified at: https://github.com/huggingface/smolagents#readme
- Source for this entry: https://github.com/huggingface/smolagents#readme
- AgentToolDrop page: https://agenttooldrop.com/tools/smolagents
- Full catalog (JSON): https://agenttooldrop.com/tools.json
