CreateWithAIHub

Framework Hugging Face

smolagents

Hugging Face's minimal Python library for agents that write their actions as code, with any LLM and MCP tools.

Python agent frameworkFreeOpen source
View repository ↗
Save

What it is

smolagents is a small open-source Python library from Hugging Face for running agents in a few lines of code. Its CodeAgent writes its actions as Python code, which can be executed in sandboxes such as E2B, Modal, Blaxel or Docker, and a ToolCallingAgent is also available. It is model-agnostic (local transformers or Ollama models, Hub inference providers, or OpenAI, Anthropic and others via LiteLLM) and can use tools from MCP servers, LangChain or Hub Spaces. Agents and tools can be shared on the Hugging Face Hub.

What it's useful for

Prototyping a research agent that searches the web and computes answers in Python code, then sharing it on the Hugging Face Hub.

Key features

  • Core agent logic in about 1,000 lines of code
  • CodeAgent that writes actions as code, plus ToolCallingAgent
  • Sandboxed code execution via E2B, Modal, Blaxel or Docker
  • Tools from MCP servers, LangChain or Hub Spaces
  • Text, vision, video and audio inputs
  • smolagent and webagent CLI commands

How to use it

Before you start

  • Python 3.10+
pip (with default tools)
pip install "smolagents[toolkit]"

Commands are copied from the official documentation. Check the docs for the latest version before running them.

Limitations to know

  • Code agents execute model-written code; the README recommends sandboxed environments for security
  • Python only

Alternatives

Pydantic's typed Python framework for agents, with model fallback, durable execution, evals and a harness.

FreeOpen source

Open-source Python framework and runtime (AgentOS) for agents, teams and workflows served as APIs and MCP servers.

FreeOpen source

TypeScript framework for AI agents and graph-based workflows with memory, RAG, evals and model routing.

FreeOpen source

AWS's open-source, model-driven SDK and harness for building agents in Python and TypeScript.

FreeOpen source

See all 16 smolagents alternatives →

MCP servers for this

Browserbase's hosted MCP server that lets agents drive cloud browsers with natural-language Stagehand actions.

Free plan + paid

Microsoft's MCP server for browser automation that drives pages through Playwright accessibility snapshots.

FreeOpen source

CreateWithAI Hub's own MCP server: tell your AI what you're building and it finds the tools, MCP servers and skills for the job.

FeaturedFree

Skills for this

Hugging Face's Agent Skills for the Hub CLI, datasets, model training, evaluation, Spaces and SageMaker deployment.

FreeOpen source

Anthropic skill that guides Claude through designing, building and evaluating MCP servers in TypeScript or Python.

FreeOpen source

Related resources

Z.ai's GLM model family (GLM-5.3, GLM-5.3-Flash): open-weight MoE language models with a 1M-token context, API and chat app.

Free plan + paid

Moonshot AI's Kimi models (K3.1 Pro, K3, earlier K2 series): large open-weight MoE models with a 1M-token context and a paid API.

Free plan + paid

Open-source framework for building LLM agents and apps with a standard interface across model providers.

FreeOpen source

Mastra's collection of ready-to-run TypeScript agent, workflow and MCP server projects, scaffolded with create-mastra.

FreeOpen source

Type to search. Use ↑ ↓ and Enter.