vllm - 💡(How to fix) Fix [Bug]: LMCache cache miss

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Code Example

Your output of `python collect_env.py` here

---

export LMCACHE_USE_EXPERIMENTAL=True
export LMCACHE_CHUNK_SIZE=256
export LMCACHE_LOCAL_CPU=False
export LMCACHE_MAX_LOCAL_CPU_SIZE=5.0
export LMCACHE_REMOTE_URL=lm://localhost:8100
export LMCACHE_REMOTE_SERDE=naive

python3 -m lmcache.v1.server localhost 8100
[2026-05-14 09:44:44,209] LMCache INFO: Initializing cpu-only cache server (__init__.py:14:lmcache.v1.server.storage_backend)
[2026-05-14 09:44:44,209] LMCache INFO: Server started at localhost:8100 (__main__.py:138:__main__)
[2026-05-14 09:45:28,660] LMCache INFO: Connected by ('127.0.0.1', 41688) (__main__.py:142:__main__)
[2026-05-14 09:45:33,342] LMCache INFO: Connected by ('127.0.0.1', 41698) (__main__.py:142:__main__)

---

export LMCACHE_USE_EXPERIMENTAL=True
export LMCACHE_CHUNK_SIZE=256
export LMCACHE_LOCAL_CPU=False
export LMCACHE_MAX_LOCAL_CPU_SIZE=5.0
export LMCACHE_REMOTE_URL=lm://localhost:8100
export LMCACHE_REMOTE_SERDE=naive


vllm serve /models --max-model-len 1024 --gpu-memory-utilization 0.4 --kv-transfer-config '("kv_connector":"LMCacheConnectorV1","kv_role":"kv_both")' --port 8000



(APIServer pid=10707) INFO 05-14 09:45:33 [launcher.py:46] Route: /v1/completions/render, Methods: POST
(APIServer pid=10707) INFO:     Started server process [10707]
(APIServer pid=10707) INFO:     Waiting for application startup.
(APIServer pid=10707) INFO:     Application startup complete.
(EngineCore pid=10974) [2026-05-14 09:45:41,302] LMCache INFO: Reqid: chatcmpl-8bdeaee877a7d704-91bc0a11, Total tokens 368, Inference Engine computed tokens: 0, LMCache hit tokens: 0, need to load: 0 (vllm_v1_adapter.py:1327:lmcache.integration.vllm.vllm_v1_adapter)
(EngineCore pid=10974) [2026-05-14 09:45:41,324] LMCache INFO: list_depth: 1, tensor_dim: 5 (utils.py:365:lmcache.v1.gpu_connector.utils)
(EngineCore pid=10974) [2026-05-14 09:45:41,324] LMCache INFO: GPU KV Cache Dimensions: [28][2, 1009, 16, 8, 128] (utils.py:378:lmcache.v1.gpu_connector.utils)
(EngineCore pid=10974) [2026-05-14 09:45:41,324] LMCache INFO: vLLM KV cache layout: NHD (utils.py:392:lmcache.v1.gpu_connector.utils)
(EngineCore pid=10974) [2026-05-14 09:45:41,325] LMCache INFO: GPU KV Format: NL x [2, NB, BS, NH, HS] (utils.py:319:lmcache.v1.gpu_connector.utils)
(EngineCore pid=10974) [2026-05-14 09:45:41,325] LMCache INFO: Currently used by:
(EngineCore pid=10974)   - vLLM non-MLA flash attention (utils.py:320:lmcache.v1.gpu_connector.utils)
(EngineCore pid=10974) [2026-05-14 09:45:41,327] LMCache INFO: [req_id=chatcmpl-8bdeaee877a7d704-91bc0a11] Stored 256 out of total 256 tokens. size: 0.0273 GB, cost 3.5783 ms, throughput: 7.6415 GB/s; offload_time: 3.4565 ms, put_time: 0.0821 ms (cache_engine.py:552:lmcache.v1.cache_engine)
(APIServer pid=10707) INFO:     127.0.0.1:39696 - "POST /v1/chat/completions HTTP/1.1" 200 OK
(APIServer pid=10707) INFO 05-14 09:45:43 [loggers.py:259] Engine 000: Avg prompt throughput: 33.8 tokens/s, Avg generation throughput: 28.9 tokens/s, Running: 0 reqs, Waiting: 0 reqs, GPU KV cache usage: 0.0%, Prefix cache hit rate: 0.0%, External prefix cache hit rate: 0.0%
(APIServer pid=10707) INFO 05-14 09:45:53 [loggers.py:259] Engine 000: Avg prompt throughput: 0.0 tokens/s, Avg generation throughput: 0.0 tokens/s, Running: 0 reqs, Waiting: 0 reqs, GPU KV cache usage: 0.0%, Prefix cache hit rate: 0.0%, External prefix cache hit rate: 0.0%

