Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 35 additions & 6 deletions one_click.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ def is_x86_64():
return platform.machine() == "x86_64"


def is_nvidia(gpu_choice):
return gpu_choice.startswith("NVIDIA_CUDA")


def is_installed():
site_packages_path = None
for sitedir in site.getsitepackages():
Expand Down Expand Up @@ -81,6 +85,12 @@ def get_gpu_choice():
"""Get GPU choice from state file or ask user"""
state = load_state()
gpu_choice = state.get('gpu_choice')

# Migrate old state values
if gpu_choice == 'NVIDIA_CUDA128':
gpu_choice = 'NVIDIA_CUDA12'
state['gpu_choice'] = gpu_choice
save_state(state)

if not gpu_choice:
if "GPU_CHOICE" in os.environ:
Expand All @@ -99,7 +109,23 @@ def get_gpu_choice():
)

# Convert choice to GPU name
gpu_choice = {"A": "NVIDIA_CUDA128", "B": "AMD", "C": "APPLE", "D": "INTEL", "N": "NONE"}[choice]
if choice == "A":
# Ask for NVIDIA CUDA version
if "NVIDIA_CUDA_CHOICE" in os.environ:
cuda_choice = os.environ["NVIDIA_CUDA_CHOICE"].upper()
print_big_message(f"Selected NVIDIA CUDA choice \"{cuda_choice}\" based on the NVIDIA_CUDA_CHOICE environment variable.")
else:
cuda_choice = get_user_choice(
"Which CUDA version do you want for llama.cpp?",
{
'A': 'CUDA 12.4 - Supports all GPUs',
'B': 'CUDA 13.1 - Faster on RTX 50xx Blackwell, but drops GTX 750/900/1000 and Titan V (needs driver >= 580)',
},
)

gpu_choice = {"A": "NVIDIA_CUDA12", "B": "NVIDIA_CUDA13"}[cuda_choice]
else:
gpu_choice = {"B": "AMD", "C": "APPLE", "D": "INTEL", "N": "NONE"}[choice]

# Save choice to state
state['gpu_choice'] = gpu_choice
Expand All @@ -113,7 +139,7 @@ def get_pytorch_install_command(gpu_choice):
base_cmd = f"python -m pip install torch=={TORCH_VERSION} "
pypi_fallback = " --extra-index-url https://pypi.org/simple/"

if gpu_choice == "NVIDIA_CUDA128":
if is_nvidia(gpu_choice):
return base_cmd + "--index-url https://download.pytorch.org/whl/cu128" + pypi_fallback
elif gpu_choice == "AMD":
py_tag = f"cp{PYTHON_VERSION.replace('.', '')}"
Expand All @@ -131,7 +157,7 @@ def get_pytorch_update_command(gpu_choice):
base_cmd = f"python -m pip install --upgrade torch=={TORCH_VERSION} "
pypi_fallback = " --extra-index-url https://pypi.org/simple/"

if gpu_choice == "NVIDIA_CUDA128":
if is_nvidia(gpu_choice):
return f"{base_cmd}--index-url https://download.pytorch.org/whl/cu128" + pypi_fallback
elif gpu_choice == "AMD":
py_tag = f"cp{PYTHON_VERSION.replace('.', '')}"
Expand All @@ -148,8 +174,10 @@ def get_requirements_file(gpu_choice):
"""Get requirements file path based on GPU choice"""
requirements_base = os.path.join("requirements", "full")

if gpu_choice == "NVIDIA_CUDA128":
if gpu_choice == "NVIDIA_CUDA12":
file_name = "requirements.txt"
elif gpu_choice == "NVIDIA_CUDA13":
file_name = "requirements_nvidia_cuda13.txt"
elif gpu_choice == "AMD":
file_name = "requirements_amd.txt"
elif gpu_choice == "APPLE":
Expand Down Expand Up @@ -303,8 +331,9 @@ def install_webui():
cmd_flags_file.write("\n--cpu\n")

