docs/source/en/installation.md
The smolagents library can be installed using pip. Here are the different installation methods and options available.
It's strongly recommended to install smolagents within a Python virtual environment.
Virtual environments isolate your project dependencies from other Python projects and your system Python installation,
preventing version conflicts and making package management more reliable.
Using venv:
python -m venv .venv
source .venv/bin/activate
Using uv:
uv venv .venv
source .venv/bin/activate
Install smolagents core library with:
smolagents provides several optional dependencies (extras) that can be installed based on your needs.
You can install these extras using the following syntax:
<hfoptions id="installation">
<hfoption id="pip">
pip install "smolagents[extra1,extra2]"
These extras include various tools and integrations: <hfoptions id="installation"> <hfoption id="pip">
pip install "smolagents[toolkit]"
pip install "smolagents[mcp]"
These extras enable integration with various AI models and frameworks: <hfoptions id="installation"> <hfoption id="pip">
pip install "smolagents[openai]"
pip install "smolagents[transformers]"
pip install "smolagents[vllm]"
pip install "smolagents[mlx-lm]"
pip install "smolagents[litellm]"
pip install "smolagents[bedrock]"
Extras for handling different types of media and input: <hfoptions id="installation"> <hfoption id="pip">
pip install "smolagents[vision]"
pip install "smolagents[audio]"
Extras for executing code remotely: <hfoptions id="installation"> <hfoption id="pip">
pip install "smolagents[blaxel]"
pip install "smolagents[e2b]"
pip install "smolagents[docker]"
Extras for telemetry, monitoring and user interface components: <hfoptions id="installation"> <hfoption id="pip">
pip install "smolagents[telemetry]"
pip install "smolagents[gradio]"
To install all available extras, you can use: <hfoptions id="installation"> <hfoption id="pip">
pip install "smolagents[all]"
After installation, you can verify that smolagents is installed correctly by running:
import smolagents
print(smolagents.__version__)
Once you have successfully installed smolagents, you can: