What kvdiff can tell you about a vLLM prompt-cache miss
Start with unchanged requests to find where a prefix diverges, then test tool-schema rewriting separately if the evidence points to it.
kvdiff 0.1.0 is a local proxy for inspecting prompts on their way from a client to a model server. For a vLLM operator, it can help answer a narrow question: did a request change where you expected its prefix to stay stable? It reports the first differing UTF-8 byte and the corresponding JSON path. That is evidence about the request the proxy saw, not proof about which tokens vLLM cached or why it missed.
Start with pass-through
The versioned README shows how to start the proxy with npx kvdiff serve --port 4318 --upstream-local http://127.0.0.1:8080 and point an OpenAI-compatible client at http://127.0.0.1:4318/v1. Substitute your server’s address for the example upstream. Send two controlled requests with a prefix you expect to repeat. If the diff lands in the tool list, check whether the client reordered tools or changed a description. If it lands in the system prompt, look for a changing timestamp or status field. Check the result against what the serving backend reports before attributing a cache miss to the diff.
By default, the project says kvdiff forwards the raw request body and non-hop-by-hop headers unchanged, including authorization headers, and streams responses as they arrive. This makes the first run an observation rather than a rewrite.
Try rewriting only if order is the problem
The optional --heal mode sorts tool declarations and object keys within their schemas. The release notes say it does not reorder messages, input arrays or schema enum values. It changes what reaches the server, so treat it as a second experiment: replay the same workload with and without it, and compare cache behavior as well as client behavior. Reordering keys will not make a genuinely changing description or system prompt stable.
Local storage is not the same as local inference
The README says the proxy binds to 127.0.0.1 by default, stores traffic in ~/.kvdiff/kvdiff.db and sends no telemetry. Those are the project’s documented claims, not a privacy audit or a guarantee of field-level redaction. The proxy still sends request bodies and applicable headers to the configured upstream: a loopback vLLM endpoint stays on the host for that hop, but a cloud endpoint receives the forwarded request. Start with non-sensitive prompts and check the database’s contents, permissions and retention before capturing real traffic.
sources
- kvdiff 0.1.0 release notesgithub.com
- kvdiff v0.1.0 READMEgithub.com
comments · 0