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

ModelRole
Qwen3.5-9B Q4_K_M (+ mmproj)Main general model, wiki jobs
Qwen3.5-9B Uncensored, HauhauCS Aggressive Q4_K_MUncensored 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_MUncensored characters
Gemma 3 1BOpen WebUI background tasks (titles, tags, follow-ups)
Qwen2.5-VL-3B-Instruct (+ mmproj)LightRAG vision role
Qwen3-Embedding-0.6B f16LightRAG embeddings

Removed Models and Reasons

ModelReason
Mistral-7B-Instruct v0.3Old and outclassed by the Qwen3.5 and Gemma 4 models
Gemma 3 12BFailed to load fully onto the GPU with -ngl 999; it had only been kept to test how context-heavy the Hermes agent was
Qwen3-14BSame failure to fit on the GPU
Qwen3-Embedding 4B and 8BDifferent embedding dimension from the existing LightRAG index (1024), so unusable without re-indexing
Phi-4-mini-reasoning, DeepSeek-R1-Distill-Llama-8BNever used; Qwen3.5 with thinking on covers the same ground
Gemma 3 4BKept 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 8BUnused 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-mixToo 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 binaries
  • ggml-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=native compilation 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, not Debug — no build type specified
  • llama.cpp’s CMakeLists.txt gates asserts on build type being Release; None fails this check
  • Conclusion: This is a deliberate upstream Arch maintainer choice, not a stale-build artifact

Practical Impact

  • The asserts enabled warning 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 None build 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:

FlagMeaningDefault if unset
-ngl, --n-gpu-layers <N>Layers to offload to GPU0 on CPU-only; auto-fits to VRAM on GPU-enabled builds
-nkvo, --no-kv-offloadKeep KV cache in system RAMKV cache follows offloaded layers to VRAM
-fa, --flash-attnEnable flash attentiondisabled
-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 GPUslayer
-ts, --tensor-split <a,b,...>Ratio to split layers across multiple GPUsnone

Important Notes

  • Requesting more -ngl layers 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:

See Benchmarks for results.