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 a GPU

Without its compiled lmcache.cuda_ops extension, LMCache copies KV between the GPU and CPU with a torch fallback that does not handle the fused K/V layout vLLM uses since 0.26. The bytes it hands the plugin are then not the KV, and a reload gives wrong answers. So when a GPU is present and the extension does not import, the plugin refuses to start and logs why. LMCache then marks itself unhealthy and, with its default recompute policy, stops caching (its own CPU tier would take the same wrong copy); requests are still served. 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.1

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.1
File Size Uploaded Provenance Actions
lmcache_kvblockd-0.2.1.tar.gz 47.3 kB Without provenance Details for lmcache_kvblockd-0.2.1.tar.gz

Built distribution (wheel)

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

Total release size: 62.3 kB

Release files / lmcache_kvblockd-0.2.1.tar.gz

Download URL lmcache_kvblockd-0.2.1.tar.gz
Size 47.3 kB
Tags Source
SHA-256 checksum
How to use checksums
abf1ab12f4299444297c2f76779af42517c258aa4becd3785a9bef0a20278706
BLAKE2b-256 checksum
How to use checksums
70c8df15573e70669e55956f534a3ea4f84db711ea814553a98d8d801e8e3dfd
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.1-py3-none-any.whl

Download URL lmcache_kvblockd-0.2.1-py3-none-any.whl
Size 15.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ddfc40063efb3d011e834ce82c8d874a95e4ece897d8af4aa956964bceabe2ff
BLAKE2b-256 checksum
How to use checksums
8d46ce59899748abd440f9f375eba17a844105176cf167c0f00b7fc3b4656730
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.1

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