Introduce v1 runtime compatibility, modern serving profile, and MP startup path - #149
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: bdf27f491b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| timeout_s = max(0.1, float(self.cfg.first_key_timeout_s)) | ||
| quiet_period_s = max(0.0, float(self.cfg.quiet_period_s)) | ||
| poll_s = max(0.01, float(self.cfg.settle_wait_s)) | ||
| deadline = time.monotonic() + timeout_s |
There was a problem hiding this comment.
Allow the quiet period after the first key arrives
When asynchronous Redis writes produce their first key near first_key_timeout_s—for example at 29 seconds with the default 1.5-second quiet period—the same deadline also terminates stabilization at 30 seconds, so the build raises and deletes otherwise valid output before the key set can become quiet. The first-key deadline should stop applying once a key appears, with subsequent polling governed by the quiet period.
Useful? React with 👍 / 👎.
| # An explicit non-auto pattern is authoritative; SCAN already filtered it. | ||
| if scan_match != "*": | ||
| return key_set |
There was a problem hiding this comment.
Honor an explicitly requested wildcard match
When an operator explicitly passes --match '*' for debugging or a custom backend, scan_match is still "*", so this branch proceeds to profile classification and discards unrecognized keys (and legacy keys under v1) rather than returning everything matched by Redis. Check whether requested_match was explicitly supplied before applying automatic-discovery filtering so the existing CLI/debug workflow remains authoritative.
AGENTS.md reference: AGENTS.md:L255-L259
Useful? React with 👍 / 👎.
Purpose
Establish a long-lived
v1compatibility line without breaking the current CacheRoute deployment based on vLLM 0.13.x and LMCache 0.3.11.The codebase is not forked into two independent implementations. Version-dependent behavior is isolated behind runtime profiles and focused adapters so that migration work for vLLM 0.25.1 and LMCache 0.5.2 can continue while the legacy path remains runnable.
This PR consolidates the modern environment work previously staged in #150. The legacy image, root dependency profile, and current
mainbehavior remain unchanged.Runtime profiles
CACHEROUTE_RUNTIME_PROFILEselects the behavior:legacy: preserve the historicalvllm@*Redis-key namespace and old behavior.v1: use the modern model-scoped LMCache Redis-key layout and MP startup contract.auto(default outside the dedicated v1 image): recognize either key layout and keep old API/CLI callers compatible.Compatibility logic is centralized in
core/runtime_compat.py. Future version checks should be added there or in profile-specific adapters rather than scattered through Scheduler, Proxy, Instance, and KDN code.Isolated v1 serving environment
Add
env/docker/cu130/as an independent profile:13.0.0on Ubuntu 22.04;3.12in/opt/venv;2.11.0+cu130;0.26.0/2.11.0;0.25.1;0.5.2;Files:
env/docker/cu130/Dockerfileenv/docker/cu130/constraints.txtenv/docker/cu130/requirements-dev.txtenv/docker/cu130/README.mdenv/docker/cu130/scripts/start_lmcache_mp.shenv/docker/cu130/scripts/start_vllm_mp.shThe image sets
CACHEROUTE_RUNTIME_PROFILE=v1by default. It installs FFmpeg for TorchCodec and keeps Rust/Cargo and Tkinter for existing resource-agent/dashboard workflows.The profile is additive and does not modify:
env/docker/Dockerfile;requirements.txt;pyproject.toml;Versioned startup contract
The old and new serving commands are intentionally treated as different runtime interfaces.
Legacy:
LMCACHE_CONFIG_FILE;v1:
lmcache server;vllm servewithLMCacheMPConnectorin--kv-transfer-config;LMCACHE_CONFIG_FILE,remote_url, and--kv-offloading-backend lmcacheare not used.The validated startup order is:
Existing containers do not need to rebuild the Docker image. After switching to this branch, they can run:
The full equivalent commands and environment-variable overrides are documented in
env/docker/cu130/README.md. Both scripts passedbash -nsyntax validation.KDN compatibility changes
--matchfor normal KV construction.vllm@*value as a compatibility sentinel inautoandv1modes.kv_ready.run_meta.json.Backward compatibility
Strict legacy behavior remains available with:
export CACHEROUTE_RUNTIME_PROFILE=legacyModern deployments use the dedicated image or explicitly set:
export CACHEROUTE_RUNTIME_PROFILE=v1Generic deployments may retain:
export CACHEROUTE_RUNTIME_PROFILE=autoExisting CLI/API callers that still supply the old default
vllm@*remain compatible.Homepage entry plan
The repository homepage should present a version selector before the current Requirements and full-deployment sections, rather than mixing modern commands into the existing legacy walkthrough.
Proposed homepage block:
env/README.mdand the existing full single-machine walkthroughenv/docker/cu130/README.mdlegacy,v1, andautoprofilesdocs/runtime_compatibility_v1.mdThe homepage should also include a visible warning that startup commands cannot be mixed:
lmcache server+LMCacheMPConnector;CACHEROUTE_RUNTIME_PROFILE=v1, and use the repository scripts without rebuilding.The detailed legacy walkthrough should remain intact and be labeled Legacy stable full deployment. The modern homepage entry should stay concise and link to the dedicated v1 guide instead of duplicating its full commands.
Validation completed
Runtime compatibility tests:
KDN migration validation:
Modern environment validation inherited from the tested #150 profile:
3.12.13;2.11.0+cu130and CUDA runtime13.0;0.25.1;0.5.2;5.12.1;8.0.1;pip checkand serving-stack imports;Validation boundary
Byte-for-byte Redis dump/restore proves KDN storage integrity, but does not yet prove that an injected block is consumed as an LMCache MP hit. End-to-end validation must compare LMCache hit-token and remote-read metrics before this PR is considered complete.
Planned follow-up work
Review status
This PR contains the isolated modern environment, the validated MP startup interface, and the first KDN runtime migration slice. Full LMCache MP cache-consumption validation is still pending.