smolagents
View on GitHub🤗 smolagents: a barebones library for agents that think in code.
smolagents is Hugging Face's minimal Python library for building LLM agents that write their actions as executable Python code. It supports CodeAgent and ToolCallingAgent, multi-agent hierarchies, MCP/LangChain tools, sandboxed execution, and any model provider via LiteLLM.
Use Cases
Build code-writing agents in a few linesMulti-agent hierarchical orchestrationSandboxed agent code executionWeb browsing / computer-use agentRAG pipelines over documentsText-to-SQL agentsTool calling via MCP serversShare and load agents/tools from Hugging Face HubVision and audio-capable agent tasksRun agents from CLI with smolagent/webagentSwap LLM providers without code changesTrack agent runs with telemetry
Built With
- Language
- Python
- Frameworks
- LiteLLM · transformers · Gradio · LangChain · MCP · Docker · E2B · Modal · Blaxel · vLLM · Ollama · PyTorch · OpenTelemetry · Arize Phoenix · Hugging Face Hub
Tags
agents · code-agents · multi-agent · tool-calling · react-loop · sandboxed-execution · mcp · llm-agnostic · vision · web-browsing · hub-integration · minimal-abstractions · python · agent-framework