Skip to content

Add --torch-backend=auto Flag to uv add torch #12994

Description

@NourEldin-Osama

Summary

Currently, uv pip can automatically install the latest compatible CUDA version of PyTorch via:

1- CLI
uv pip install "torch" --torch-backend=auto --preview

2- pyproject.toml

[tool.uv.pip]
torch-backend = "auto"

It would be great if the same “auto” option were available when adding the torch package directly with uv add.

Proposal:
1- CLI
uv add torch --torch-backend=auto

2- pyproject.toml

[tool.uv]
torch-backend = "auto"

Thanks for this amazing tool!

Example

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or improvement to existing functionality

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions