Smolagents

Lightweight Python agent framework from Hugging Face where agents write Python code instead of JSON tool calls

Open Source

Smolagents is a minimalist agent library from Hugging Face with core logic in roughly 1,000 lines of code. Its Code Agents write actions as Python code rather than JSON-based tool calls, enabling natural composability with loops, conditionals, and function nesting. This reduces steps and LLM calls by about 30% compared to standard tool-calling. It works with any LLM (local via Ollama or remote via OpenAI, Anthropic, etc.), supports sandboxed execution through E2B, Docker, and Modal, and integrates with Hugging Face Hub for sharing tools and agents.

Pricing: Free

Screenshot of Smolagents webpage

Is your product missing? 👀 Add it here →