New Tool Radar

Local Model Setup

How to Pick One Exact GGUF File With llama.cpp –hf-file

Name one exact GGUF file inside a Hugging Face repo with --hf-file, so the server loads that file instead of whatever the quant suffix resolves to.

Schematic diagram with four steps: open the repo file list, copy the exact file name, start the server with --hf-repo and --hf-file, then confirm the named file loads.

The --hf-repo flag picks a quantisation for you, but some repositories use custom file names that no quant suffix matches. --hf-file is the escape hatch: name one exact file, and the server downloads that file.

Name the repo and the exact file

Start the server with both flags: --hf-repo microsoft/Phi-3-mini-4k-instruct-gguf --hf-file Phi-3-mini-4k-instruct-q4.gguf -c 4096. The file flag overrides the quant in --hf-repo, so the two together say exactly which file to fetch. Use it whenever a repo’s file names do not follow the usual quant pattern, or when two files share the same quant label.

llama-server \
  --hf-repo microsoft/Phi-3-mini-4k-instruct-gguf \
  --hf-file Phi-3-mini-4k-instruct-q4.gguf \
  -c 4096

Copy the file name from the repository’s file list on Hugging Face, character for character — a typo gives you a download error, not a different file. For gated repositories, add --hf-token or set the HF_TOKEN environment variable.

Try it: four checks

Check What you should see If you do not see it
File named The –hf-file value matches a file in the repo Copy it from the repo’s file list
Download succeeds The server fetches the named file Check the file name spelling and the token
Quant overridden The named file loads, not the quant default The file flag overrides –hf-repo
Server answers The server starts and serves the model Check the model path in the log

Expected result. We checked the llama.cpp server README, which says –hf-file names a Hugging Face model file and, if specified, overrides the quant in –hf-repo. We did not download a model on this machine.

Limits

This guide covers the –hf-file flag only. The flag names a file; it does not verify checksums. We did not test any download ourselves.

Sources

See all