I’ve wanted to use llama-cpp but the biggest barrier I have right now is figuring out how to configure it into my configuration.nix file.
I’ve seen millions of tutorials on how to configure ollama and it’s very easy to setup. Even the NixOS wiki is pretty straight forward and easy.
I’m currently still use ollama, but I still want to shift to llama-cpp.
I feel like we’re lacking a tutorial or video on how to configure llama-cpp, and I think if there were more, it’d probably get more people to use it.
Something that bugs me is configuring the models:
{
services.llama-cpp = {
enable = true;
package = pkgs.llama-cpp-vulkan;
# package = (pkgs.llama-cpp.override { cudaSupport = true; })
# package = pkgs.llama-cpp-rocm;
# Takes care of downloading if model not present
modelsPreset = {
# Requires 8GB VRAM
"LFM2.5-8B-A1B" = {
hf-repo = "unsloth/LFM2.5-8B-A1B-GGUF";
hf-file = "LFM2.5-8B-A1B-UD-Q4_K_XL.gguf";
alias = "unsloth/LFM2.5-8B-A1B-GGUF";
temp = "0.2";
repeat-penalty = "1.05";
top-k = "80";
};
# Requires 56GB VRAM
"Qwen3-Coder-Next" = {
hf-repo = "unsloth/Qwen3-Coder-Next-GGUF";
hf-file = "Qwen3-Coder-Next-UD-Q4_K_XL.gguf";
alias = "unsloth/Qwen3-Coder-Next";
temp = "1.0";
top-p = "0.95";
top-k = "40";
};
};
};
}
Where do people find the Hugging Face details for hf-repo , hf-file, and alias?
For example, I’m trying to find that information for this specific model: DavidAU/Qwen3.5-9B-The-Defiant-Fable-Uncensored-Heretic-NEO-IMATRIX-MAX-MTP-GGUF · Hugging Face
reference: Llama-cpp - Official NixOS Wiki

