dotsagent.io
Language:English
Framework · Hugging Face

smolagents at a glance

Hugging Face's small Python library, about a thousand lines, whose CodeAgent writes its actions as Python code. That code runs in sandboxes such as Modal, E2B or Docker, and agents and tools can be shared on the Hub.

Best for: Learning and research, especially agents that act by writing code.

Key facts

Maintainer
Hugging Face
Languages
Python
Licence
Apache-2.0
Latest version
1.26.0 · May 29, 2026
Repository
huggingface/smolagents · 29,617 stars
Hosted option
None

Quickstart

Install the package, set the credentials, then run the smallest agent from the official docs. Model IDs are the ones the docs use and may not be enabled on your account.

Install
pip install 'smolagents[toolkit]'

Needs HF token for Inference API

Python
from smolagents import CodeAgent, InferenceClientModel

# Initialize a model (using Hugging Face Inference API)
model = InferenceClientModel()  # Uses a default model

# Create an agent with no tools
agent = CodeAgent(tools=[], model=model)

# Run the agent with a task
result = agent.run("Calculate the sum of numbers from 1 to 10")
print(result)

Quickstart source

Features

Any modelYesHF Inference Providers, LiteLLM, local Transformers and Ollama
MCP clientYesTools from any MCP server, LangChain or Hub Spaces
MCP serverNot confirmed
Multi-agentYesAgents can orchestrate other agents
Durable runsNot confirmed
Human approvalNot confirmed
TracingNot confirmed
EvalsNo

Recent changes

  • No PyPI release since 1.26.0 on 29 May 2026, though the repo still received commits in late September 2026.

Alternatives in the same language

Sources

  1. huggingface.co/docs/smolagents/index
  2. pypi.org/pypi/smolagents/json
  3. api.github.com/repos/huggingface/smolagents

Independent reference for people who build AI agents. Not affiliated with any vendor named here.

© 2026 DotsAgent · Facts checked October 1, 2026