--- id: smolagents version: "1.26.0" license: unclear license_treatment: unclear maintenance: active --- # smolagents — 🤗 smolagents: a barebones library for agents. Agents write python code to call tools or orchestrate other agents. License: unclear · Maintenance: active · Downloads: 626.8K/mo ## What it is and what it does smolagents is a lightweight agent framework that lets you build autonomous agents in a few lines of code. Unlike traditional agents that generate tool-call descriptions, smolagents agents write actual Python code to invoke tools and coordinate multi-step workflows. The library is model-agnostic—it works with local transformers, Ollama, OpenAI, Anthropic, and many other providers via LiteLLM or Hugging Face's inference API. It also supports multiple modalities (text, vision, video, audio) and can pull tools from MCP servers, LangChain, or Hugging Face Spaces. The core agent type, CodeAgent, follows a ReAct loop: it receives a task, generates Python code snippets that call tools as functions, executes that code, stores the results in memory, and repeats until it calls a final_answer function. For security, you can run agents in sandboxed environments. The library integrates with Hugging Face Hub for sharing agents and tools as Space repositories, making it easy to collaborate and reuse agent configurations. Use it for: - Build a multi-step research agent that searches the web, extracts information, and synthesizes answers without manual orchestration. - Create a vision-enabled agent that browses websites, clicks elements, and extracts product details or prices from e-commerce sites. - Share reusable agents and tool collections on Hugging Face Hub for team collaboration and instant deployment. - Run agents locally with transformers or connect to any LLM provider (OpenAI, Anthropic, Together AI) by changing one configuration. - Orchestrate complex workflows where agents coordinate with other agents or call specialized tools from MCP servers. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. smolagents lets you build and run AI agents that write Python code to call tools and orchestrate other agents, with support for multiple LLM providers and sandboxed execution. Yes, if you want to build code-writing agents with minimal boilerplate and flexibility across LLM providers. The low install friction, active maintenance, and zero known vulnerabilities make it safe to try. The young release history (first release 2024-12-27) means the API may evolve, but the design is intentionally minimal. Start with the quick demo to verify it fits your use case. ## Install pip install smolagents uv add smolagents poetry add smolagents ## Installing smolagents Before you install: Low install friction with a pure-Python wheel and six common runtime dependencies. Active maintenance with a recent release (77 days ago), though the project is young (first release 2024-12-27). Quickstart: pip install 'smolagents[toolkit]' from smolagents import CodeAgent, WebSearchTool, InferenceClientModel model = InferenceClientModel() agent = CodeAgent(tools=[WebSearchTool()], model=model) agent.run("How many seconds would it take for a leopard at full speed to run through Pont des Arts?") Requires Python >= 3.10. Sandboxed execution backends (Blaxel, E2B, Modal, Docker) may require additional setup or API keys. Verify before relying: - Whether the sandboxed execution backends (Blaxel, E2B, Modal, Docker) are included or require separate installation. - Performance characteristics and latency for typical multi-step agent workflows. - Whether the library's ~1,000 lines of code claim remains accurate at version 1.26.0. ## Package facts - License: not declared (unclear) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 626.8K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags code-writing agents, LLM agent framework, tool-calling agents, multi-step AI orchestration, sandboxed agent execution, huggingface agent library, ReAct agents with code, agent-framework, llm-orchestration, code-execution [View on SkillFed](https://skillfed.io/packages/smolagents) · [View on PyPI](https://pypi.org/project/smolagents/)