Skip to main content

lmcache-kvblockd

LMCache remote storage plugin for KVStash. vLLM deployments that already run LMCache can keep KV in the KVStash daemon (kvblockd:// scheme) and reload it after a restart or from another server.

Linux x86-64 only (LMCache ships manylinux wheels only).

Install

pip install lmcache-kvblockd

Configure

PYTHONHASHSEED=0 vllm serve MODEL --kv-transfer-config '{
  "kv_connector": "LMCacheConnectorV1", "kv_role": "kv_both",
  "kv_connector_extra_config": {
    "lmcache.remote_storage_plugins": "kvblockd",
    "lmcache.local_cpu": true,
    "lmcache.chunk_size": 256,
    "lmcache.extra_config": {
      "kvblockd_token": "YOUR_TOKEN",
      "remote_storage_plugin.kvblockd.module_path": "lmcache_kvblockd.adapter",
      "remote_storage_plugin.kvblockd.class_name": "KvblockdConnectorAdapter",
      "remote_storage_plugin.kvblockd.url": "kvblockd://STORE_HOST:9440?namespace=lmcache&streams=4"
    }
  }
}'
  • The address goes in remote_storage_plugin.kvblockd.url. LMCache ignores remote_url when remote_storage_plugins is set, and setting both creates a second backend that doubles every write.
  • Set PYTHONHASHSEED=0 on every worker. LMCache's chunk keys depend on it, so workers with different seeds cannot share cache.
  • Use a separate namespace per model revision, dtype and cache layout.

LMCache's CUDA extension is required on vLLM 0.33 and newer

Without its compiled lmcache.cuda_ops extension, LMCache copies KV between GPU and CPU with a torch fallback that does not handle the fused K/V layout of vLLM 0.33. The bytes it hands the plugin are then not the KV, and a reload gives wrong answers. When CUDA is present, the extension does not import and vLLM is 0.33 or newer, the plugin refuses to start and says why; LMCache keeps serving without the remote tier. Check before you deploy:

python -c "import lmcache.cuda_ops"

If that fails, install an LMCache build compiled for your torch version.

Behaviour notes

  • Cache tags must have string names and values without @ or % (LMCache's text keys do not escape them). Unsupported tags become cache misses.
  • GET and lookup deadlines include queueing and connection set-up.
  • Lookup with pin=True reports only the leading run of keys whose time-limited leases were acknowledged. A lease can expire; LMCache's full asynchronous pin/unpin lifecycle is not implemented.
  • Records with malformed headers or contradictory tensor sizes are removed so they can be written again. Other read problems stay misses without deleting valid records. Do not share a namespace between incompatible writers.

Metadata

Release files for lmcache-kvblockd 0.2.0

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

Source distribution (sdist)

Source distribution for lmcache-kvblockd 0.2.0
File Size Uploaded Provenance Actions
lmcache_kvblockd-0.2.0.tar.gz 46.7 kB Without provenance Details for lmcache_kvblockd-0.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for lmcache-kvblockd 0.2.0
File Interpreter ABI Platform Actions
lmcache_kvblockd-0.2.0-py3-none-any.whl Python 3 none any Details for lmcache_kvblockd-0.2.0-py3-none-any.whl

Total release size: 61.1 kB

Release files / lmcache_kvblockd-0.2.0.tar.gz

Download URL lmcache_kvblockd-0.2.0.tar.gz
Size 46.7 kB
Tags Source
SHA-256 checksum
How to use checksums
45bb8bdfd975ca84b8dfefc3d3ae0d2f3bc1c575150cc0ddf0319aaf3d6440ef
BLAKE2b-256 checksum
How to use checksums
7beb8481c60d4f541536276164688d2b68d653423b6814e3c6252b3ee139e7dc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.7

Release files / lmcache_kvblockd-0.2.0-py3-none-any.whl

Download URL lmcache_kvblockd-0.2.0-py3-none-any.whl
Size 14.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
290adc86ba2171a4c069da3459670bd4c56180bdf3468d2d00942257f5e0a479
BLAKE2b-256 checksum
How to use checksums
6b11f5a17fe34ccf8f81b82cca1119c58ec5d8d49a4e6ee983249315f355f0c2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.7

Security for lmcache-kvblockd 0.2.0

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.

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