Skip to content

Smolagents.org

A minimal agent framework built around code agents

Visit official site

What Smolagents.org is

The framework is described as a minimal AI agent library from the Hugging Face team, focused on code agents that run Python snippets to carry out tasks.

What you can do with it

  • Define an agent with a short amount of code
  • Provide tools and run the agent immediately
  • Execute Python snippets as agent actions

Getting started

  • Install the package with pip
  • Import CodeAgent and the needed tool classes
  • Create a CodeAgent with tools and a model
  • Write tool functions as Python code

Pros & cons

✓ What we like

  • Sandbox execution such as E2B is supported
  • Models from the Hub, OpenAI and Anthropic can be used

! What to watch out for

  • The code agent path relies on Python snippet execution
  • Tool-calling agents are supported as a separate mode

FAQ

How is it installed?

The steps name pip install smolagents, importing classes and defining a CodeAgent with tools.

What makes code agents different?

The material states they run Python code snippets rather than emitting JSON or text blocks.

Last reviewed: 2026-11-15

More AI coding tools tools

View all →

How we review