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):
--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:
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.
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