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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# llamainstall — llama.cpp on any device
|
| 2 |
+
|
| 3 |
+
One installer to put **llama.cpp v1.x** on **any** device. It auto-detects your
|
| 4 |
+
hardware, picks the best backend (CUDA → ROCm → Vulkan → CPU / Metal), downloads
|
| 5 |
+
the exact tuned binary from the official llama.cpp bucket, and acts as a tiny
|
| 6 |
+
version manager (install / switch / rollback / remove).
|
| 7 |
+
|
| 8 |
+
The scripts themselves are tiny wrappers around the official binary bucket
|
| 9 |
+
(`ggml-org/install.sh` on Hugging Face), which the llama.cpp project updates
|
| 10 |
+
with every release. This means **you always get the latest binaries without us
|
| 11 |
+
mirroring 192 GB of artifacts** — and you can even point the scripts at your own
|
| 12 |
+
bucket with `LLAMA_BUCKET=yourorg/your-bucket`.
|
| 13 |
+
|
| 14 |
+
- 🏠 Landing page: <https://broadfield-llamainstall.hf.space>
|
| 15 |
+
- 🤗 Scripts repo: <https://huggingface.co/datasets/broadfield/llamainstall-scripts>
|
| 16 |
+
- 📦 Upstream: <https://github.com/ggml-org/llama.cpp> (current stable: **v1.0.0**)
|
| 17 |
+
|
| 18 |
+
---
|
| 19 |
+
|
| 20 |
+
## Quick install
|
| 21 |
+
|
| 22 |
+
**macOS / Linux / FreeBSD (bash or sh):**
|
| 23 |
+
|
| 24 |
+
```bash
|
| 25 |
+
curl -LsSf https://huggingface.co/datasets/broadfield/llamainstall-scripts/resolve/main/llamainstall.sh | sh
|
| 26 |
+
```
|
| 27 |
+
|
| 28 |
+
**Windows (PowerShell ≥ 5.1):**
|
| 29 |
+
|
| 30 |
+
```powershell
|
| 31 |
+
irm https://huggingface.co/datasets/broadfield/llamainstall-scripts/resolve/main/llamainstall.ps1 | iex
|
| 32 |
+
```
|
| 33 |
+
|
| 34 |
+
That's it. The installer:
|
| 35 |
+
|
| 36 |
+
1. resolves the **latest** build from the bucket (`latest` pointer),
|
| 37 |
+
2. runs hardware **probes** and picks CUDA → ROCm → Vulkan → CPU (or Metal on Apple),
|
| 38 |
+
3. downloads the matching **tuned binary**,
|
| 39 |
+
4. verifies the version stamp, and
|
| 40 |
+
5. puts `llama` (or `llama.exe` on Windows) on your PATH.
|
| 41 |
+
|
| 42 |
+
Try it:
|
| 43 |
+
|
| 44 |
+
```bash
|
| 45 |
+
llama serve # opens the built-in Web UI on http://localhost:8080
|
| 46 |
+
llama cli -hf ggml-org/Qwen3.5-0.8B-GGUF # chat in the terminal
|
| 47 |
+
```
|
| 48 |
+
|
| 49 |
+
---
|
| 50 |
+
|
| 51 |
+
## Usage
|
| 52 |
+
|
| 53 |
+
| Command | Effect |
|
| 54 |
+
|---|---|
|
| 55 |
+
| `llamainstall install [version]` | install (default: latest) and activate |
|
| 56 |
+
| `llamainstall use <version>` | switch active version |
|
| 57 |
+
| `llamainstall list` | show installed versions + active |
|
| 58 |
+
| `llamainstall remove <version>` | delete a version |
|
| 59 |
+
| `llamainstall doctor` | report hardware + recommended backend |
|
| 60 |
+
| `llamainstall models` | popular GGUF models to try |
|
| 61 |
+
| `llamainstall serve [model]` | run llama-server with a small model |
|
| 62 |
+
| `llamainstall uninstall` | remove everything |
|
| 63 |
+
|
| 64 |
+
**Versions:** `latest` (default) · `stable` · `b<build>` (e.g. `b12359`) ·
|
| 65 |
+
`g<commit>` · `v<tag>` (e.g. `v1.0.0`).
|
| 66 |
+
|
| 67 |
+
Examples:
|
| 68 |
+
|
| 69 |
+
```bash
|
| 70 |
+
llamainstall install b12359 # pin a specific nightly build
|
| 71 |
+
llamainstall use b12320 # roll back to an older build
|
| 72 |
+
llamainstall list # see what you have
|
| 73 |
+
```
|
| 74 |
+
|
| 75 |
+
---
|
| 76 |
+
|
| 77 |
+
## Environment variables
|
| 78 |
+
|
| 79 |
+
| Variable | Effect |
|
| 80 |
+
|---|---|
|
| 81 |
+
| `LLAMA_BUCKET` | custom bucket, e.g. `yourorg/install.sh` (default `ggml-org/install.sh`) |
|
| 82 |
+
| `LLAMA_VERSION` | force a version instead of resolving `latest` |
|
| 83 |
+
| `HF_TOKEN` | pass an HF token for rate-limited/private models |
|
| 84 |
+
| `SKIP_CUDA` `SKIP_ROCM` `SKIP_VULKAN` | skip probe backends (any non-empty value) |
|
| 85 |
+
| `LLAMAINSTALL_ROOT` | change install root (bash only, default `~/.llamainstall`) |
|
| 86 |
+
|
| 87 |
+
---
|
| 88 |
+
|
| 89 |
+
## Install location
|
| 90 |
+
|
| 91 |
+
| Platform | Binary | Version data |
|
| 92 |
+
|---|---|---|
|
| 93 |
+
| macOS / Linux / FreeBSD | `~/.local/bin/llama` (symlink) | `~/.llamainstall/versions/<ver>/llama` |
|
| 94 |
+
| Windows | `%LOCALAPPDATA%\Microsoft\WindowsApps\llama.exe` | `%LOCALAPPDATA%\llamainstall\versions\<ver>\llama.exe` |
|
| 95 |
+
|
| 96 |
+
The active version is recorded in `~/.llamainstall/active` (or
|
| 97 |
+
`%LOCALAPPDATA%\llamainstall\active`). `use`/`install` re-point the symlink/copy,
|
| 98 |
+
so rollback is instant.
|
| 99 |
+
|
| 100 |
+
---
|
| 101 |
+
|
| 102 |
+
## Backends & hardware
|
| 103 |
+
|
| 104 |
+
The official bucket ships prebuilt, **hardware-tuned** binaries. The probe order:
|
| 105 |
+
|
| 106 |
+
| Backend | Used when |
|
| 107 |
+
|---|---|
|
| 108 |
+
| **CUDA** | NVIDIA GPU + driver/CUDA toolkit detected |
|
| 109 |
+
| **ROCm** | AMD GPU + HIP SDK detected |
|
| 110 |
+
| **Vulkan** | generic GPU with Vulkan driver (works on most iGPUs) |
|
| 111 |
+
| **CPU** | anything else — tuned by CPU SIMD feature set (AVX512/AVX2/AVX/…) |
|
| 112 |
+
| **Metal** | macOS Apple Silicon (M1–M5 / A18) |
|
| 113 |
+
|
| 114 |
+
Run `llamainstall doctor` to see exactly what your machine reports.
|
| 115 |
+
|
| 116 |
+
**Windows notes**
|
| 117 |
+
|
| 118 |
+
- CUDA acceleration needs the NVIDIA CUDA Toolkit: `winget install Nvidia.CUDA`
|
| 119 |
+
(the probe detects a missing toolkit and tells you).
|
| 120 |
+
- ROCm on Windows needs the HIP SDK from AMD.
|
| 121 |
+
- Vulkan needs no toolkit for most GPUs — good fallback for Intel iGPUs.
|
| 122 |
+
|
| 123 |
+
---
|
| 124 |
+
|
| 125 |
+
## Running models
|
| 126 |
+
|
| 127 |
+
`llama` is the single multi-call binary (CLI, server, and tools). Popular GGUFs:
|
| 128 |
+
|
| 129 |
+
| Approx. size | Model | HF repo id |
|
| 130 |
+
|---|---|---|
|
| 131 |
+
| 0.6 GB | Qwen3.5-0.8B-GGUF | `ggml-org/Qwen3.5-0.8B-GGUF` |
|
| 132 |
+
| 0.9 GB | Llama-3.2-1B-Instruct-GGUF | `ggml-org/Llama-3.2-1B-Instruct-GGUF` |
|
| 133 |
+
| 2.0 GB | Qwen3-4B-GGUF | `ggml-org/Qwen3-4B-GGUF` |
|
| 134 |
+
| 2.2 GB | Llama-3.2-3B-Instruct-GGUF | `ggml-org/Llama-3.2-3B-Instruct-GGUF` |
|
| 135 |
+
| 4.9 GB | Qwen3-8B-GGUF | `ggml-org/Qwen3-8B-GGUF` |
|
| 136 |
+
| 5.0 GB | DeepSeek-R1-Distill-Qwen-7B | `ggml-org/DeepSeek-R1-Distill-Qwen-7B-GGUF` |
|
| 137 |
+
|
| 138 |
+
Run any of them directly:
|
| 139 |
+
|
| 140 |
+
```bash
|
| 141 |
+
llama serve -hf ggml-org/Qwen3.5-0.8B-GGUF # OpenAI-compatible server + Web UI
|
| 142 |
+
llama cli -hf ggml-org/Qwen3.5-0.8B-GGUF # terminal chat
|
| 143 |
+
```
|
| 144 |
+
|
| 145 |
+
---
|
| 146 |
+
|
| 147 |
+
## Other devices
|
| 148 |
+
|
| 149 |
+
### Docker
|
| 150 |
+
|
| 151 |
+
```bash
|
| 152 |
+
docker run -p 8080:8080 -v ./models:/models ghcr.io/ggml-org/llama.cpp:server
|
| 153 |
+
# CUDA variant
|
| 154 |
+
docker run --gpus all -p 8080:8080 -v ./models:/models ghcr.io/ggml-org/llama.cpp:server-cuda
|
| 155 |
+
```
|
| 156 |
+
|
| 157 |
+
See the official docs: <https://github.com/ggml-org/llama.cpp/blob/master/docs/docker.md>
|
| 158 |
+
|
| 159 |
+
### Android (Termux)
|
| 160 |
+
|
| 161 |
+
Build from source inside Termux — ARM64 (aarch64) with Vulkan works well:
|
| 162 |
+
|
| 163 |
+
```bash
|
| 164 |
+
pkg install cmake ninja vulkan-headers
|
| 165 |
+
git clone https://github.com/ggml-org/llama.cpp && cd llama.cpp
|
| 166 |
+
cmake -B build -DGGML_VULKAN=ON && cmake --build build -j4
|
| 167 |
+
```
|
| 168 |
+
|
| 169 |
+
Official guide: <https://github.com/ggml-org/llama.cpp/blob/master/docs/android.md>
|
| 170 |
+
|
| 171 |
+
### WSL2
|
| 172 |
+
|
| 173 |
+
Inside WSL2, just use the Linux script. CUDA passes through automatically with
|
| 174 |
+
a recent Windows NVIDIA driver (no CUDA inside Linux needed).
|
| 175 |
+
|
| 176 |
+
### RISC-V / other CPUs
|
| 177 |
+
|
| 178 |
+
Build from source — llama.cpp has RVV, ZVFH and AMX tuning. Follow the build
|
| 179 |
+
guide: <https://github.com/ggml-org/llama.cpp/blob/master/docs/build.md>
|
| 180 |
+
|
| 181 |
+
---
|
| 182 |
+
|
| 183 |
+
## How it works (internals)
|
| 184 |
+
|
| 185 |
+
`llamainstall.sh` and `llamainstall.ps1` are thin, dependency-light wrappers
|
| 186 |
+
around the official llama.cpp binary bucket:
|
| 187 |
+
|
| 188 |
+
```
|
| 189 |
+
https://huggingface.co/buckets/<LLAMA_BUCKET>/resolve/<VERSION>/latest
|
| 190 |
+
https://huggingface.co/buckets/<LLAMA_BUCKET>/resolve/<VERSION>/<ARCH>/<OS>/<backend>/probe/probe.zst
|
| 191 |
+
https://huggingface.co/buckets/<LLAMA_BUCKET>/resolve/<VERSION>/<ARCH>/<OS>/<backend>/<config>/llama-app.zst
|
| 192 |
+
```
|
| 193 |
+
|
| 194 |
+
They download a small **probe** binary, run it to detect your hardware config,
|
| 195 |
+
then fetch the matching **llama-app binary** (zstd-compressed), verify the
|
| 196 |
+
version stamp, and install it. On macOS the Metal config comes from `sysctl`
|
| 197 |
+
instead of a probe binary.
|
| 198 |
+
|
| 199 |
+
The same trick means you can host your own bucket on Hugging Face (Storage
|
| 200 |
+
Buckets) and point `LLAMA_BUCKET` at it — handy for air-gapped fleets or custom
|
| 201 |
+
builds (e.g. a specific CUDA arch matrix).
|
| 202 |
+
|
| 203 |
+
---
|
| 204 |
+
|
| 205 |
+
## Security
|
| 206 |
+
|
| 207 |
+
- Downloads come from **huggingface.co** over TLS (the official distribution
|
| 208 |
+
host used by llama.cpp itself).
|
| 209 |
+
- The version stamp is verified after download (protects against truncation).
|
| 210 |
+
- The scripts only run the official `probe`/`featcode` binaries from the bucket.
|
| 211 |
+
- Set `HF_TOKEN` if you need authenticated access.
|
| 212 |
+
|
| 213 |
+
---
|
| 214 |
+
|
| 215 |
+
## License
|
| 216 |
+
|
| 217 |
+
The scripts are MIT — do whatever you like. The llama.cpp binaries are MIT
|
| 218 |
+
licensed by the llama.cpp project. GGUF models have their own licenses — check
|
| 219 |
+
each model card.
|