LLM inference in C/C++
manifesto / ggml / ops / maintainer PRs / compile times / lib llama API / llama-server REST API
This fork is a research-grade llama.cpp branch for testing whether long-context KV cache memory can be cut on consumer NVIDIA GPUs without treating quantization as a reconstruction-only problem. The custom path combines TurboQuant KV-cache compression with an SO(8) Triality-inspired K-side protection layer, exposed as key_only_block_so8_triality_vector, while preserving current upstream llama.cpp server/API behavior.
The current public runtime, GGUF schema-v2, four execution modes, parity-coupled residual storage, availability limits, and measured standard sm_120 CUDA evidence are documented in TurboQuant Triality runtime contract.
For a recruiter or engineering reviewer: the interesting work is not another low-bit quantizer, but the validation loop around it. K is protected through the SO(8) vector view, V is compressed with the smallest passing TurboQuant tier, and the result is selected by ablation statistics rather than by visual inspection or a single happy-path prompt.
The current operating profile is triality_vector_v_turbo3: public K cache type triality-vector, llama.cpp K entry point q8_0, public V cache type turbo3, and TURBO_LAYER_ADAPTIVE=7. On the synthetic ablation set, 3-bit protected V was the smallest tier that passed the hidden-state quality threshold: hidden cosine similarity mean 0.988765 with 95% CI [0.988445, 0.989086], attention-output relative error mean 0.149698 with 95% CI [0.147634, 0.151763], and exact-KV memory ratio 0.178223.
| Question | Result |
|---|---|
| Why not 2-bit V? | Lower memory ratio (0.148926) but hidden cosine mean only 0.961259, below the production selection threshold used for this run. |
| Why not 4-bit V? | Better hidden cosine mean (0.996829) and lower attention error (0.079607), but larger memory ratio (0.207520) than the selected 3-bit tier. |
| Does SO8 K protection stay numerically controlled? | The vector K audit passed at the selected tier: mean effective orthogonality error 0.003113, max effective orthogonality error 0.004870, and mean determinant error 0.001814. |
| How was significance checked? | Paired Wilcoxon signed-rank tests over n=9 trials with Holm correction. At 3-bit V, candidate-minus-protected deltas showed SO8-MSE block V was worse on attention error by +0.034621 absolute relative-error units (p_holm=0.01953125), and product-based SO8 V was worse by +0.271150 (p_holm=0.01953125). |
Reproduction artifacts live under docs/research/so8-triarity-turboquant/metrics. This fork intentionally keeps exact-score evaluation, estimated-score evaluation, reconstruction metrics, and attention/logit-facing metrics separate so that future upstream merges do not collapse the method into a plain MSE quantizer.
- Hugging Face cache migration: models downloaded with
-hfare now stored in the standard Hugging Face cache directory, enabling sharing with other HF tools. - guide : using the new WebUI of llama.cpp
- guide : running gpt-oss with llama.cpp
- [FEEDBACK] Better packaging for llama.cpp to support downstream consumers 🤗
- Support for the
gpt-ossmodel with native MXFP4 format has been added | PR | Collaboration with NVIDIA | Comment - Multimodal support arrived in
llama-server: #12898 | documentation - VS Code extension for FIM completions: https://github.com/ggml-org/llama.vscode
- Vim/Neovim plugin for FIM completions: https://github.com/ggml-org/llama.vim
- Hugging Face Inference Endpoints now support GGUF out of the box! ggml-org#9669
- Hugging Face GGUF editor: discussion | tool
- WebGPU support is now available in the browser, see a blog/demo introducing it here.
| Repository | Role |
|---|---|
| zapabob/multiscreen-pytorch | PyTorch reference implementation of the Multiscreen architecture. KV window size (s_w) can be embedded as GGUF metadata for windowed KV cache experiments. |
| zapabob/Turboquant-CUDA | KV cache quantization research and Triality SO(8) rotation work used before GGUF conversion. |
| zapabob/Hypura | GPU/RAM/NVMe tiered inference scheduler that consumes GGUF artifacts produced by this fork. |
A few options to get llama.cpp installed on your machine:
- Visit https://llama.app and follow the instructions
- Run with Docker - see our Docker documentation
- Download pre-built binaries from the releases page
- Build from source by cloning this repository - check out our build guide
Once installed:
# Download and run a model directly from Hugging Face
llama cli -hf ggml-org/Qwen3.5-0.8B-GGUF
# Launch OpenAI-compatible API server
llama serve -hf ggml-org/Qwen3.5-0.8B-GGUF
VLM session with llama cli
|
Built-in web UI against llama serve
|
The main goal of llama.cpp is to enable LLM (and VLM) inference with minimal setup and state-of-the-art performance on
a wide range of hardware - locally and in the cloud.
- Plain C/C++ implementation without any dependencies
- Apple silicon is a first-class citizen - optimized via ARM NEON, Accelerate and Metal frameworks
- AVX, AVX2, AVX512 and AMX support for x86 architectures
- RVV, ZVFH, ZFH, ZICBOP and ZIHINTPAUSE support for RISC-V architectures
- 1.5-bit, 2-bit, 3-bit, 4-bit, 5-bit, 6-bit, and 8-bit integer quantization for faster inference and reduced memory use
- Custom CUDA kernels for running LLMs on NVIDIA GPUs (support for AMD GPUs via HIP and Moore Threads GPUs via MUSA)
- Vulkan and SYCL backend support
- CPU+GPU hybrid inference to partially accelerate models larger than the total VRAM capacity
The llama.cpp project is build on top of the ggml library.
| Backend | Target devices |
|---|---|
| BLAS | All |
| BLIS | All |
| CANN | Ascend NPU |
| CUDA | Nvidia GPU |
| HIP | AMD GPU |
| Hexagon [In Progress] | Snapdragon |
| IBM zDNN | IBM Z & LinuxONE |
| MUSA | Moore Threads GPU |
| Metal | Apple Silicon |
| OpenCL | Adreno GPU |
| OpenVINO [In Progress] | Intel CPUs, GPUs, and NPUs |
| RPC | All |
| SYCL | Intel GPU |
| VirtGPU | VirtGPU APIR |
| Vulkan | GPU |
| WebGPU | All |
| ZenDNN | AMD CPU |
- How to build
- Running on Docker
- Build on Android
- Multi-GPU usage
- Performance troubleshooting
- GGML tips & tricks
- XCFramework
- Completions
- Models
- Release process
- Contributors can open PRs
- Collaborators will be invited based on contributions
- Maintainers can push to branches in the
llama.cpprepo and merge PRs into themasterbranch - Any help with managing issues, PRs and projects is very appreciated!
- Read the CONTRIBUTING.md for more information
The XCFramework is a precompiled version of the library for iOS, visionOS, tvOS, and macOS. It can be used in Swift projects without the need to compile the library from source. For example:
// swift-tools-version: 5.10
// The swift-tools-version declares the minimum version of Swift required to build this package.
import PackageDescription
let package = Package(
name: "MyLlamaPackage",
targets: [
.executableTarget(
name: "MyLlamaPackage",
dependencies: [
"LlamaFramework"
]),
.binaryTarget(
name: "LlamaFramework",
url: "https://github.com/ggml-org/llama.cpp/releases/download/b5046/llama-b5046-xcframework.zip",
checksum: "c19be78b5f00d8d29a25da41042cb7afa094cbf6280a225abe614b03b20029ab"
)
]
)The above example is using an intermediate build b5046 of the library. This can be modified
to use a different version by changing the URL and checksum.
Command-line completion is available for some environments.
$ build/bin/llama-cli --completion-bash > ~/.llama-completion.bash
$ source ~/.llama-completion.bashOptionally this can be added to your .bashrc or .bash_profile to load it
automatically. For example:
$ echo "source ~/.llama-completion.bash" >> ~/.bashrcThis fork includes TurboQuant-related integration for CUDA-based GGUF workflows.
- TurboQuant conversion and runtime wiring for GGUF workflows
- CUDA path/tooling integration for local inference
- Compatibility checks for existing
llama-cliandllama-serverusage
- This is a fork-specific extension and may differ from upstream
ggml-org/llama.cpp. - Behavior can vary by GPU architecture, driver, CUDA toolkit, and model quantization.
- OS: Windows 11
- GPU: NVIDIA GeForce RTX 3060 (12 GB VRAM)
- CUDA: 13.2
- Build:
b8483-abe37ec28 - Model:
Qwen3.5-9B-Uncensored-HauhauCS-Aggressive-Q4_K_M.gguf(Q4_K_M, ~5.23 GiB)
llama-cli -m "%USERPROFILE%\Desktop\EasyNovelAssistant\EasyNovelAssistant\KoboldCpp\Qwen3.5-9B-Uncensored-HauhauCS-Aggressive-Q4_K_M.gguf" -ngl 99 -c 8192 -i- yhirose/cpp-httplib - Single-header HTTP server, used by
llama-server- MIT license - nothings/stb - Single-header image format decoder, used by multimodal subsystem - Public domain
- nlohmann/json - Single-header JSON library, used by various tools/examples - MIT License
- mackron/miniaudio - Single-header audio format decoder, used by multimodal subsystem - Public domain
- sheredom/subprocess.h - Single-header process launching solution for C and C++ - Public domain



