Installation Options

The smolagents library can be installed using pip. Here are the different installation methods and options available.

Prerequisites

Virtual Environment

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.

venv
uv

Using venv:

python -m venv .venv
source .venv/bin/activate

Basic Installation

Install smolagents core library with:

pip
uv
pip install smolagents

Installation with Extras

smolagents provides several optional dependencies (extras) that can be installed based on your needs. You can install these extras using the following syntax:

pip
uv
pip install "smolagents[extra1,extra2]"

Tools

These extras include various tools and integrations:

pip
uv

Model Integration

These extras enable integration with various AI models and frameworks:

pip
uv

Multimodal Capabilities

Extras for handling different types of media and input:

pip
uv

Remote Execution

Extras for executing code remotely:

pip
uv

Telemetry and User Interface

Extras for telemetry, monitoring and user interface components:

pip
uv

Complete Installation

To install all available extras, you can use:

pip
uv
pip install "smolagents[all]"

Verifying Installation

After installation, you can verify that smolagents is installed correctly by running:

import smolagents
print(smolagents.__version__)

Next Steps

Once you have successfully installed smolagents, you can:

< > Update on GitHub