🤗 smolagents

2 guides covering common problems, patterns, and production issues in smolagents.

Smolagents is HuggingFace's lightweight Python agent framework. It offers two modes — CodeAgent (writes and executes Python to call tools) and ToolCallingAgent (JSON-based tool calls) — and works with any HuggingFace model, local Ollama models, or any OpenAI-compatible API.

  • CodeAgent: writes Python to use tools — more flexible and powerful
  • ToolCallingAgent: JSON tool calls — safer for production
  • @tool decorator for defining custom tools in one line
  • HuggingFace Hub, Ollama, and OpenAI-compatible model support
  • Minimal dependencies and a small, auditable codebase
Visit official site →

Stay sharp as AI tools evolve

New guides drop regularly. Get them in your inbox — no noise, just signal.