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