Skip to main content

Unified toolkit for benchmarking and integrating TurboQuant+ KV-cache compression across inference engines (llama.cpp, vLLM, MLX).

Project description

tqkit

Unified toolkit for benchmarking and integrating TurboQuant+ KV-cache compression across LLM inference engines.

What this is

tqkit is a single CLI and Python package that talks to every inference engine that ships TurboQuant+ KV-cache compression:

You bring the inference engine. tqkit autodetects what's installed, runs the canonical benchmark, and prints a reproducible KV-savings table.

Why this exists

KV cache is the dominant memory cost at long context. TurboQuant+ asymmetric (K=q8_0, V=turbo4) shrinks it ~62% with negligible accuracy loss. The savings replicate across engines and hardware vendors. tqkit is the proof, the tool, and the install path.

For a 14B model at 1M tokens of context:

layout KV cache size fits on MI300X 192GB?
FP16 192 GB no (after weights, ~28 GB free)
TQ+ asym (K=q8_0, V=turbo4) 72 GB yes

You can verify the math yourself:

pip install tqkit
tq report --model qwen2.5-14b-instruct-1m --ctx 1M --layout tq+asym
tq table --model qwen2.5-14b-instruct-1m

Install

pip install tqkit

Usage

tq backends                                            # autodetect installed engines
tq report --model qwen2.5-14b-instruct-1m --ctx 32K    # KV cache size for one config
tq table --model qwen2.5-14b-instruct-1m               # full layout × ctx grid
tq integrate <backend>                                 # install + serve recipe
tq bench                                               # canonical benchmark (v0.3.0)

Example output:

$ tq report --model qwen2.5-14b-instruct-1m --ctx 1M --layout tq+asym
[KV cache] model: Qwen/Qwen2.5-14B-Instruct-1M
[KV cache] arch: layers=48 kv_heads=8 head_dim=128
[KV cache] layout: tq+asym
[KV cache] per-token: 72.0 KB (vs 192.0 KB FP16)
[KV cache] total @ 1M ctx: 72.0 GB (vs 192.0 GB FP16, 62.5% savings)

Status

v0.2.0 — alpha. KV math + reporter + table work. Canonical bench runner with engine bridges lands in v0.3.0.

License

Apache 2.0.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tqkit-0.2.0.tar.gz (13.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

tqkit-0.2.0-py3-none-any.whl (12.2 kB view details)

Uploaded Python 3

File details

Details for the file tqkit-0.2.0.tar.gz.

File metadata

  • Download URL: tqkit-0.2.0.tar.gz
  • Upload date:
  • Size: 13.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.4

File hashes

Hashes for tqkit-0.2.0.tar.gz
Algorithm Hash digest
SHA256 2b1bbd80804966115e05193d7025eba5e1c61937ff355668a429f22b81e9847e
MD5 32edb2e862313fe693565a294edf55a7
BLAKE2b-256 cb7ab59ea9cee9ce1d351da2197bf0c0be84353cdd8caf4d69def30c68cc4ed2

See more details on using hashes here.

File details

Details for the file tqkit-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: tqkit-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 12.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.4

File hashes

Hashes for tqkit-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b0a9cdcd2cf36aba04c56252f16fae08fa082365b2b38eb9c14f9cb666ed519e
MD5 e09fccda523e51f1177529f153c705d4
BLAKE2b-256 87d7169e6bd59fdd8346a2e7361fe55e4e267a65eb602dd6707c1daec4aa39e8

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page