smolagents

Open-source Python library from Hugging Face designed to make it extremely easy to build and run agents in a few lines of code. First-class support for CodeAgent (actions written as Python code) and ToolCallingAgent (JSON tool calls). Model-agnostic and modality-agnostic.

Creator: Hugging Face | Category: tool-use | Status: stable

Key Capabilities

  • CodeAgent (actions as Python code)
  • ToolCallingAgent (JSON tool calls)
  • Sandboxed execution via Modal/Blaxel/E2B/Docker
  • Hub integrations (Gradio Spaces)
  • Model-agnostic (HF Inference, OpenAI, Anthropic, LiteLLM, Transformers, Ollama)
  • Vision/video/audio inputs
  • MCP/LangChain tool support
  • CLI tools (smolagent, webagent)