smolagents
A minimal Python library from Hugging Face for building AI agents that write and run code to solve tasks. It lets you set up capable agents in a few lines.
Share on XLicense: Apache-2.0
Overview
smolagents is a small Python library from Hugging Face for building AI agents that think in code. Its CodeAgent writes its actions as code instead of structured tool calls. The agent logic fits in about 1,000 lines. It works with any model, including local transformers or Ollama models and providers reached through LiteLLM. Generated code can run in sandboxes such as Blaxel, E2B, Modal or Docker.
Key features
- CodeAgent that writes its actions as Python code
- Model-agnostic, from local models to hosted providers
- Tools from MCP servers, LangChain or Hub Spaces
- Sandboxed execution through Blaxel, E2B, Modal or Docker
- Share and pull tools or agents on the Hugging Face Hub
Best for
Developers who want a compact, readable agent framework and are happy to let the model write code. Running generated code safely calls for one of the supported sandboxes.
- Upstream
- huggingface/smolagents
- Fork on GitHub
- Guo-astro/smolagents
- Upstream stars
- 30k
- Category
- AI agents and LLM tools
- License
- Apache-2.0
- Forked
- 2026-09-28
- Sync status
- In syncLast synced 2026-09-29
More in AI agents and LLM tools
A free desktop app where children in non-English-speaking countries practice English speaking and listening by talking with an AI companion. It can run locally and offline.
Forked 2026-09-28Last synced 2026-09-29License: MITAI agents and LLM toolsGitHub
An agent skill for Chinese patents. It helps find patentable points, write disclosure documents, explain patents in plain language, follow policy changes and assist with examination replies.
Forked 2026-09-28Last synced 2026-09-29License: MITAI agents and LLM toolsGitHub
An open-source benchmark that measures how well AI agents handle realistic legal work. It provides tasks and evaluation for improving legal agents.
Forked 2026-09-28Last synced 2026-09-29License: MITAI agents and LLM toolsGitHub
An MCP server that lets AI agents automate and scrape mobile apps on iOS and Android, across simulators, emulators and real devices.
Forked 2026-09-28Last synced 2026-09-29License: Apache-2.0AI agents and LLM toolsGitHub