Skip to main content

TorbuQuant banner

TorbuQuant

LLM KV-cache compression, vector quantization, cache accounting, and serving-path experiments.

A GinkgoQ research implementation for measuring when compressed KV storage helps real long-context inference workloads.


Purpose

TorbuQuant is a Python package for studying and implementing TurboQuant-style LLM KV-cache compression. The repository keeps the research path and serving path separate:

Path Role
Diagnostic path Reconstructs or compares dense tensors so logits, attention outputs, and generation behavior can be inspected.
Serving path Stores historical K/V in packed byte layouts and measures whether that storage can improve capacity under a memory bound.

The project is built around three measurable goals:

  1. Reduce KV-cache storage bytes while counting metadata and workspace.
  2. Preserve model behavior under explicit quality gates.
  3. Improve practical serving capacity when KV memory, context length, or batch size is the bottleneck.

What Is In This Repository

Area Status
Codebooks Exact Beta-sphere Lloyd-Max codebooks and Gaussian approximation.
Rotation QR and RHT modes.
Vector quantization MSE direction quantization with packed index storage.
QJL Residual sign projection for vector and inner-product experiments.
KV formats K16, K8, K4 and V8, V4, V3, V2 helpers.
Cache accounting Packed bytes, norms, scales, zeros, metadata, recent windows, and workspace reports.
Attention Dense, dequantized, direct-QK, packed-V, and selected Triton decode paths.
vLLM integration Metadata, page geometry, page cache, registry, runtime selection, and verification helpers.
HuggingFace integration Diagnostic DynamicCache wrapper and Qwen evaluation scripts.
Qwen A/B Controlled baseline-vs-TurboQuant evaluation script with isolated run directories.

Install

Create and activate a Python environment, then install the repository from the project root:

Install from source

python -m venv .venv
source .venv/bin/activate
python -m pip install --upgrade pip
python -m pip install -e .

Install from PyPI

python -m venv .venv
source .venv/bin/activate
python -m pip install --upgrade pip
python -m pip install ginkgoq-turboquant

Quick Checks

Run the repository test suite:

python -m pytest tests -q

Build the documentation site:

python -m mkdocs build --strict

Run the Qwen A/B evaluator with explicit scenario settings before making any memory, quality, or speed statement:

python scripts/qwen_ab_eval.py --help

Repository Map

turboquant/
  core/          codebooks, rotations, MSE quantization, QJL
  packing/       bit packing and byte accounting helpers
  kv/            compressed cache formats and memory reports
  attention/     dense, diagnostic, and packed-reference attention paths
  triton/        update/decode kernels and reference wrappers
  integration/   HuggingFace and vLLM integration layers
  quality/       comparison, retrieval, and generation metrics
scripts/         metadata, verification, benchmark, and Qwen A/B entry points
docs/            MkDocs Material publication site
tests/           unit and integration tests

Metadata

Release files for ginkgoq-turboquant 0.1.0.post1

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

Source distribution (sdist)

Source distribution for ginkgoq-turboquant 0.1.0.post1
File Size Uploaded Provenance Actions
ginkgoq_turboquant-0.1.0.post1.tar.gz 122.7 kB Without provenance Details for ginkgoq_turboquant-0.1.0.post1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for ginkgoq-turboquant 0.1.0.post1
File Interpreter ABI Platform Actions
ginkgoq_turboquant-0.1.0.post1-py3-none-any.whl Python 3 none any Details for ginkgoq_turboquant-0.1.0.post1-py3-none-any.whl

Total release size: 276.6 kB

Release files / ginkgoq_turboquant-0.1.0.post1.tar.gz

Download URL ginkgoq_turboquant-0.1.0.post1.tar.gz
Size 122.7 kB
Tags Source
SHA-256 checksum
How to use checksums
668667c9dea806593939ff241797c346727f68809c5ee118cf0883c9f42c59d9
BLAKE2b-256 checksum
How to use checksums
2196fc96a7afa4da7329aa445e951e46348cbd53cdfa7f829df46c921968f918
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.12

Release files / ginkgoq_turboquant-0.1.0.post1-py3-none-any.whl

Download URL ginkgoq_turboquant-0.1.0.post1-py3-none-any.whl
Size 153.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7b7b81811a90636f995434a05d584c04f37d4c3074ba0c9e83e075a6a6671052
BLAKE2b-256 checksum
How to use checksums
e8ad714475b1ebfbba60a354212f6bb4965b30447abc54349b8e9a9e46ef9fc9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.12

Security for ginkgoq-turboquant 0.1.0.post1

Provenance

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0.post1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page