#1313th of 15 in Agent frameworks and SDKs

smolagents

Python agent library where the model writes its actions as code

Stars
29.8k
License
Apache-2.0
Last commit
Oct 2026
Last release
May 2026
Language
Python
Stars, last 29 weeks+3,881
24 Mar 2026: 25,961 stars31 Mar 2026: 26,084 stars7 Apr 2026: 26,213 stars14 Apr 2026: 26,356 stars21 Apr 2026: 26,547 stars28 Apr 2026: 26,720 stars5 May 2026: 26,859 stars12 May 2026: 27,042 stars19 May 2026: 27,184 stars26 May 2026: 27,326 stars2 Jun 2026: 27,479 stars9 Jun 2026: 27,598 stars16 Jun 2026: 27,716 stars23 Jun 2026: 27,829 stars30 Jun 2026: 27,966 stars7 Jul 2026: 28,096 stars14 Jul 2026: 28,220 stars21 Jul 2026: 28,353 stars28 Jul 2026: 28,461 stars4 Aug 2026: 28,571 stars11 Aug 2026: 28,673 stars18 Aug 2026: 28,798 stars25 Aug 2026: 28,934 stars1 Sept 2026: 29,062 stars8 Sept 2026: 29,204 stars15 Sept 2026: 29,311 stars22 Sept 2026: 29,434 stars29 Sept 2026: 29,584 stars6 Oct 2026: 29,714 stars13 Oct 2026: 29,842 stars

25,961 on 24 Mar 202629,842 on 13 Oct 2026

From GitHub's daily star counts.

Checked on GitHub.

Overview

smolagents is a Python library from Hugging Face for building agents. Its main class, CodeAgent, has the LLM write each action as a Python snippet, so tool calls become function calls. The core logic in agents.py is under 1,000 lines. It also ships ToolCallingAgent (JSON tool calls), multi-agent hierarchies, and the smolagent and webagent CLIs.

Who it is for: Python developers building code-writing or tool-calling agents

Strengths

  • Core agent logic fits in under 1,000 lines, easy to read and modify
  • Works with local transformers, Ollama, HF providers, OpenAI, Anthropic, Azure, Bedrock, LiteLLM
  • Tools can come from MCP servers, LangChain or Hub Spaces
  • Sandboxed execution via E2B, Blaxel, Modal or Docker

Weaknesses

  • Built-in LocalPythonExecutor is not a security boundary and can be bypassed
  • Safe code execution needs an external sandbox or Docker setup
  • Library only: no web UI, server or deployment layer included
  • Efficiency claims (30% fewer steps) come from linked papers, not reproduced in the README

What it needs

  • GPU optional
  • Needs E2B, Blaxel, Modal or Docker (for sandboxing), LLM provider or local model
  • Models: transformers, Ollama, HF Inference Providers, OpenAI-compatible APIs, Azure OpenAI

Also in Agent frameworks and SDKs

See all 15
Also in Agent frameworks and SDKs
RankProjectScore
1langchainPython framework for building LLM agents and apps from interoperable components147.8k starsMIT88 out of 100
2browser-usePython library that lets an LLM agent control a web browser Live demo ↗ (opens in a new tab)117.9k starsMIT88 out of 100
3crewaiPython framework for multi-agent workflows with role-based Crews and event-driven Flows59.7k starsMIT80 out of 100
#4openai-agents-pythonPython SDK for multi-agent workflows with handoffs, guardrails and tracing30k starsMIT77 out of 100
#5agnoPython SDK and runtime for building and serving agents behind a REST API42.7k starsApache-2.076 out of 100