Nov 2, 5:37pm

On uv ≥ 0.5.x, uvx accepts the same resolver options as uv tool install, so you can add the PyTorch CUDA 12.6 index directly:

bash
uvx \
  --index pytorch-cu126=https://download.pytorch.org/whl/cu126 \
  --from openai-whisper \
  whisper audio.mp3

Why this works: uv's default index strategy is first-index — for each package it uses the first index (in the order given, before PyPI) that contains it. torch exists on the cu126 index, so it resolves from there (you'll see torch-2.x.x+cu126 in the resolution output); openai-whisper and its other deps aren't on the PyTorch index, so they fall through to PyPI. uv even special-cases the PyTorch index's 403 responses for missing packages ( indexes docs,  PyTorch guide).

Two caveats:

  • Cached environments: uvx caches the tool environment per request. If you already ran uvx --from openai-whisper whisper without the index flag, force a rebuild once with --refresh (or use --isolated):
    bash
    uvx --refresh --index pytorch-cu126=https://download.pytorch.org/whl/cu126 --from openai-whisper whisper audio.mp3
  • --torch-backend=cu126 won't work here: that convenience flag (which does exactly this routing for you) is only available in the uv pip interface, not for uvx/uv tool ( PyTorch guide).

If you use whisper regularly, a persistent install avoids repeating the flags and the caching surprise:

bash
uv tool install openai-whisper --index pytorch-cu126=https://download.pytorch.org/whl/cu126
whisper audio.mp3

Alternatively, the uv pip route lets you use --torch-backend explicitly:

bash
uv venv
uv pip install openai-whisper --torch-backend=cu126
.venv/bin/whisper audio.mp3

Notes for Debian 13 specifically:

  • Whisper shells out to ffmpeg, which isn't pulled in by pip: sudo apt install ffmpeg.
  • cu126 wheels rely on CUDA minor-version compatibility, so any NVIDIA driver supporting CUDA 12.x (≥ 525.60, check nvidia-smi) works; no CUDA toolkit install needed since the wheels bundle everything.
  • Sanity check afterwards: uvx ... whisper --help should work, and the install log line for torch should end in +cu126 — if it says +cu130 or plain 2.x.x, the PyPI wheel won and the index flag didn't take effect.
Nov 2, 5:37pm

This is a shared conversation and may include unverified content that doesn't reflect Mistral AI's views. Login to resume chatting.

Vibe can make mistakes. Check answers. Learn more