Overview
This page documents llama.cpp installation on the Gigabyte Gaming A16 laptop, using prebuilt CachyOS/Arch packages with CUDA backend support.
Model Cleanup
The model library was reduced from about 20 files to 12 (9 usable models plus their vision projectors).
Kept Models
| Model | Role |
|---|---|
| Qwen3.5-9B Q4_K_M (+ mmproj) | Main general model, wiki jobs |
| Qwen3.5-9B Uncensored, HauhauCS Aggressive Q4_K_M | Uncensored general model |
| Qwen3.5-4B Q4_K_M (+ mmproj) | Smaller general model, LightRAG logic role |
| Gemma 4 E4B (plain, + mmproj) | Characters and general chat |
| Gemma 4 E4B Uncensored, TrevorJS Q4_K_M | Uncensored characters |
| Gemma 3 1B | Open WebUI background tasks (titles, tags, follow-ups) |
| Qwen2.5-VL-3B-Instruct (+ mmproj) | LightRAG vision role |
| Qwen3-Embedding-0.6B f16 | LightRAG embeddings |
Removed Models and Reasons
| Model | Reason |
|---|---|
| Mistral-7B-Instruct v0.3 | Old and outclassed by the Qwen3.5 and Gemma 4 models |
| Gemma 3 12B | Failed to load fully onto the GPU with -ngl 999; it had only been kept to test how context-heavy the Hermes agent was |
| Qwen3-14B | Same failure to fit on the GPU |
| Qwen3-Embedding 4B and 8B | Different embedding dimension from the existing LightRAG index (1024), so unusable without re-indexing |
| Phi-4-mini-reasoning, DeepSeek-R1-Distill-Llama-8B | Never used; Qwen3.5 with thinking on covers the same ground |
| Gemma 3 4B | Kept originally because Gemma 4 E4B was a thinking model; once thinking could be turned off per preset it was redundant |
| Qwen3-8B abliterated, Qwen3.5-4B Uncensored (HauhauCS) | Replaced by the Qwen3.5-9B Uncensored and Gemma 4 E4B Uncensored |
| Llama 3.1 8B, Ministral-3 8B | Unused and overlapping with the Qwen3.5 / Gemma 4 models. Llama 3.1 8B’s benchmark numbers remain in the OptiPlex log |
| Underdog-Saluki 27B IQ2-mix | Too large for the GPU at 2-bit, so it would run mostly on CPU with heavy quality loss |
Uncensored Models
Newer uncensored releases were searched for. The decision was to replace the old Qwen3.5-4B uncensored model with the 9B version from the same author, and to add a Gemma 4 E4B uncensored model for character use.
- HauhauCS Qwen3.5-9B Aggressive: Hugging Face. A third-party comparison reported little capability loss relative to the base model.
- TrevorJS Gemma 4 E4B uncensored: Hugging Face, with the method described in gemma-4-abliteration. It reported a very low refusal rate with small drift from the original.
Neither was compared head-to-head against the base models on this hardware.
Installation
Package Installation
llama.cpp is installed as prebuilt CachyOS/Arch repository packages rather than compiling from source:
llama-cpp— llama.cpp binariesggml-cuda— CUDA backend
Installation is performed via pacman.
Installation Path Comparison
This installation differs from the Local-AI-VM’s self-compiled build:
- Local-AI-VM: CPU-only machine with
-march=nativecompilation and stale-incremental-build troubleshooting - Gigabyte Laptop: Prebuilt packages with no local build directory history
Asserts Enabled Warning
Warning Observation
Every llama-bench run prints: warning: asserts enabled, performance may be affected.
Root Cause Analysis (2026-09-25)
Reading Arch PKGBUILD recipes for ggml and llama-cpp confirmed the warning’s origin:
ggml Package
- Built with
-DCMAKE_BUILD_TYPE=Release— correctly optimized - PKGBUILD sets
options=(!buildflags)— skips makepkg’s default hardening CFLAGS/CXXFLAGS/LDFLAGS injection - This packaging choice is unrelated to asserts/debug behavior
llama-cpp Package
- Root cause: PKGBUILD explicitly sets
-DCMAKE_BUILD_TYPE=None - Not
Release, notDebug— no build type specified - llama.cpp’s
CMakeLists.txtgates asserts on build type beingRelease;Nonefails this check - Conclusion: This is a deliberate upstream Arch maintainer choice, not a stale-build artifact
Practical Impact
- The
asserts enabledwarning is real and explained by upstream packaging - ggml is correctly optimized — The heavy tensor math (including CUDA/CPU backends) uses Release build
- llama-cpp glue code is not optimized — The thinner CLI/glue code is affected by
Nonebuild type - Performance: Absolute t/s numbers should be treated as a floor rather than a ceiling
Self-Compilation Alternative
For a guaranteed fully-optimized build, self-compile from source with -DCMAKE_BUILD_TYPE=Release (same process as the Local-AI-VM build).
GPU-Specific Flags
These flags matter specifically for GPU offload and are not relevant on the CPU-only Local-AI-VM:
| Flag | Meaning | Default if unset |
|---|---|---|
-ngl, --n-gpu-layers <N> | Layers to offload to GPU | 0 on CPU-only; auto-fits to VRAM on GPU-enabled builds |
-nkvo, --no-kv-offload | Keep KV cache in system RAM | KV cache follows offloaded layers to VRAM |
-fa, --flash-attn | Enable flash attention | disabled |
-mg, --main-gpu <N> | Which GPU index is “main” | 0 (only matters with multiple GPUs) |
-sm, --split-mode <none|layer|row> | How to split work across multiple GPUs | layer |
-ts, --tensor-split <a,b,...> | Ratio to split layers across multiple GPUs | none |
Important Notes
- Requesting more
-ngllayers than the model has silently clamps to full offload - Always confirm actual offload via the model-load log line (
offloaded X/X layers to GPU) rather than trusting the flag value alone
Benchmark Scripts
Model sweeps use the same scripts as the Local-AI-VM for like-for-like comparison:
- Model-Benchmark.sh — Per-model
llama-benchpp512/tg128 sweep - ctx_sweep.sh — Doubles
-cper model to find max safe context, adapted for VRAM
See Benchmarks for results.