---

export LMCACHE_USE_EXPERIMENTAL=True
export LMCACHE_CHUNK_SIZE=256
export LMCACHE_LOCAL_CPU=False
export LMCACHE_MAX_LOCAL_CPU_SIZE=5.0
export LMCACHE_REMOTE_URL=lm://localhost:8100
export LMCACHE_REMOTE_SERDE=naive


vllm serve /models --max-model-len 1024 --gpu-memory-utilization 0.4 --kv-transfer-config '("kv_connector":"LMCacheConnectorV1","kv_role":"kv_both")' --port 8001



(APIServer pid=12476) INFO:     Started server process [12476]
(APIServer pid=12476) INFO:     Waiting for application startup.
(APIServer pid=12476) INFO:     Application startup complete.
(EngineCore pid=12678) [2026-05-14 09:54:45,551] LMCache INFO: Reqid: chatcmpl-a1d76e2cf4346b5c-8957d0a5, Total tokens 368, Inference Engine computed tokens: 0, LMCache hit tokens: 0, need to load: 0 (vllm_v1_adapter.py:1327:lmcache.integration.vllm.vllm_v1_adapter)
(EngineCore pid=12678) [2026-05-14 09:54:45,581] LMCache INFO: list_depth: 1, tensor_dim: 5 (utils.py:365:lmcache.v1.gpu_connector.utils)
(EngineCore pid=12678) [2026-05-14 09:54:45,582] LMCache INFO: GPU KV Cache Dimensions: [28][2, 3207, 16, 8, 128] (utils.py:378:lmcache.v1.gpu_connector.utils)
(EngineCore pid=12678) [2026-05-14 09:54:45,582] LMCache INFO: vLLM KV cache layout: NHD (utils.py:392:lmcache.v1.gpu_connector.utils)
(EngineCore pid=12678) [2026-05-14 09:54:45,582] LMCache INFO: GPU KV Format: NL x [2, NB, BS, NH, HS] (utils.py:319:lmcache.v1.gpu_connector.utils)
(EngineCore pid=12678) [2026-05-14 09:54:45,582] LMCache INFO: Currently used by:
(EngineCore pid=12678)   - vLLM non-MLA flash attention (utils.py:320:lmcache.v1.gpu_connector.utils)
(EngineCore pid=12678) [2026-05-14 09:54:45,584] LMCache INFO: [req_id=chatcmpl-a1d76e2cf4346b5c-8957d0a5] Stored 256 out of total 256 tokens. size: 0.0273 GB, cost 3.1295 ms, throughput: 8.7374 GB/s; offload_time: 2.9910 ms, put_time: 0.1034 ms (cache_engine.py:552:lmcache.v1.cache_engine)
(APIServer pid=12476) INFO 05-14 09:54:45 [loggers.py:259] Engine 000: Avg prompt throughput: 36.8 tokens/s, Avg generation throughput: 6.2 tokens/s, Running: 1 reqs, Waiting: 0 reqs, GPU KV cache usage: 0.8%, Prefix cache hit rate: 0.0%, External prefix cache hit rate: 0.0%
(APIServer pid=12476) INFO:     127.0.0.1:46348 - "POST /v1/chat/completions HTTP/1.1" 200 OK

---

import os
import time
from openai import OpenAI

client = OpenAI(
            api_key="-",
                base_url="http://127.0.0.1:8001/v1"
                )

response = client.chat.completions.create(
            model="/models", 
                messages=[
                            {"role": "system", "content": "You are a helpful assistant"},
                                    {"role": "user", "content": "Hello, I am a student." * 50}
                                        ],
                    stream=False,
                    )

print(response.choices[0].message.content)
RAW_BUFFERClick to expand / collapse

Your current environment

<details> <summary>The output of <code>python collect_env.py</code></summary>
Your output of `python collect_env.py` here
</details>

vllm 0.19.1 lmcache 0.4.3

🐛 Describe the bug

LMCache Server

export LMCACHE_USE_EXPERIMENTAL=True
export LMCACHE_CHUNK_SIZE=256
export LMCACHE_LOCAL_CPU=False
export LMCACHE_MAX_LOCAL_CPU_SIZE=5.0
export LMCACHE_REMOTE_URL=lm://localhost:8100
export LMCACHE_REMOTE_SERDE=naive

python3 -m lmcache.v1.server localhost 8100
[2026-05-14 09:44:44,209] LMCache INFO: Initializing cpu-only cache server (__init__.py:14:lmcache.v1.server.storage_backend)
[2026-05-14 09:44:44,209] LMCache INFO: Server started at localhost:8100 (__main__.py:138:__main__)
[2026-05-14 09:45:28,660] LMCache INFO: Connected by ('127.0.0.1', 41688) (__main__.py:142:__main__)
[2026-05-14 09:45:33,342] LMCache INFO: Connected by ('127.0.0.1', 41698) (__main__.py:142:__main__)

Vllm Server1

export LMCACHE_USE_EXPERIMENTAL=True
export LMCACHE_CHUNK_SIZE=256
export LMCACHE_LOCAL_CPU=False
export LMCACHE_MAX_LOCAL_CPU_SIZE=5.0
export LMCACHE_REMOTE_URL=lm://localhost:8100
export LMCACHE_REMOTE_SERDE=naive


vllm serve /models --max-model-len 1024 --gpu-memory-utilization 0.4 --kv-transfer-config '("kv_connector":"LMCacheConnectorV1","kv_role":"kv_both")' --port 8000



(APIServer pid=10707) INFO 05-14 09:45:33 [launcher.py:46] Route: /v1/completions/render, Methods: POST
(APIServer pid=10707) INFO:     Started server process [10707]
(APIServer pid=10707) INFO:     Waiting for application startup.
(APIServer pid=10707) INFO:     Application startup complete.
(EngineCore pid=10974) [2026-05-14 09:45:41,302] LMCache INFO: Reqid: chatcmpl-8bdeaee877a7d704-91bc0a11, Total tokens 368, Inference Engine computed tokens: 0, LMCache hit tokens: 0, need to load: 0 (vllm_v1_adapter.py:1327:lmcache.integration.vllm.vllm_v1_adapter)
(EngineCore pid=10974) [2026-05-14 09:45:41,324] LMCache INFO: list_depth: 1, tensor_dim: 5 (utils.py:365:lmcache.v1.gpu_connector.utils)
(EngineCore pid=10974) [2026-05-14 09:45:41,324] LMCache INFO: GPU KV Cache Dimensions: [28][2, 1009, 16, 8, 128] (utils.py:378:lmcache.v1.gpu_connector.utils)
(EngineCore pid=10974) [2026-05-14 09:45:41,324] LMCache INFO: vLLM KV cache layout: NHD (utils.py:392:lmcache.v1.gpu_connector.utils)
(EngineCore pid=10974) [2026-05-14 09:45:41,325] LMCache INFO: GPU KV Format: NL x [2, NB, BS, NH, HS] (utils.py:319:lmcache.v1.gpu_connector.utils)
(EngineCore pid=10974) [2026-05-14 09:45:41,325] LMCache INFO: Currently used by:
(EngineCore pid=10974)   - vLLM non-MLA flash attention (utils.py:320:lmcache.v1.gpu_connector.utils)
(EngineCore pid=10974) [2026-05-14 09:45:41,327] LMCache INFO: [req_id=chatcmpl-8bdeaee877a7d704-91bc0a11] Stored 256 out of total 256 tokens. size: 0.0273 GB, cost 3.5783 ms, throughput: 7.6415 GB/s; offload_time: 3.4565 ms, put_time: 0.0821 ms (cache_engine.py:552:lmcache.v1.cache_engine)
(APIServer pid=10707) INFO:     127.0.0.1:39696 - "POST /v1/chat/completions HTTP/1.1" 200 OK
(APIServer pid=10707) INFO 05-14 09:45:43 [loggers.py:259] Engine 000: Avg prompt throughput: 33.8 tokens/s, Avg generation throughput: 28.9 tokens/s, Running: 0 reqs, Waiting: 0 reqs, GPU KV cache usage: 0.0%, Prefix cache hit rate: 0.0%, External prefix cache hit rate: 0.0%
(APIServer pid=10707) INFO 05-14 09:45:53 [loggers.py:259] Engine 000: Avg prompt throughput: 0.0 tokens/s, Avg generation throughput: 0.0 tokens/s, Running: 0 reqs, Waiting: 0 reqs, GPU KV cache usage: 0.0%, Prefix cache hit rate: 0.0%, External prefix cache hit rate: 0.0%

