Skip to content

Commit 763bbbf

Browse files
committed
fix: use tar.gz for llama.cpp release assets, remove brew fallback
1 parent e3c7c8c commit 763bbbf

2 files changed

Lines changed: 32 additions & 39 deletions

File tree

install-dev.sh

Lines changed: 26 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -44,40 +44,35 @@ fi
4444
if command -v llama-server &>/dev/null; then
4545
ok "llama-server installed"
4646
else
47-
info "Installing llama.cpp..."
48-
if command -v brew &>/dev/null && brew install llama.cpp 2>/dev/null; then
49-
ok "llama.cpp installed via Homebrew"
47+
info "Installing llama.cpp from GitHub release..."
48+
OS_NAME="$(uname -s | tr '[:upper:]' '[:lower:]')"
49+
ARCH_NAME="$(uname -m)"
50+
LLAMA_REPO="ggerganov/llama.cpp"
51+
LLAMA_TAG=$(curl -fsSL "https://api.github.com/repos/$LLAMA_REPO/releases/latest" 2>/dev/null | grep '"tag_name"' | head -1 | sed -E 's/.*"([^"]+)".*/\1/' || echo "")
52+
if [[ -z "$LLAMA_TAG" ]]; then
53+
fail "Could not determine latest llama.cpp release"
54+
exit 1
55+
fi
56+
if [[ "$OS_NAME" == "darwin" ]]; then
57+
LLAMA_ASSET="llama-${LLAMA_TAG}-bin-macos-arm64.tar.gz"
58+
[[ "$ARCH_NAME" == "x86_64" ]] && LLAMA_ASSET="llama-${LLAMA_TAG}-bin-macos-x64.tar.gz"
5059
else
51-
info "Homebrew install failed or unavailable, downloading from GitHub..."
52-
OS_NAME="$(uname -s | tr '[:upper:]' '[:lower:]')"
53-
ARCH_NAME="$(uname -m)"
54-
LLAMA_REPO="ggerganov/llama.cpp"
55-
LLAMA_TAG=$(curl -fsSL "https://api.github.com/repos/$LLAMA_REPO/releases/latest" 2>/dev/null | grep '"tag_name"' | head -1 | sed -E 's/.*"([^"]+)".*/\1/' || echo "")
56-
if [[ -z "$LLAMA_TAG" ]]; then
57-
fail "Could not determine latest llama.cpp release"
58-
exit 1
59-
fi
60-
if [[ "$OS_NAME" == "darwin" ]]; then
61-
LLAMA_ASSET="llama-${LLAMA_TAG}-bin-macos-arm64.zip"
62-
[[ "$ARCH_NAME" == "x86_64" ]] && LLAMA_ASSET="llama-${LLAMA_TAG}-bin-macos-x64.zip"
63-
else
64-
LLAMA_ASSET="llama-${LLAMA_TAG}-bin-ubuntu-x64.zip"
65-
[[ "$ARCH_NAME" == "aarch64" || "$ARCH_NAME" == "arm64" ]] && LLAMA_ASSET="llama-${LLAMA_TAG}-bin-ubuntu-arm64.zip"
66-
fi
67-
LLAMA_TMPDIR=$(mktemp -d)
68-
curl -fL --progress-bar -o "$LLAMA_TMPDIR/$LLAMA_ASSET" "https://github.com/$LLAMA_REPO/releases/download/${LLAMA_TAG}/${LLAMA_ASSET}"
69-
unzip -q "$LLAMA_TMPDIR/$LLAMA_ASSET" -d "$LLAMA_TMPDIR/llama"
70-
LLAMA_SERVER=$(find "$LLAMA_TMPDIR/llama" -name "llama-server" -type f | head -1)
71-
if [[ -z "$LLAMA_SERVER" ]]; then
72-
fail "llama-server not found in release archive"
73-
rm -rf "$LLAMA_TMPDIR"
74-
exit 1
75-
fi
76-
chmod +x "$LLAMA_SERVER"
77-
sudo cp "$LLAMA_SERVER" /usr/local/bin/llama-server
60+
LLAMA_ASSET="llama-${LLAMA_TAG}-bin-ubuntu-x64.tar.gz"
61+
fi
62+
LLAMA_TMPDIR=$(mktemp -d)
63+
curl -fL --progress-bar -o "$LLAMA_TMPDIR/$LLAMA_ASSET" "https://github.com/$LLAMA_REPO/releases/download/${LLAMA_TAG}/${LLAMA_ASSET}"
64+
mkdir -p "$LLAMA_TMPDIR/llama"
65+
tar -xzf "$LLAMA_TMPDIR/$LLAMA_ASSET" -C "$LLAMA_TMPDIR/llama"
66+
LLAMA_SERVER=$(find "$LLAMA_TMPDIR/llama" -name "llama-server" -type f | head -1)
67+
if [[ -z "$LLAMA_SERVER" ]]; then
68+
fail "llama-server not found in release archive"
7869
rm -rf "$LLAMA_TMPDIR"
79-
ok "llama-server → /usr/local/bin/llama-server"
70+
exit 1
8071
fi
72+
chmod +x "$LLAMA_SERVER"
73+
sudo cp "$LLAMA_SERVER" /usr/local/bin/llama-server
74+
rm -rf "$LLAMA_TMPDIR"
75+
ok "llama-server → /usr/local/bin/llama-server"
8176
fi
8277

