KVarN logo

KVarN

huawei-csl/KVarN

vLLM KV-cache quantization backend for AI agents

GraphCanon updated 1mo · GitHub synced 1mo · 25 views this month

442 stars29 forksLast push 2mo Python Apache-2.0

Decision brief

KVarN amplifies AI agent capabilities via vLLM KV-cache quantization for extended context and throughput without sacrificing accuracy.

Good fit when

  • For applications needing over threefold to fivefold increase in context length compared to FP16.
  • When seamless integration with minimal setup, using one flag is desired.

Avoid when

  • If project constraints do not allow for Apache-2.0 licensing terms.
  • Projects that cannot benefit from a quantization backend, such as those requiring non-variable length model support.

Observed Jul 15, 2026 · Source: enrich:decision_facts

Verify the decision

Maintenance and security

Full trust report
Maintenance
Steady (33d since push)
As of 1mo
Provenance
Not a fork · Organization account
As of 1mo
Security (OSV)
No lockfile
As of 1mo

Public GitHub metadata and optional OSV scans. Signals, not a guarantee. Trust methodology.

Install

pip install KVarN
PyPI

Similar tools

Same-category neighbours. No typed graph edges are catalogued for this tool yet.

Evidence and technical details

Sourced facts, taxonomy, compatibility claims, README excerpt, and machine-readable endpoints.

Overview

KVarN offers a quantization solution that enhances the context length and throughput of AI agents without compromising on accuracy.

Capability facts

CLI
CLI entrypoint

Source: pyproject.toml:[project.scripts] · Jul 26, 2026

Languages
python

Source: github.language+pyproject.toml · Jul 26, 2026

Categories

Compatibility

Sourced claims from the README excerpt - not unsourced marketing copy.

Python runtimePython

Source: README excerpt (regex_v1, Jul 26, 2026)

```python from vllm import LLM, SamplingParams
Source link

Tags

README

2. Install (uses the upstream precompiled wheel; KVarN kernels are Triton, JIT-compiled at runtime)

VLLM_USE_PRECOMPILED=1 pip install -e .


```python
from vllm import LLM, SamplingParams

llm = LLM(
    model="Qwen/Qwen3-32B",
    dtype="float16",                    # KVarN runs in float16
    kv_cache_dtype="kvarn_k4v2_g128",   # enable KVarN
    block_size=128,                     # KVarN tile size
)
print(llm.generate("Explain KV-cache quantization in one sentence.",
                    SamplingParams(max_tokens=64))[0].outputs[0].text)

Serving works the same way:

vllm serve Qwen/Qwen3-32B --dtype float16 --kv-cache-dtype kvarn_k4v2_g128 --block-size 128

Note: KVarN runs in float16 compute. One vLLM block is one KVarN tile, so the tile / page size equals --block-size. Both 128 (default) and 64 are supported, selected by the matching preset (kvarn_k4v2_g128 / kvarn_k4v2_g64). 128 is the design point; 64 gives finer quantization granularity at the cost of a little KV capacity (more per-tile scale overhead per token), at essentially the same throughput.

Tip (capacity): KVarN realizes its full KV-cache capacity when there is room to amortize a small fixed decode workspace. On multi-GPU or generous --gpu-memory-utilization setups this is automatic. On a tight single-GPU budget, vLLM's CUDA-graph memory profiler can over-reserve and shrink the KV pool; set VLLM_MEMORY_PROFILER_ESTIMATE_CUDAGRAPHS=0 (and/or raise --gpu-memory-utilization) to recover the full capacity.


License and attribution

KVarN is built on vLLM (v0.23.0) and is released under the Apache 2.0 License. The original vLLM README is preserved as README_vLLM.md.

For agents

This page has a .md twin and JSON over the API.

Was this helpful?

Anonymous feedback helps us improve pages and translations.