Skip to content
AI Skills Central

Type to search Agent Skills, workflows, tutorials, tools and the glossary.

smolagents

Hugging Face's small Python library for agents that write their actions as code.

By Hugging FaceChecked
Visit huggingface.co(opens in a new tab)
Bookmark

Bookmarks are kept in your free account, so you can find this page again on any device.

Sign in to bookmark

What it is

smolagents keeps the agent loop to roughly a thousand lines of code. Its main idea is the CodeAgent, which writes each action as a Python snippet instead of a JSON tool call, so it can loop, branch and combine tools in one step. Because that means running model-written code, it supports sandboxed execution in services such as E2B, Modal and Docker. It works with local models, Hugging Face inference providers or any API through LiteLLM, and can load tools from MCP servers, LangChain or the Hub.

Best for

A readable agent loop you can study and modify.

Skills it helps with

  • Agent Development Kit (ADK)

    Google's code-first framework for building, evaluating and deploying agents.

    Open sourceGoogle

  • Claude Agent SDK

    Build agents on the same harness that powers Claude Code.

    Open sourceAnthropic

  • LangChain

    Components and integrations for building LLM applications.

    Open sourceLangChain

  • Microsoft Agent Framework

    Microsoft's open-source framework for agents and multi-agent workflows.

    Open sourceMicrosoft

  • OpenAI Agents SDK

    Lightweight Python framework for agents, handoffs and guardrails.

    Open sourceOpenAI

  • Pydantic AI

    Type-safe Python agent framework from the Pydantic team.

    Open sourcePydantic

All Agent frameworks and SDKs