Skip to content

Releases

BasinKV v0.1.1

Choose a tag to compare

@SGStellar SGStellar released this 03 Dec 11:23

What's New in BasinKV v0.1.1

SGLang Hybrid SWA OKVP1 Prefix Caching & Session Spill/Restore

  • Lifts the cache_mode="off" restriction for paged SWAKVPool hybrid sliding-window attention (SWA) models in SGLang (Gemma 4 26B-A4B, Gemma 4 E4B Shared-KV, Gemma 3, gpt-oss), supporting cache_mode in {"off", "ram", "nvme", "mixed"}.
  • Co-saves a bounded lossless sliding-window KV tail (swa.k / swa.v) with CRC32 integrity inside backwards-compatible OKVP1 checkpoints, supporting both exact-length hits, SWA-validated sub-prefix slicing, and aligned/unaligned spill_session / restore_session.
  • Preserves fail-loudly launch guards (cache_mode="off") for per-request SWA rings (swa_req_ring=True) and Inkling 2 (rel_extent > 0).

Live A100-80GB Verification (Pinned SGLang a3f0bff5, Quest + INT8, 16,037-token Dual-Needle Prompt)

  • google/gemma-4-E4B-it (Shared-KV, nvme): 204.22 MB .okvp1 (1,024-tok bounded SWA window), cold 3.220s -> warm exact hit 0.319s (10.1x, exact) -> warm sub-prefix SWA-needle hit 0.523s (6.2x) -> cold process restart NVMe reload 0.466s / 0.323s (6.9x / 10.0x, exact), 0 warnings.
  • google/gemma-4-E4B-it (mixed): cold 2.041s -> warm RAM exact hit 0.226s (9.0x, exact) -> warm sub-prefix SWA-needle hit 0.342s (6.0x), 0 warnings.
  • google/gemma-4-26B-A4B-it (nvme): 567.75 MB .okvp1 (2,048-tok bounded SWA window), cold 4.908s -> warm exact hit 1.796s (2.7x, exact) -> warm sub-prefix SWA-needle hit 1.167s (4.2x) -> cold process restart NVMe reload 0.877s / 0.627s (5.6x / 7.8x, global + in-window SWA needles PASS), 0 warnings.

Install

pip install basinkv==0.1.1

BasinKV v0.1.0

Choose a tag to compare

@SGStellar SGStellar released this 03 Dec 02:17

BasinKV v0.1.0

First public release of BasinKV, Zellige AI's bounded-VRAM sparse KV-cache offloading and tiered RAM/NVMe prefix caching implementation across llama.cpp, SGLang, and vLLM V1.

Install (vLLM V1 zero-fork plugin)

pip install basinkv

basinkv registers OasisKVConnector through the vllm.general_plugins entry point, so unmodified vllm serve can use --kv-transfer-config '{"kv_connector":"OasisKVConnector",...}' with no fork or module path.

Highlights

  • vLLM V1 Mode 1 (zero-fork plugin, verified on v0.19.1 and v0.34.0):
    • Tiered RAM LRU + 4 KB-aligned NVMe OKVP1 prefix caching with INT8, WHT-INT4 (1.94x-1.97x smaller on disk vs INT8), or lossless BF16 (none).
    • Full SupportsHMA multi-group support: Dense (Qwen3-8B), Full + SWA (Gemma 3 4B, Gemma 4 26B-A4B with D = 512 + D = 256), and Recurrent + Full hybrids (MambaSpec: live-verified on ibm-granite/granite-4.0-h-micro in both mamba_cache_mode="none" and "align" with lossless exact-boundary recurrent checkpoints).
  • llama.cpp (pinned ca123ba76, backend-neutral API v7):
    • NVIDIA CUDA: Single-user (-np 1, full decode CUDA graphs) and parallel slots (-np 2..256, unified -kvu and --no-kv-unified), Quest INT8 + INT8 host KV and SphereIndex INT4 + WHT-INT4 host KV, D = 512, Shared-KV tail layers (Gemma 4 E4B), Inkling 2 Mini relative-position bias, and OKVS1 v2/v3 prompt cache.
    • Apple Silicon Metal (ggml-metal): 19 MSL 2.4 -fno-fast-math kernels (<= 22,112 B threadgroup memory), ARC + MRC ObjC++17 core (6,204/6,204 live tests), live-verified llama-cli --oasiskv and llama-server --oasiskv -np 4 with OKVS1 RAM prompt cache.
    • AMD ROCm/HIP: Unified CUDA/HIP core compile-verified with 0 warnings and 0 spills across gfx90a, gfx942, gfx1100, gfx1151, and gfx1201 (live AMD hardware run pending).
  • SGLang (pinned a3f0bff5):
    • Multi-user ragged serving (B = 16 x 64K = 1.024M tokens verified), NEXTN MTP speculative decoding with static draft ring, optional fused Triton block-sparse cold prefill, SWA hybrids (Gemma 4 26B-A4B, Gemma 4 E4B, Gemma 3 27B, gpt-oss 20B), and OKVP1 RAM/NVMe prefix caching + session spill.

Links