# Inference

> Deploy and run your models in production

Deploy your trained models and run inference locally. After a fine-tuning job finishes, download its model onto your robot's device: the run's **Result** panel has a **Download** button with the command to copy, or use the CLI directly:

```bash
qualia model list                                   # find the model's ID
qualia model download <MODEL_ID> --dir ./my-policy  # fetch, check and resume
```

The directory is in Hugging Face layout; pass it to `--policy.path` in the script below. No Hugging Face account or token is needed to download it.

To record evaluation episodes to the Hugging Face Hub, log in there first ([Record a dataset](https://huggingface.co/docs/lerobot/en/il_robots)). Then run inference in your setup:

```bash
lerobot-record \
  --robot.type=so101_follower \
  --robot.port=/dev/ttyACM0 \ # <- Use your port
  --robot.id=my_blue_follower_arm \ # <- Use your robot id
  --robot.cameras="{ front: {type: opencv, index_or_path: 8, width: 640, height: 480, fps: 30}}" \ # <- Use your cameras
  --dataset.single_task="Grasp a lego block and put it in the bin." \ # <- Use the same task description you used in your dataset recording
  --dataset.repo_id=${HF_USER}/eval_DATASET_NAME_test \  # <- This will be the dataset name on the Hugging Face Hub
  --dataset.episode_time_s=50 \
  --dataset.num_episodes=10 \
  --policy.path=./my-policy # <- The directory qualia model download wrote
```

## Installing LeRobot 0.4.4

Qualia models are trained against [LeRobot 0.4.4](https://pypi.org/project/lerobot/0.4.4/).
Install it on your robot's device before running inference.

**Requirements:** Python >= 3.10 (3.12 recommended), ffmpeg with libsvtav1

### Option A: uv (recommended)

[uv](https://docs.astral.sh/uv/) handles Python versions and virtual environments automatically.

```bash
# Install uv if you don't have it
curl -LsSf https://astral.sh/uv/install.sh | sh

# Create a project and pin lerobot
uv init my-robot && cd my-robot
uv add 'lerobot==0.4.4'

# Or run lerobot commands directly without a project
uvx --from 'lerobot==0.4.4' lerobot --help
```

:::note
uv does not install ffmpeg. Install it via your system package manager
(e.g. `apt install ffmpeg`, `brew install ffmpeg`, `conda install ffmpeg`).
:::

### Option B: conda / miniforge

[Miniforge](https://github.com/conda-forge/miniforge) bundles ffmpeg automatically.

```bash
conda create -n lerobot python=3.12 -y
conda activate lerobot
pip install 'lerobot==0.4.4'
```

### Option C: pip + venv

```bash
python3.12 -m venv .venv
source .venv/bin/activate
pip install 'lerobot==0.4.4'
```

### GPU support

LeRobot depends on PyTorch. By default pip installs the CPU build.
For CUDA, install the GPU wheel first:

```bash
# Example: CUDA 12.8 (check https://pytorch.org/get-started for your version)
pip install torch torchvision --index-url https://download.pytorch.org/whl/cu128
pip install 'lerobot==0.4.4'
```

With uv, use `--index-url` or configure a `[[tool.uv.index]]` in pyproject.toml
(see [uv docs on PyTorch](https://docs.astral.sh/uv/guides/integration/pytorch/)).

### Extras for specific models

Install model-specific extras depending on what you fine-tuned:

```bash
pip install 'lerobot[pi]==0.4.4'       # Pi0.5
pip install 'lerobot[smolvla]==0.4.4'  # SmolVLA (models trained before its retirement)
```

### Verify installation

```bash
python -c "import lerobot; print(lerobot.__version__)"
# Expected: 0.4.4
```

### HuggingFace login

You only need a Hugging Face login to push evaluation datasets to the Hub; your
fine-tuned model comes from `qualia model download`:

```bash
huggingface-cli login
```

### Troubleshooting

**Linux build errors** — if pip fails compiling native extensions, install these first:

```bash
sudo apt-get install cmake build-essential python3-dev pkg-config \
  libavformat-dev libavcodec-dev libavdevice-dev libavutil-dev \
  libswscale-dev libswresample-dev libavfilter-dev
```

For other platforms see the [PyAV compilation guide](https://pyav.org/docs/develop/overview/installation.html#bring-your-own-ffmpeg).

**WSL (Windows)** — also install `evdev`:

```bash
conda install evdev -c conda-forge
# or: pip install evdev
```
