Skip to content
dag

dag

Pypi • December 2, 2026

Universal Position-Decoupled Graph KV Cache with Query-Side Adjoint RoPE & LSE-Bounded Sparse Bridge Repair

pip install dag-kv==0.7.1

Position-Decoupled Graph KV Cache for Fast, Order-Invariant LLM Serving

Documentation · Quickstart · Benchmarks · Examples · Paper (PDF) · Changelog · Roadmap

DAG-KV eliminates the 0% prefix cache hit cliff in RAG pipelines and AI coding assistants. Standard prefix caches (vLLM Automatic Prefix Caching, SGLang RadixAttention) require exact left-to-right token matches from index 0 — reordering retrieved documents ( [Doc_B, Doc_A] ) or editing one function near the top of a file invalidates the entire cached suffix.

DAG-KV stores document and AST-symbol KV blocks in a 100% read-only, zero-copy canonical graph and applies exact Query-Side Adjoint RoPE ($\mathcal{R}(-\Delta_b)$) in SRAM registers alongside LSE-bounded Submodular Bridge Repair ( 4% → 1.5% ) — achieving 100% cache reuse under arbitrary permutations across GQA and absorbed DeepSeek MLA architectures.

v0.7.0 Released ( Release Notes · Changelog ): Beats live vLLM 0.34.0 APC ( 4.77× / 4.00× ) and SGLang 1.0.0 RadixAttention ( 4.29× / 3.42× ) on H200 Qwen2.5-14B permuted prompts ( 3/3 EM ), while matching SGLang within 0.47 ms on 18.5K prefix hits. Outperforms CacheBlend-15% on standardized real LongBench ( N=111 ) ( 40.70 vs 40.36 macro avg) at 2.10× lower TTFT ( 4.65× faster than Dense Oracle). Real DeepSeek-V2-Lite-Chat Absorbed MLA Engine ( DeepSeekMLADAGKVEngine ) : 8.89× native KV VRAM compression, 3/3 EM via Latent-Space CoW Bridge Repair, and 8.48× faster prefill at 32K . Single-H200 Qwen2.5-32B Scaling & Live 100GbE RoCE RDMA : 10.03× ( 8.4K ) / 7.00× ( 33.8K , 3/3 EM ) Native FP8, 242 tok/s ( 6.50× ) lossless speculative decoding, native vLLM v1 plugin GPU parity ( 0.0 roundtrip diff), and 10.44 GB/s ( 83.5 Gbps ) H200 → Blackwell RoCE KV transfer.

Beats live vLLM 0.34.0 APC ( 4.77× / 4.00× ) and SGLang 1.0.0 RadixAttention ( 4.29× / 3.42× ) on H200 Qwen2.5-14B permuted prompts ( 3/3 EM ), while matching SGLang within 0.47 ms on 18.5K prefix hits.

Outperforms CacheBlend-15% on standardized real LongBench ( N=111 ) ( 40.70 vs 40.36 macro avg) at 2.10× lower TTFT ( 4.65× faster than Dense Oracle).

Real DeepSeek-V2-Lite-Chat Absorbed MLA Engine ( DeepSeekMLADAGKVEngine ) : 8.89× native KV VRAM compression, 3/3 EM via Latent-Space CoW Bridge Repair, and 8.48× faster prefill at 32K .

Single-H200 Qwen2.5-32B Scaling & Live 100GbE RoCE RDMA : 10.03× ( 8.4K ) / 7.00× ( 33.8K , 3/3 EM ) Native FP8, 242 tok/s ( 6.50× ) lossless speculative decoding, native vLLM v1 plugin GPU parity ( 0.0 roundtrip diff), and 10.44 GB/s ( 83.5 Gbps ) H200 → Blackwell RoCE KV transfer.

Verify discovered accelerators, Triton JIT availability, and recommended topology:

1. Drop-In Hugging Face Wrapper (3 Lines)

2. OpenAI-Compatible Server, Cluster KV Fabric & MCP

3. Zero-Fork vLLM v0 & v1 Plugin

dag-kv auto-registers via the vllm.general_plugins entry point ( KVConnectorBase_V1 + vllm.v1.attention.backend.AttentionBackend — live-verified on vLLM 0.34.0 H200 with 0.0 KV roundtrip diff). See Integrations Docs and examples/05_vllm_kv_connector.py for LangChain, LlamaIndex, vLLM, and MCP recipes.

