Newsletter
Join the Community
Subscribe to our newsletter for the latest news and updates
smolagents: a barebones library for building powerful, model-agnostic agents that write Python code to call tools and orchestrate tasks.
A smol library to build great agents! smolagents is a library that enables you to run powerful agents in a few lines of code. It offers:
CodeAgent writes its actions in code (as opposed to "agents being used to write code"). To make it secure, we support executing in sandboxed environments via E2B or via Docker.transformers or ollama model, one of many providers on the Hub, or any model from OpenAI, Anthropic and many others via our LiteLLM integration.Our CodeAgent works mostly like classical ReAct agents - the exception being that the LLM engine writes its actions as Python code snippets.
Actions are now Python code snippets. Hence, tool calls will be performed as Python function calls. Writing actions as code snippets is demonstrated to work better than the current industry practice of letting the LLM output a dictionary of the tools it wants to call: uses 30% fewer steps and reaches higher performance on difficult benchmarks.