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
- Language
- Python
- License
- Apache-2.0
- Forked
- 2026-09-28
- Sync status
- In syncLast synced 2026-10-10
More in AI agents and LLM tools
An open-source curriculum for learning AI engineering by implementing model internals, retrieval pipelines, and agent runtimes. Study through lessons, interactive labs, or staged coding projects, and inspect the code and evaluation results.
Forked 2026-10-09Last synced 2026-10-10License: MITAI agents and LLM toolsGitHub
A small, hackable character-level language model that learns patterns from line-based text files and generates similar items, such as name ideas.
Forked 2026-10-09Last synced 2026-10-10License: MITAI agents and LLM toolsGitHub
uzu is an inference engine for running AI models in apps, helping developers keep inference on-device instead of relying on remote services. Use it to download a model and build chat features.
Forked 2026-10-09Last synced 2026-10-10License: MITAI agents and LLM toolsGitHub
Anti Slop gives AI coding agents rules to avoid generic UI, filler text, and AI-shaped code. Use it as a filter alongside your own design direction.
Forked 2026-10-08Last synced 2026-10-10License: MITAI agents and LLM toolsGitHub