# Handle CUDA version display
elif any((is_windows(), is_linux())) and gpu_choice == "NVIDIA_CUDA128":
print("CUDA: 12.8")
elif any((is_windows(), is_linux())) and is_nvidia(gpu_choice):
llama_cuda = "12.4" if gpu_choice == "NVIDIA_CUDA12" else "13.1"
print(f"PyTorch CUDA: 12.8, llama.cpp CUDA: {llama_cuda}")

# No PyTorch for AMD on Windows
elif is_windows() and gpu_choice == "AMD":
Expand Down
51 changes: 51 additions & 0 deletions requirements/full/requirements_nvidia_cuda13.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
accelerate==1.13.*
audioop-lts<1.0; python_version >= "3.13"
bitsandbytes==0.49.*
datasets
diffusers==0.37.*
einops
fastapi==0.112.4
flash-linear-attention==0.4.*
huggingface-hub==1.5.*
jinja2==3.1.6
markdown
mcp==1.27.0
numpy==2.2.*
pandas
peft==0.18.*
Pillow>=9.5.0
pydantic==2.11.0
pymupdf==1.27.*
python-docx==1.1.2
pyyaml
requests
rich
safetensors==0.7.*
scipy
sentencepiece
tensorboard
torchao==0.15.*
trafilatura==2.0.0
transformers==5.5.*
triton-windows==3.5.1.post24; platform_system == "Windows"
tqdm
wandb

# Gradio
https://github.com/oobabooga/gradio/releases/download/4.37.2-custom.19/gradio-4.37.2+custom.19-py3-none-any.whl
https://github.com/oobabooga/gradio/releases/download/4.37.2-custom.19/gradio_client-1.0.2+custom.19-py3-none-any.whl

# API
flask_cloudflared==0.0.15
sse-starlette==1.6.5
tiktoken

# CUDA wheels
https://github.com/oobabooga/llama-cpp-binaries/releases/download/v0.110.0/llama_cpp_binaries-0.110.0+cu131-py3-none-win_amd64.whl; platform_system == "Windows"
https://github.com/oobabooga/llama-cpp-binaries/releases/download/v0.110.0/llama_cpp_binaries-0.110.0+cu131-py3-none-linux_x86_64.whl; platform_system == "Linux" and platform_machine == "x86_64"
https://github.com/oobabooga/llama-cpp-binaries/releases/download/v0.110.0/ik_llama_cpp_binaries-0.110.0+cu131-py3-none-win_amd64.whl; platform_system == "Windows"
https://github.com/oobabooga/llama-cpp-binaries/releases/download/v0.110.0/ik_llama_cpp_binaries-0.110.0+cu131-py3-none-linux_x86_64.whl; platform_system == "Linux" and platform_machine == "x86_64"
https://github.com/turboderp-org/exllamav3/releases/download/v0.0.28/exllamav3-0.0.28+cu128.torch2.9.0-cp313-cp313-win_amd64.whl; platform_system == "Windows" and python_version == "3.13"
https://github.com/turboderp-org/exllamav3/releases/download/v0.0.28/exllamav3-0.0.28+cu128.torch2.9.0-cp313-cp313-linux_x86_64.whl; platform_system == "Linux" and platform_machine == "x86_64" and python_version == "3.13"
https://github.com/kingbri1/flash-attention/releases/download/v2.8.3/flash_attn-2.8.3+cu128torch2.9.0cxx11abiFALSE-cp313-cp313-win_amd64.whl; platform_system == "Windows" and python_version == "3.13"
https://github.com/kingbri1/flash-attention/releases/download/v2.8.3/flash_attn-2.8.3+cu128torch2.9.0cxx11abiFALSE-cp313-cp313-linux_x86_64.whl; platform_system == "Linux" and platform_machine == "x86_64" and python_version == "3.13"