Skip to content

Instantly share code, notes, and snippets.

@ochafik
Created January 20, 2025 14:56
Show Gist options
  • Select an option

  • Save ochafik/2fda80db1d5df7b261608b751f3afd55 to your computer and use it in GitHub Desktop.

Select an option

Save ochafik/2fda80db1d5df7b261608b751f3afd55 to your computer and use it in GitHub Desktop.
llama.cpp install script
#!/bin/bash
set -euo pipefail
label=""
if which nvidia-smi >/dev/null ; then
label="cuda-cu$( nvidia-smi | grep "CUDA Version: " | sed -E 's/.*?Version: ([0-9]+\.[0-9]+).*/\1/' )-cap$( nvidia-smi --query-gpu=compute_cap --format=csv | tail -n 1 )"
elif [[ "$( uname -a )" == "darwin" ]]; then
label=
else
fi
wget -O llama-cpp.zip \
"$( curl --silent "https://api.github.com/repos/ggerganov/llama.cpp/releases/latest" | \
grep browser_download_url | \
sed -E 's/.*(https:.*)"/\1/' )" | \
grep "$label"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment