uv-torch-compass
By using uv-torch-compass, you can test official PyTorch package indexes against both your version requirements and the current Linux machine, then safely write the first verified choice to the target project's pyproject.toml.
An index is a package download location. PyTorch publishes separate official indexes for CPU and NVIDIA CUDA builds. This tool checks more than whether a package can be installed: it runs PyTorch, NumPy, the selected GPU, and optional torchvision or torchaudio checks before applying a choice.
Quick start
You need Linux, a recent uv, internet access, and Python 3.10–3.14. The target pyproject.toml must contain torch, torchvision, or torchaudio in base dependencies or in a selected extra or dependency group.
For a minimal project:
[project]
name = "my-project"
version = "0.1.0"
requires-python = ">=3.10,<3.15"
dependencies = ["torch>=2.5"]
From the target project, run a version published on PyPI to verify a candidate and preview the change:
uvx uv-torch-compass plan
To try a local checkout or wheel instead, select it explicitly:
uvx --from /path/to/uv_torch_compass uv-torch-compass plan
If the plan is suitable, apply it. This updates pyproject.toml, locks the workspace, synchronizes the selected project environment, and verifies the result again:
uvx uv-torch-compass apply
Later, validate the recorded source, lockfile, synchronized environment, and installed runtime without changing them:
uvx uv-torch-compass check
When using a local checkout, replace /path/to/uv_torch_compass with this repository's path and keep the same --from prefix for apply and check. Add --pyproject /path/to/project/pyproject.toml when running from another directory.
Choosing what to test
The default --backend auto policy tries uv's automatic selection, compatible CUDA candidates advertised by the installed uv, and CPU in that order. It stops at the first candidate that passes; it does not benchmark all candidates or claim to choose the fastest one.
You can narrow the policy:
uv-torch-compass plan --backend cpu
uv-torch-compass plan --backend cuda
uv-torch-compass plan --backend cu128
uv-torch-compass plan --channel nightly
stable is the default channel. nightly is used only when explicitly selected. See backend and runtime selection for the exact order and checks.
Safety at a glance
planinstalls and tests candidates in temporary environments but does not change the targetpyproject.toml,uv.lock, or project environment.applycreates timestamped backups and treats a workspace member'spyproject.tomland the shared rootuv.lockas one transaction.- Writes use same-directory temporary files and atomic replacement. A workspace lock prevents two
applyprocesses from updating together. - Lock, sync, final validation, timeout, SIGINT, and SIGTERM failures trigger file rollback and an environment recovery attempt.
- Logs and JSON reports redact common credential forms and are created with private file permissions.
Review git diff after plan and apply. Backups remain after success; recovery and troubleshooting explains their names and limitations.
Supported scope
plan,apply, andcheckrun on Linux.--helpand--versionwork on other systems.- CPU and NVIDIA CUDA builds are supported. AMD ROCm and Intel XPU are rejected.
- Stable and nightly official PyTorch indexes are supported; stable never falls back to nightly automatically.
- Base dependencies, selected extras, selected dependency groups, uv workspaces,
torchvision, andtorchaudioare supported. - CUDA success requires a real tensor calculation on the selected GPU. NVIDIA drivers are never installed or updated.
- Exit codes are
0for success,1for configuration or operational failure, and2for invalid command syntax.
Documentation
| Goal | Guide |
|---|---|
| Learn the commands and options | CLI usage |
| Configure project defaults and environment variables | Configuration |
| Understand the process flow, backend, channel, GPU, Python, and runtime checks | How selection works |
| Use extras, groups, and workspaces | Projects and dependency scopes |
| Consume text and JSON results | Reports and automation |
| Recover files or diagnose a failure | Recovery and troubleshooting |
| Test, build, and prepare artifacts | Development |
See the documentation index for the complete map.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file uv_torch_compass-0.1.1.tar.gz.
File metadata
- Download URL: uv_torch_compass-0.1.1.tar.gz
- Upload date:
- Size: 86.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f75e6609ddff1ab078996d540a11c6ae606ac3617d4301c48f0e69078dd6cdf1
|
|
| MD5 |
bce655d91ff3654f45b54c284f00a875
|
|
| BLAKE2b-256 |
c6f6e12abc33926e48e8d7399a345896e2a946efabd1960ee8d71c27dd6bfb04
|
Provenance
The following attestation bundles were made for uv_torch_compass-0.1.1.tar.gz:
Publisher:
publish.yml on Onely7/uv_torch_compass
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
uv_torch_compass-0.1.1.tar.gz -
Subject digest:
f75e6609ddff1ab078996d540a11c6ae606ac3617d4301c48f0e69078dd6cdf1 - Sigstore transparency entry: 2226074848
- Sigstore integration time:
-
Permalink:
Onely7/uv_torch_compass@05dec9e3c047d3d9f0a69e98f14a2c1189f3eb14 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/Onely7
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@05dec9e3c047d3d9f0a69e98f14a2c1189f3eb14 -
Trigger Event:
release
-
Statement type:
File details
Details for the file uv_torch_compass-0.1.1-py3-none-any.whl.
File metadata
- Download URL: uv_torch_compass-0.1.1-py3-none-any.whl
- Upload date:
- Size: 48.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d64b748853d37415faf3c8bd155fd8060cd5eeae3c1c01319eaaab4b7da0dfad
|
|
| MD5 |
c24657fa4ea0c77f45cb7c78db77ad5f
|
|
| BLAKE2b-256 |
beebd187ad3e6504ee5b60fdc3b62ff5cd0a7c7f6cffe6a41aa507c52c6abc25
|
Provenance
The following attestation bundles were made for uv_torch_compass-0.1.1-py3-none-any.whl:
Publisher:
publish.yml on Onely7/uv_torch_compass
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
uv_torch_compass-0.1.1-py3-none-any.whl -
Subject digest:
d64b748853d37415faf3c8bd155fd8060cd5eeae3c1c01319eaaab4b7da0dfad - Sigstore transparency entry: 2226075265
- Sigstore integration time:
-
Permalink:
Onely7/uv_torch_compass@05dec9e3c047d3d9f0a69e98f14a2c1189f3eb14 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/Onely7
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@05dec9e3c047d3d9f0a69e98f14a2c1189f3eb14 -
Trigger Event:
release
-
Statement type: