LMCache remote storage plugin for KVStash

The lmcache-kvblockd package lets LMCache use KVStash as a remote storage backend. It is tested in CI against the real lmcache package; it is not yet qualified on GPUs.

Status
Path exists
Adapter
lmcache-kvblockd
Interface
Remote storage plugin
Tested on
LMCache 0.5.6 (not recommended), in CI
GPUs
Not yet qualified

Last updated

Status, plainly

The path works end to end on CPU. It has not passed a GPU run, so treat it as a preview.

  1. Built (done) On PyPI, requiring lmcache 0.5.1 or later and below 0.6.
  2. Tested in CI (done) Registration test through the real lmcache package, and a CPU end-to-end run with vLLM and a live daemon.
  3. Qualified on GPUs (not done) Not yet. Our GPU runs so far needed a patched LMCache build.
  4. Numbers published (not done) None. We publish no LMCache numbers until the GPU runs pass.
Running vLLM today?

Use the native connector. It needs no LMCache and is GPU-tested on vLLM 0.25.1, 0.27.1 and 0.33.0.

vLLM connector

How the plugin plugs into LMCache

LMCache can load third-party remote backends by name (LMCache storage backends). KVStash registers as the plugin kvblockd, under vLLM's LMCache connector.

vLLM with LMCacheone process per GPU server

  1. vLLM LMCacheConnectorV1 vLLM's connector for LMCache
  2. Local LMCache CPU tier local_cpu: true keeps hot chunks in host memory
  3. Remote lmcache-kvblockd Remote storage plugin named kvblockd
plain TCP batched, multi-stream

KVStash daemon

One store for every server. Survives engine restarts.

  • DRAMhot
  • NVMewarm
  • S3cold
FIGURE 1. LMCache keeps hot chunks in its local CPU tier and writes and reads the rest through the plugin. Each vLLM server runs its own LMCache and plugin; all of them reach the same KVStash daemon.
  • Fails open. A daemon that is down, slow or killed mid-request returns a miss, not an exception. The plugin's 10 s operation timeout sits below LMCache's blocking timeout, so a stall becomes a miss.
  • No extra copy. Block bytes land directly in the pinned buffer LMCache allocates.
  • Prefix-aware lookups. A batched lookup returns how many consecutive chunks are stored from the start, which is what vLLM's scheduler needs.

Configure LMCache to use KVStash

Not recommended with LMCache 0.5.6 yet

In our checks on 8 November 2026, in LMCache's own image (lmcache/vllm-openai, vLLM 0.31.0, its compiled kernels loaded), a needle prompt answered correctly on the first request and wrongly when LMCache served the same prompt from its own CPU cache, on Qwen2.5-0.5B and Qwen2.5-1.5B, with or without KVStash. If LMCache hands KVStash wrong bytes, KVStash keeps them: blocks are write-once. On vLLM 0.27 or 0.33, use the native vllm-kvblockd connector until this is fixed upstream; if you run LMCache, check a reloaded answer against a cold one first.

Before you install: LMCache's compiled kernels

Use lmcache-kvblockd 0.2.1 or newer (0.1.0 never writes with LMCache 0.5.6 and newer). On a GPU, LMCache must load its compiled copy kernels: lmcache.cuda_ops on NVIDIA and AMD, lmcache.xpu_ops on Intel, lmcache_ascend.ops on Ascend. Without them LMCache copies KV with a fallback that does not handle the fused K/V layout vLLM uses since 0.26, and reloads give wrong answers. The plugin checks this at start and stays off with a log line saying why; LMCache then stops caching, and requests are still served. Check with python -c "import lmcache.cuda_ops" (on LMCache 0.5.1 to 0.5.5 the module is lmcache.c_ops). The LMCache 0.5.6 build in the official vLLM 0.33 image does not load it; there, use the native vllm-kvblockd connector.

KVStash is set with LMCache's remote_storage_plugins setting, either in an LMCache YAML file loaded with the LMCACHE_CONFIG_FILE environment variable, or inline in vLLM's transfer config with lmcache.-prefixed keys. Use one or the other, not both.

lmcache.yaml
# pip install lmcache-kvblockd, into the Python environment vLLM and LMCache run in
chunk_size: 256
local_cpu: true
remote_storage_plugins: ["kvblockd"]
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"
Shell, inline alternative
export PYTHONHASHSEED=0   # same value on every worker

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"
    }}}'
Put the address in the plugin URL, not remote_url

With remote_storage_plugins, LMCache 0.5.x does not read remote_url. The KVStash address goes in remote_storage_plugin.kvblockd.url. Setting remote_url as well creates a second backend that writes every block twice. Our CI test checks this against the real lmcache package.

  • No lmcache_config_file key. Neither vLLM nor LMCache reads it; a file passed that way is silently ignored.
  • Same PYTHONHASHSEED everywhere. Workers with different seeds compute different keys and cannot share cache. The adapter logs loudly at start if it is not pinned.

Check it is working

A misconfigured plugin fails quietly: LMCache falls back to its local tier and every remote read misses. Check each step.

  1. Start vLLM. The log shows Created remote backend for plugin: kvblockd. No line means the plugin was not loaded.
  2. Send one long prompt. The daemon's kvb_bytes_total{dir="in"} metric rises (curl 127.0.0.1:9442/metrics on the daemon host).
  3. Still no hits? Check the token and namespace match the daemon; a mismatch turns every operation into a miss.

Versions and platforms

CI status as of November 2026. Background: the LMCache project and vLLM releases.
VersionWhat we check
lmcache 0.5.1, 0.5.2Runtime requirement. A fresh Linux install picks the newest 0.5.x. The CPU end-to-end run uses lmcache 0.5.1 with vLLM 0.25.1.
lmcache 0.5.0, 0.4.7Interface check only: the adapter imports against them in CI, to catch renames early.
PlatformLinux x86_64 only. LMCache publishes no macOS wheel.

LMCache integration FAQ

Is the LMCache plugin ready for production?

No. The plugin is built and tested in CI against the real lmcache package, but it is not qualified on GPUs: our GPU attempts so far needed a patched LMCache build. For vLLM today, use the native vllm-kvblockd connector, which is GPU-tested.

Which LMCache versions does it work with?

The package requires lmcache 0.5.1 or later and below 0.6 (a fresh Linux install picks the newest 0.5.x, 0.5.7 as of November 2026). CI also checks the adapter imports against 0.5.0 and 0.4.7. It installs on Linux x86_64 only, because LMCache publishes no macOS wheel.

Why does every request miss even though the plugin is configured?

The most common cause is putting the KVStash address in remote_url. With remote_storage_plugins, LMCache 0.5.x ignores remote_url; the address belongs in remote_storage_plugin.kvblockd.url inside extra_config. Setting remote_url as well creates a second backend and doubles every write. Also check that the token and namespace match the daemon.

Does LMCache need PYTHONHASHSEED?

Yes. LMCache's chunk hashes start from a vLLM value that depends on PYTHONHASHSEED. If workers use different seeds they compute different keys for the same tokens and cannot share cache. Set PYTHONHASHSEED=0 on every worker.

Using LMCache and want KVStash under it?

Tell us your LMCache and vLLM versions, model and GPUs. We will tell you what qualifying this path for your stack would take, and whether the native vLLM connector fits better.

Or write to rudray@kvstash.com