smolagents
smolagents is an open-source Python library developed by Hugging Face that enables developers to build and run powerful AI agents with minimal code. The library provides two primary agent paradigms: CodeAgent, which writes actions as Python code snippets for maximum expressiveness and composability, and ToolCallingAgent, which uses structured JSON for reliable and safe tool interactions. smolagents is model-agnostic, supporting Hugging Face Inference Providers, local Transformers, Ollama, LiteLLM (100+ LLMs), Azure OpenAI, Amazon Bedrock, and MLX models. Hub integration allows teams to share and load agents and tools as Gradio Spaces, and multi-agent orchestration enables hierarchical systems where manager agents coordinate specialized sub-agents.
APIs
smolagents Python Library
The core smolagents Python library providing CodeAgent and ToolCallingAgent classes for building AI agents that write Python code or structured JSON to call tools and orchestrat...