8378
# Docker (only required when not using Atlas)

install.sh

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -74,15 +74,12 @@ else
7474
info "Latest llama.cpp release: $LLAMA_TAG"
7575

7676
if [[ "$OS" == "darwin" ]]; then
77-
LLAMA_ASSET="llama-${LLAMA_TAG}-bin-macos-arm64.zip"
77+
LLAMA_ASSET="llama-${LLAMA_TAG}-bin-macos-arm64.tar.gz"
7878
if [[ "$ARCH" == "amd64" ]]; then
79-
LLAMA_ASSET="llama-${LLAMA_TAG}-bin-macos-x64.zip"
79+
LLAMA_ASSET="llama-${LLAMA_TAG}-bin-macos-x64.tar.gz"
8080
fi
8181
elif [[ "$OS" == "linux" ]]; then
82-
LLAMA_ASSET="llama-${LLAMA_TAG}-bin-ubuntu-x64.zip"
83-
if [[ "$ARCH" == "arm64" ]]; then
84-
LLAMA_ASSET="llama-${LLAMA_TAG}-bin-ubuntu-arm64.zip"
85-
fi
82+
LLAMA_ASSET="llama-${LLAMA_TAG}-bin-ubuntu-x64.tar.gz"
8683
else
8784
fail "No prebuilt llama.cpp for $OS/$ARCH"
8885
exit 1
@@ -91,11 +88,12 @@ else
9188
LLAMA_URL="https://github.com/$LLAMA_REPO/releases/download/${LLAMA_TAG}/${LLAMA_ASSET}"
9289
LLAMA_TMPDIR=$(mktemp -d)
9390
if ! $DOWNLOAD_PROGRESS -o "$LLAMA_TMPDIR/$LLAMA_ASSET" "$LLAMA_URL" 2>&1; then
94-
fail "Could not download llama.cpp — try: brew install llama.cpp"
91+
fail "Could not download llama.cpp from $LLAMA_URL"
9592
rm -rf "$LLAMA_TMPDIR"
9693
exit 1
9794
fi
98-
unzip -q "$LLAMA_TMPDIR/$LLAMA_ASSET" -d "$LLAMA_TMPDIR/llama"
95+
mkdir -p "$LLAMA_TMPDIR/llama"
96+
tar -xzf "$LLAMA_TMPDIR/$LLAMA_ASSET" -C "$LLAMA_TMPDIR/llama"
9997

10098
# Find llama-server in the extracted archive.
10199
LLAMA_SERVER=$(find "$LLAMA_TMPDIR/llama" -name "llama-server" -type f | head -1)

0 commit comments

Comments
 (0)