Installation
pip install smolagents
Install extras for the features you need:
# Tool-calling via LiteLLM (OpenAI, Anthropic, and 100+ providers)
pip install "smolagents[litellm]"
# Local inference with transformers
pip install "smolagents[transformers]"
# Sandboxed code execution
pip install "smolagents[e2b]" # cloud sandbox
pip install "smolagents[docker]" # local docker sandbox
# Everything
pip install "smolagents[all]"
Authentication
To use hosted models set the relevant token as an environment variable, e.g. HF_TOKEN, OPENAI_API_KEY, or your Inferix API key. See Models.