LocalAI version:
v4.5.6 (installed via Linux launcher)
Environment, CPU architecture, OS, and Version:
Linux miki-linux-ai 7.1.2-3-cachyos #1 SMP PREEMPT_DYNAMIC Mon, 29 Jun 2026 14:34:35 +0000 x86_64 GNU/Linux
CPU: Ryzen 9950X3D
RAM: 64 GB
GPU: RTX 5080
Describe the bug
When I try to use a model such as gemma-4-12b-it-qat-q4_0, or other variants in the Gemma 4 family, the model fails to load. The llama-cpp backend errors out when it tries to allocate ~ 80 GB of VRAM, vastly exceeding my GPU's capacity of 16 GB.
I can still use models such as ornith-1.0-9b without issues.
This appears to be a regression: I could use these Gemma 4 models without problems up until a week ago (on 26-06-2026 at the latest, sorry, I can't be more precise).
Apart from several updates of both LocalAI and various backends, nothing in my configuration has changed,
To Reproduce
- Install the
gemma-4-12b-it-qat-q4_0 model from the "Install Models" gallery.
- Start a new chat with the model.
Expected behavior
- The model should load without errors and generate responses normally.
- Using an RTX 5080, max VRAM usage should be ~ 14 GB.
Logs
llama-cpp backend log for the failed load of gemma-4-12b-it-qat-q4_0 (full exported log at https://gist.github.com/ackalker/1b50b081493523e9e46a66d4e20cbc5d
):
2:04:30 PM.729stderr0.03.385.263 W llama_kv_cache_iswa: using full-size SWA cache (ref: https://github.com/ggml-org/llama.cpp/pull/13194#issuecomment-2868343055)
2:04:30 PM.736stderr0.03.392.016 E ggml_backend_cuda_buffer_type_alloc_buffer: allocating 81920.00 MiB on device 0: cudaMalloc failed: out of memory
2:04:30 PM.736stderr0.03.392.019 E alloc_tensor_range: failed to allocate CUDA0 buffer of size 85899345920
2:04:30 PM.740stderr0.03.395.824 E llama_init_from_model: failed to initialize the context: failed to allocate buffer for kv cache
2:04:30 PM.740stderr0.03.395.826 E common_init_result: failed to create context with model '/home/miki/.localai/models/llama-cpp/models/gemma-4-12B-it-qat-q4_0-gguf/gemma-4-12b-it-qat-q4_0.gguf'
2:04:30 PM.740stderr0.03.395.827 E common_init_from_params: failed to create context with model '/home/miki/.localai/models/llama-cpp/models/gemma-4-12B-it-qat-q4_0-gguf/gemma-4-12b-it-qat-q4_0.gguf'
llama-cpp backend log for the successful load of ornith-1.0-9b (full exported log at https://gist.github.com/ackalker/31dbef1e5a6babd6f2569e7e683c92cd)
Additional context
LocalAI version:
v4.5.6 (installed via Linux launcher)
Environment, CPU architecture, OS, and Version:
Linux miki-linux-ai 7.1.2-3-cachyos #1 SMP PREEMPT_DYNAMIC Mon, 29 Jun 2026 14:34:35 +0000 x86_64 GNU/Linux
CPU: Ryzen 9950X3D
RAM: 64 GB
GPU: RTX 5080
Describe the bug
When I try to use a model such as
gemma-4-12b-it-qat-q4_0, or other variants in the Gemma 4 family, the model fails to load. Thellama-cppbackend errors out when it tries to allocate ~ 80 GB of VRAM, vastly exceeding my GPU's capacity of 16 GB.I can still use models such as
ornith-1.0-9bwithout issues.This appears to be a regression: I could use these Gemma 4 models without problems up until a week ago (on 26-06-2026 at the latest, sorry, I can't be more precise).
Apart from several updates of both LocalAI and various backends, nothing in my configuration has changed,
To Reproduce
gemma-4-12b-it-qat-q4_0model from the "Install Models" gallery.Expected behavior
Logs
llama-cppbackend log for the failed load ofgemma-4-12b-it-qat-q4_0(full exported log at https://gist.github.com/ackalker/1b50b081493523e9e46a66d4e20cbc5d):
llama-cppbackend log for the successful load ofornith-1.0-9b(full exported log at https://gist.github.com/ackalker/31dbef1e5a6babd6f2569e7e683c92cd)Additional context
It shows similar memory allocation error.
Additional explanation of the
--swa-fullflag: Clarification on --swa-full ggml-org/llama.cpp#24543.