Back to Repositories

huggingface/smolagents

smolagents is Hugging Face's answer to every bloated agent framework shipped in 2025 and 2026. It is deliberately small. A few hundred lines of readable Python. Native support for code execution agents (CodeAgent) and JSON tool-call agents (ToolCallingAgent). Sandboxed execution via E2B or a local Docker runner. That is the whole product.The counter-programming angle is what makes this repo interesting in April 2026. OpenAI shipped the Agents SDK. Microsoft shipped Agent Framework. LangChain shipped LangGraph. Every big-tech agent library is a 200-file monster with its own opinions about memory, state, and orchestration. smolagents is the opposite — 4,100+ stars and climbing because devs are tired of frameworks that hide the interesting parts.What You Actually GetCodeAgent — an agent that writes and executes Python code in a sandbox. This is the pattern DeepMind popularized with Project Mariner and the WebVoyager leaderboard top performers.ToolCallingAgent — classic function-calling loop for devs who want JSON tool-use.Model-agnostic — works with Claude, GPT-5, Gemini, local Llama, DeepSeek, Qwen, or any Hugging Face Inference Endpoint.Safe execution — E2B, Modal, or Docker sandboxing out of the box. You never run untrusted code on your host.Tool sharing via Hugging Face Hub — push your tools, pull others'. It is the npm for agent tools, already populated by the HF community.Who Should Use ItPick smolagents if you want to actually understand how an agent loop works. The code fits in your head. You can fork it in a weekend. It is also the right pick for research prototypes where you need to swap out the prompt template or the planning strategy without fighting a framework.Skip it if you need enterprise features — there is no built-in auth, no observability dashboard, no A2A protocol support. That is what Gemini Enterprise and LangGraph Cloud are for.Related ResourcesArticle: Google ships Project Mariner — the enterprise alternative to DIY agent frameworks.Tool: Rowboat — an AI work app you could rebuild with smolagents for personal use.Server: Basecamp MCP Server — plug it into a smolagents ToolCallingAgent for instant project automation.

agents
Python

Why It Matters

Every other agent library in 2026 is bloated. OpenAI Agents SDK pulls in 40 dependencies. Microsoft Agent Framework asks you to learn a new DSL. smolagents does the opposite — a few hundred lines of readable Python that do the one thing agents actually need: reason, call tools, execute code safely. It is the library senior devs reach for when they want to understand what is happening under the hood.

Repository Stats

Stars
26.8k
Forks
2.5k
Last Commit
4/17/2026

Category

Related Resources

Weekly AI Digest