A Hugging Face model repository often holds a dozen quantisations of the same model, and llama.cpp will happily take whichever file it finds first if you do not say which one. The --hf-repo flag lets you name the repository and the quantisation, so you get the file you planned for — not a full-precision file that eats your VRAM.
Name the repo and the quantisation
Start the server or the CLI with --hf-repo <user>/<model>[:quant], where the quant suffix is optional, case-insensitive, and defaults to Q4_K_M when you leave it off. If that quantisation does not exist in the repo, it falls back to the first file in the repository — so always name the quant explicitly when it matters, for example --hf-repo ggml-org/Qwen3.5-0.8B-GGUF:Q8_0.
llama serve --hf-repo ggml-org/Qwen3.5-0.8B-GGUF:Q8_0
# default when omitted: Q4_K_M, then the first file in the repo
The flag picks a file; it does not verify the bytes against a published checksum. The honest check after downloading is to read the quantisation out of the GGUF metadata — general.file_type — and compare it with the one you asked for, before the model eats your VRAM.
Try it: four checks
| Check | What you should see | If you do not see it |
|---|---|---|
| Repo named | The –hf-repo value has user/model and a quant | Use the exact repo name from Hugging Face |
| Quant respected | The downloaded file is the quant you asked for | Read general.file_type from the metadata |
| Server starts | The server loads the downloaded file | Check the file size matches the quant |
| No fallback surprise | You did not silently get the first file | Name the quant explicitly |
Expected result. We checked the llama.cpp server README, which defines –hf-repo with the optional case-insensitive quant suffix defaulting to Q4_K_M and falling back to the first file in the repo. We did not download a model on this machine.
Limits
This guide covers the –hf-repo flag only. The flag does not verify checksums, and the fallback rule can surprise you. We did not test any download ourselves.