Vllm Server2

export LMCACHE_USE_EXPERIMENTAL=True
export LMCACHE_CHUNK_SIZE=256
export LMCACHE_LOCAL_CPU=False
export LMCACHE_MAX_LOCAL_CPU_SIZE=5.0
export LMCACHE_REMOTE_URL=lm://localhost:8100
export LMCACHE_REMOTE_SERDE=naive


vllm serve /models --max-model-len 1024 --gpu-memory-utilization 0.4 --kv-transfer-config '("kv_connector":"LMCacheConnectorV1","kv_role":"kv_both")' --port 8001



(APIServer pid=12476) INFO:     Started server process [12476]
(APIServer pid=12476) INFO:     Waiting for application startup.
(APIServer pid=12476) INFO:     Application startup complete.
(EngineCore pid=12678) [2026-05-14 09:54:45,551] LMCache INFO: Reqid: chatcmpl-a1d76e2cf4346b5c-8957d0a5, Total tokens 368, Inference Engine computed tokens: 0, LMCache hit tokens: 0, need to load: 0 (vllm_v1_adapter.py:1327:lmcache.integration.vllm.vllm_v1_adapter)
(EngineCore pid=12678) [2026-05-14 09:54:45,581] LMCache INFO: list_depth: 1, tensor_dim: 5 (utils.py:365:lmcache.v1.gpu_connector.utils)
(EngineCore pid=12678) [2026-05-14 09:54:45,582] LMCache INFO: GPU KV Cache Dimensions: [28][2, 3207, 16, 8, 128] (utils.py:378:lmcache.v1.gpu_connector.utils)
(EngineCore pid=12678) [2026-05-14 09:54:45,582] LMCache INFO: vLLM KV cache layout: NHD (utils.py:392:lmcache.v1.gpu_connector.utils)
(EngineCore pid=12678) [2026-05-14 09:54:45,582] LMCache INFO: GPU KV Format: NL x [2, NB, BS, NH, HS] (utils.py:319:lmcache.v1.gpu_connector.utils)
(EngineCore pid=12678) [2026-05-14 09:54:45,582] LMCache INFO: Currently used by:
(EngineCore pid=12678)   - vLLM non-MLA flash attention (utils.py:320:lmcache.v1.gpu_connector.utils)
(EngineCore pid=12678) [2026-05-14 09:54:45,584] LMCache INFO: [req_id=chatcmpl-a1d76e2cf4346b5c-8957d0a5] Stored 256 out of total 256 tokens. size: 0.0273 GB, cost 3.1295 ms, throughput: 8.7374 GB/s; offload_time: 2.9910 ms, put_time: 0.1034 ms (cache_engine.py:552:lmcache.v1.cache_engine)
(APIServer pid=12476) INFO 05-14 09:54:45 [loggers.py:259] Engine 000: Avg prompt throughput: 36.8 tokens/s, Avg generation throughput: 6.2 tokens/s, Running: 1 reqs, Waiting: 0 reqs, GPU KV cache usage: 0.8%, Prefix cache hit rate: 0.0%, External prefix cache hit rate: 0.0%
(APIServer pid=12476) INFO:     127.0.0.1:46348 - "POST /v1/chat/completions HTTP/1.1" 200 OK

Python Code

import os
import time
from openai import OpenAI

client = OpenAI(
            api_key="-",
                base_url="http://127.0.0.1:8001/v1"
                )

response = client.chat.completions.create(
            model="/models", 
                messages=[
                            {"role": "system", "content": "You are a helpful assistant"},
                                    {"role": "user", "content": "Hello, I am a student." * 50}
                                        ],
                    stream=False,
                    )

print(response.choices[0].message.content)

First, I executed: base_url="http://127.0.0.1:8000/v1" Then, I executed: base_url="http://127.0.0.1:8001/v1" Found the second vllm service2. LMCache hit tokens = 0

Total tokens 368, Inference Engine computed tokens: 0, LMCache hit tokens: 0, need to load: 0 (vllm_v1_adapter.py:1327:lmcache.integration.vllm.vllm_v1_adapter)

Before submitting a new issue...

  • Make sure you already searched for relevant issues, and asked the chatbot living at the bottom right corner of the documentation page, which can answer lots of frequently asked questions.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

vllm - 💡(How to fix) Fix [Bug]: LMCache cache miss