quant.cpp CLAUDE.md

Claude Code instructions for quantumaikr/quant.cpp, covering quant.cpp — agent development guide, project vision, project overview, architecture and key documents.

Instructions file

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add instructions/quantumaikr/quant.cpp/claude-md
Clone the repo
git clone --depth 1 https://github.com/quantumaikr/quant.cpp
Per session 2,450 This file is loaded in full into every session.
When invoked 2,450 The same file — it is already loaded in full.
Security scan A 0 findings. Scan, not verified.
Origin unknown No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.02450 $0.02450
Opus 5 $0.01225 $0.01225
Sonnet 5 $0.00490 $0.00490
Haiku 4.5 $0.00245 $0.00245

Measured today against content hash 920656ca7edd, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

quant.cpp CLAUDE.md scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured today.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

CLAUDE.md · 217 lines

How it starts

The opening of the file, as written. The whole thing — 217 lines — stays where its author put it; the contents beside it link to each section on GitHub.

quant.cpp — Agent Development Guide

Project Vision

"LLM의 SQLite" — 가장 작고, 가장 읽기 쉽고, 가장 쉽게 임베딩할 수 있는 LLM 엔진.

Two directions:

  1. Embedding Engine: quant.h 단일 헤더(15K LOC)로 어디든 LLM 추가
  2. KV Compression Research: 함수 3개로 새 양자화 타입 추가 가능한 연구 플랫폼

Non-goals: GPU 속도 경쟁 (llama.cpp 영역), 배치 서빙 (vLLM 영역), 학습

Project Overview

quant.cpp is a minimal C inference engine for local LLM with KV cache compression. 72K LOC, pure C, zero dependencies. Supports 7 architectures via GGUF. Killer feature: KV cache compression — 7x compression with PPL +0.0% vs FP32. Ships as quant.h (15K LOC single header) and WASM (192KB).

Architecture

include/turboquant/   — Public C API (turboquant.h, tq_types.h, tq_spec.h)
src/core/             — Algorithms (tq_polar.c, tq_qjl.c, tq_turbo.c, tq_uniform.c, tq_traits.c)
src/cache/            — Paged cache + progressive compression
src/backend/cpu/      — CPU kernels (generic, AVX2, NEON)
src/backend/cuda/     — CUDA kernels
src/backend/metal/    — Metal compute shaders (7 kernels: matmul, rmsnorm, rope, attention, etc.)
src/engine/           — GGUF loader, transformer forward, tokenizer, generate
tests/                — Google Test unit tests (34 tests)
wasm/                 — Browser demo (quant.wasm 192KB + index.html)
docs/                 — API reference, custom quantization guide, tech report
examples/             — Embedding examples (minimal, chat, kv_compare)
bench/                — Performance benchmarks
spec/                 — Format specification + test vectors
integrations/         — llama.cpp, vLLM, Python bindings
harness/              — Autonomous development harness (run.sh, team.toml)

Key Documents

  • docs/prd_v0.1.md — Full product requirements
  • docs/wbs_v0.1.md — Work breakdown structure with checklists
  • program.md — Current agent task specification (READ THIS FIRST)
  • score.sh — Automated 5-dimension scoring (0.0 ~ 1.0)

Reference Implementations (DO NOT MODIFY)

  • refs/QJL/ — QJL Python/CUDA implementation (Amir Zandieh)
  • refs/PolarQuant/ — PolarQuant Python/Triton implementation
  • refs/llama.cpp/ — llama.cpp fork with TQ1/TQ2 weight quantization
  • refs/vllm/ — vLLM KV cache infrastructure
  • refs/onnx/ — ONNX quantization operator specification

Read the full file on GitHub · 217 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. today First seen · 217 lines · 2,450 tokens per session scan A 920656ca7edd

Subscribe to this mod's changes

quant.cpp CLAUDE.md is an instructions file published in the GitHub repository quantumaikr/quant.cpp (399 stars, last pushed 4mo ago), licensed Apache-2.0. It adds 2,450 tokens to every session, about $0.0123 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-01.