Headline Benchmarks ( v0.7.0 )

Live 3-Way H200 Head-to-Head ( vLLM 0.34.0 vs. SGLang 1.0.0 vs. DAG-KV )

LongBench vs. CacheBlend, Qwen2.5-32B , Real DeepSeek-V2-Lite MLA & 100GbE RoCE RDMA

See Full Multi-Generation Benchmarks (including RTX 2080 Ti vs. vLLM 0.6.6 , quantization Pareto, 8K concurrency ceiling, CUDA Graphs, and TP=2) and benchmarks/README.md for exact reproduction commands.

See Full Multi-Generation Benchmarks (including RTX 2080 Ti vs. vLLM 0.6.6 , quantization Pareto, 8K concurrency ceiling, CUDA Graphs, and TP=2) and benchmarks/README.md for exact reproduction commands.

Query-Side Adjoint RoPE in $\mathrm{SO}(2)$: Because RoPE matrices satisfy $\mathcal{R}(p + \Delta_b) = \mathcal{R}(\Delta_b)\mathcal{R}(p)$ and $\mathcal{R}(\Delta_b)^T = \mathcal{R}(-\Delta_b)$, counter-rotating queries in Triton SRAM registers preserves exact relative positions while keeping physical KV blocks 100% immutable and globally shareable across concurrent tenants : $$\big\langle \tilde{\mathbf{q}} {\text{global}},, \mathcal{R}(\Delta_b)\tilde{\mathbf{k}} {\text{canon}} \big\rangle = \big\langle \mathcal{R}(-\Delta_b)\tilde{\mathbf{q}} {\text{global}},, \tilde{\mathbf{k}} {\text{canon}} \big\rangle$$

Canonical Attention Sink Isolation: Every chunk is prefilled behind a shared 4-token canonical sink prefix ( [0..3] ) and sliced to payload offsets [4..L+3] , eliminating norm pathologies when relocated to $\Delta_b > 0$.

Exact Layer-1 $Q_1$ LSE + Submodular Pyramid Repair: Captures local Log-Sum-Exp $\ell_i^{\text{local}}$ during isolated prefill and bounds cross-chunk drift via $\alpha_i = \sigma(\ell_{i\to\text{prior}} - \ell_i^{\text{local}})$, repairing only 4.0% → 1.5% diverse bridge tokens (or latent-space MLA bridges) into Copy-on-Write shadow blocks.

Development & Testing

See CONTRIBUTING.md , CODE_OF_CONDUCT.md , and SECURITY.md for guidelines.

If you use DAG-KV in your research or serving stack, please cite our work (also available via GitHub's "Cite this repository" button from CITATION.cff ):

Released under the Apache License 2.0 .

Release files for dag-kv 0.7.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation .

Source distribution (sdist)

Built distribution (wheel)

Total release size: 439.2 kB

Release files / dag_kv-0.7.1.tar.gz

Provenance describes where a file came from. On PyPI, provenance is shared via attestations , which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 2, 2026.

Release files / dag_kv-0.7.1-py3-none-any.whl

Provenance describes where a file came from. On PyPI, provenance is shared via attestations , which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 2, 2026.

Security for dag-kv 0.7.1

Provenance describes where a file came from. On PyPI, provenance is shared via attestations , which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Both files in this release have been uploaded with provenance metadata.

Attestation for dag_kv-0.7.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 2, 2026.

Attestation for dag_kv-0.7.1-py3-none-any.whl

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 2, 2026.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Release history Release notifications | RSS feed

Dec 2, 2026 2 release files Full provenance

Dec 2, 2026 2 release files Full provenance

Dec 2, 2026 2 release files Full provenance

Dec 1, 2026 2 release files Full provenance

Dec 1, 2026 2 release files Full provenance

Dec 1, 2026 2 release files Full provenance

Dec 1, 2026 2 release files Full provenance

Nov 23, 2026 2 release files Full provenance

Nov 23, 2026 2 release files Full provenance

Nov 21, 2026 2 release files Full provenance

Nov 19, 2026 2 release files Full provenance

Nov 19, 2026 2 release files Full provenance

Nov 18, 2026 2 release files Full provenance

Nov 17, 2026 2 release files Full provenance

Extracted Entities

Companies (1)

Malware (1)

Tools (1)