This document records major engineering milestones for the CacheRoute prototype. Detailed debugging notes, implementation discussions, review comments, and task ownership should be tracked in GitHub Issues and Pull Requests.
- Newer entries are listed first.
- Each entry uses a consistent structure: context, changes, validation, follow-ups, and owner.
- This file is a curated engineering log, not a replacement for component-level READMEs.
- For runnable commands and current usage, prefer the README closest to the relevant component.
- Added a typed Instance capability contract with deterministic fingerprints, structured compatibility results, and registration/heartbeat propagation for future KVCache reuse decisions.
- Established
legacy,v1, andautoruntime profiles and an isolated CUDA 13 / PyTorch 2.11 / vLLM 0.25.1 / LMCache 0.5.2 serving environment without breaking the legacy deployment path. - Completed the modern KDN round-trip validation: 96 Redis keys and 1,006,632,960 payload bytes were restored without mismatches, LMCache loaded 96/96 chunks, and vLLM reused 3,072 externally cached tokens with a 100% token hit rate.
- Added immutable KDN v1 domain snapshots plus versioned Cache Service and LMCache Gateway contracts, including capability negotiation, deterministic CPU-only mocks, Legacy isolation, and contract-focused tests.
- Established the canonical
src/cacheroutenamespace and an architecture RFC defining package responsibilities, integration boundaries, dependency direction, migration rules, and public API policy.
core/instance_capability.pyinstance/capability_builder.pycore/runtime_compat.pyenv/docker/cu130/scripts/validate_v1_kdn_roundtrip.pydocs/quickstart_v1.mddocs/v1_migration_closeout.mdkdn_server/domain/kdn_server/contracts/kdn_server/gateway/src/cacheroute/doc/architecture/AGENTS.md
Owner: yao
- Reworked the container and deployment guides around a reproducible
/llm-stackworkflow, modern NVIDIA Container Toolkit setup, headless/Tkinter separation, and a complete single-machine startup runbook. - Declared a compatible
redis-pydependency to prevent legacy Redis client import failures in the KDN KV builder. - Added a shared multiline curl-like command parser for the CLI and browser client, including URL-first and standard curl forms, line continuations, clearer quote errors, and regression tests.
- Integrated optional Resource Dashboard startup into
demo_instance.pywith readiness/reuse checks, browser launch control, process ownership and cleanup, focused tests, and updated Instance documentation.
README.mdenv/README.mdenv/docker/Dockerfilerequirements.txtclient/command_input.pyclient/repl.pyUI/client_ui/test/demo_instance.pyinstance/instance_api.pyinstance/resource_dashboard/
Owner: yao
- Added per-Instance predicted pressure from queue reservations and timelines, including pending Prefill work, active Decode work, slot readiness, Prefill availability, and estimated backlog time.
- Extended
least_loadscoring and/debug/instance_loadsto use the same predictive pressure snapshot while preserving instantaneous, inflight-only, and round-robin fallback behavior. - Upgraded the Proxy topology to a deterministic force-relaxed layout with stable positions, curved links, particles, hover relationships, drag/pan/zoom controls, fit/reset actions, and reduced-motion support.
- Expanded pure-function tests for scheduling pressure, topology determinism, bounds, collisions, link geometry, tooltips, and interaction helpers.
proxy/queue/manager.pyproxy/strategy/least_load.pyproxy/proxy.pyproxy/resource/instance_pool.pyUI/proxy_ui/static/UI/proxy_ui/test_proxy_ui_pure.js
Owner: yao
- Added Proxy-maintained per-Instance
inflightlifecycle counters and/debug/instance_loadsfor consistent load-aware selection and diagnostics. - Extended
least_loadscoring with active prepare/ready work and prepare/ready queue depths, while preserving unknown-metric handling and round-robin fallback semantics. - Rebuilt the Proxy UI topology as a responsive ONOS-style SVG and added a visual Instance detail dashboard with KPIs, resource bars, GPU/memory charts, queue/load views, accessibility, and raw-data diagnostics.
- Added an LMCache configuration reference and simplified README request examples for lightweight validation.
proxy/strategy/least_load.pyproxy/proxy.pyproxy/resource/instance_pool.pyproxy/resource/p_control_plane.pyUI/proxy_ui/doc/LMCache_config_para.mdREADME.mdclient/README.md
Owner: yao
- Added an experimental
least_loadProxy Instance selection strategy usingload.inflightas the primary signal andload.qps_1mas a fallback. - Preserved unknown metrics as unknown and fall back to round-robin when no usable load information is available.
- Added round-robin tie-breaking and strategy aliases without changing the default
round_robinbehavior. - Documented CLI and environment configuration for reproducible load-aware scheduling experiments.
proxy/strategy/least_load.pyproxy/strategy/factory.pyproxy/README.md
Owner: yao
- Added compact Proxy
pool_resourceaggregation and reporting to Scheduler registration and heartbeat flows. - Added Scheduler-side storage and debug APIs for Proxy resource state, including liveness, freshness, utilization, load, and admission summaries.
- Defined null-vs-zero semantics, metric provenance and quality fields, and coarse prepare/ready queue-pressure reporting.
- Added a required PR template and Codex branch-hygiene workflow to keep generated changes scoped and reviewable.
proxy/resource/instance_pool.pyproxy/resource/p_control_plane.pyproxy/queue/scheduler/resource/doc/pool_resource_metrics.md.github/PULL_REQUEST_TEMPLATE.mddoc/codex_workflow.md
Owner: yao
- Added a browser-based Proxy observability UI with Instance status, resource snapshots, topology state, and a compact
/debug/statusAPI. - Integrated Proxy UI startup and cleanup into
test/demo_proxy.py, and documented frontend entry URLs. - Expanded TTFT/TPOT predictor documentation and improved request, tokenizer, prompt-generation, and non-blocking warmup workflows.
- Standardized English comments, docstrings, logs, and README content across the main CacheRoute modules.
UI/proxy_ui/proxy/resource/p_control_plane.pytest/demo_proxy.pyinstance/TTFT_predictor/instance/TPOT_predictor/- project source comments and READMEs
Owner: yao
The goal of this milestone was to move Instance resource monitoring from a manual flow to a demo-ready flow. Before this work, users needed to start the Rust Resource Agent manually and optionally run a separate reporter. After this milestone, test/demo_instance.py can own the Resource Agent lifecycle and report resource snapshots to the Proxy after Instance registration.
test/demo_instance.pyenables resource monitoring by default for demos.- The demo Instance explicitly owns the Rust Resource Agent lifecycle:
- feature flag resolution;
- process startup or reuse;
/healthzreadiness checks;- periodic snapshot reporting;
- shutdown cleanup;
- process-group
SIGTERM/SIGKILLfallback.
- Resource reporting starts only after Instance registration with the Proxy succeeds, avoiding repeated
unknown_instancereports. instance/resource_agent/proxy_reporter.pyadds report metadata:reported_instance_id;report_monotonic_ms;report_wall_time_ms;agent_snapshot_timestamp_ms.
- Proxy
InstancePool.resourcenow stores normalized CPU, memory, GPU, network, admission-state, and timestamp fields. - Proxy resource inspection APIs are documented and available:
GET /debug/instance_resources;GET /v1/instance/list?include_dead=true.
- Proxy resource snapshot success logs are reduced: the first successful report remains
INFO, repeated successful updates move toDEBUG. test/demo_resource_monitor_e2e.pywas added to start Proxy + Instance, wait for several resource reports, terminate the Instance, and verify that the demo-owned Resource Agent is cleaned up.test/README.mdwas added to explain the purpose of demo and test scripts undertest/.
Start Proxy:
cd test
python3 demo_proxy.py \
--host 127.0.0.1 \
--port 8001 \
--strategy round_robin \
--injection-strategy iwsStart Instance:
cd test
python3 demo_instance.py \
--host 127.0.0.1 \
--port 9001 \
--proxy-cp-url http://127.0.0.1:8002Inspect resource state from the Proxy control plane:
curl -sS "http://127.0.0.1:8002/debug/instance_resources" | python3 -m json.tool
curl -sS "http://127.0.0.1:8002/v1/instance/list?include_dead=true" | python3 -m json.toolInspect the Rust Resource Agent directly:
curl -sS http://127.0.0.1:9201/healthz
curl -sS http://127.0.0.1:9201/v1/resource/snapshot | python3 -m json.toolRun the e2e smoke script with a non-default agent port:
python3 test/demo_resource_monitor_e2e.py \
--agent-listen 127.0.0.1:19201 \
--agent-url http://127.0.0.1:19201Issue #86 is functionally complete. The demo Instance can start or reuse a Resource Agent, register with the Proxy, report resource snapshots after registration, and expose the resource state through Proxy APIs.
The resource state is still observational. Proxy Instance selection does not yet use resource fields.
- Design resource-aware Instance selection using
InstancePool.resource. - Add finer-grained Instance metrics, such as queue state, KVCache block residency, and vLLM runtime state.
- Replace
nvidia-smipolling with a lower-overhead GPU collection path. - Continue improving the Resource Dashboard UI for multi-GPU machines.
Owner: yao
The global knowledge-injection Scheduler has a working prototype. The local resource-pool layer has focused mainly on dynamic knowledge-injection decisions. The Instance selection layer still needs to be organized and extended.
- Resource-pool-level Instance scheduling.
- Use the Rust Resource Agent to observe and manage Instance resources.
- Report Instance resource snapshots to Proxy through API or gRPC.
- Let Proxy maintain Instance resource and KVCache state, then report useful summaries to KDN / Scheduler when needed.
- KDN Server improvements.
- The current KDN Server supports knowledge registration, query, and feedback.
- A future KDN control plane should maintain knowledge resources more precisely and support KVCache placement strategy.
Owner: yao
- Investigated why LMCache keys could not be reused across container cycles.
- Confirmed that
Today-Dateinformation in the chat template changes the chunk hash and invalidates KVCache prefixes. - Extended
perf_client.pywith hybrid-modeInjection_typesupport to test mixed injection strategies. - Improved the KDN Server network model:
- requests inside one batch can run concurrently;
- bandwidth is shared within a batch;
- batches are transferred sequentially;
- batch window and related variables are configurable.
model/tokenizer_config.jsonclient/perf_client.pykdn_server/kv_injector.pykdn_server/kdn_api.pytest/demo_kdn.py
- Build a readable KDN UI.
- Build an Instance-side resource inspection platform.
- Maintain pool-level business flow state with dual inflight accounting.
- Update the knowledge manifest with live LLM-system state.
Owner: yao
- Added task timestamp display to the client.
- Extended
perf_client.pyand simplifiedworkload.json. - Added
client/taskset/for batch task JSON generation. - Added RPS mode to
perf_client.pyfor continuous load tests and performance curve experiments.
client/taskset/client/client.pyclient/perf_client.py
Owner: yao
- Added batch knowledge-text registration from JSON files to initialize a KDN knowledge base.
- Improved KDN CLI output so users can inspect overall resource-pool state.
kdn_server/util/knowledge_manifest.jsonkdn_server/util/batch_register_kdn.pykdn_server/kdn_api.pykdn_server/kdn_register_cli.pykdn_server/text_db.py
Owner: yao
- Upgraded the previous serial
prepare-readyflow to a queue plus prepare concurrency model. - Added dispatchers and multiple prepare workers for each Instance.
- Added task timing anchors in epoch milliseconds.
- Added
cacheroute_metato chat / completion results for performance tracing. - Added
perf_client.pyandworkload.jsonfor continuous load generation. - Supported forwarding
Injection_typeas a temporary strategy-control field while Proxy policies were still evolving. - Continued LMCache key reuse investigation.
python3 perf_client.py \
--base-url http://127.0.0.1:7001 \
--workload-file workload.json \
--requests 2 \
--concurrency 8 \
--allow-duplicate \
--seed 7proxy/queue/__init__.pyproxy/queue/task.pyproxy/queue/manager.pyproxy/queue/knowledge.pyproxy/queue/instance_queues.pyclient/perf_client.pyworkload.jsoncore/request.pyscheduler/scheduler.pyproxy/proxy.py
Owner: yao
- Implemented KVCache-based knowledge injection.
- When
Injection_type=kvcache, Proxy first classifies and prepares text knowledge, then asks the selected Instance to inject KVCache into local Redis. - Proxy waits for the Instance ACK before moving the task into the ready queue.
proxy.managerclassifies knowledge needs intokv_ready,text_only, andmiss.- Built the Proxy -> Instance -> KDN Server KV injection subpath.
- Integrated concrete KVCache injection messages and reuse behavior.
instance/kv_service.pyinstance/control_plane.pyproxy/queue/task.pyproxy/queue/manager.pyproxy/queue/knowledge.pyinstance/instance_api.pycore/config.pykdn_server/kdn_api.py
Owner: yao
- Connected text injection and KVCache injection under a common task flow.
- Added
Injection_typeto mark the intended knowledge injection mode. - Moved Proxy handler logic from direct
forward_request(...)to the queue module. - Added per-Instance
prepareandreadyqueues. - Moved knowledge injection work into prepare-queue workers.
- Ready-queue workers forward requests to Instances and return outputs through task response queues.
proxy/queue/__init__.pyproxy/queue/task.pyproxy/queue/manager.pyproxy/queue/knowledge.pyproxy/queue/instance_queues.pycore/request.pyscheduler/scheduler.pyproxy/proxy.py
Owner: yao
- Scheduler heartbeat logs were converted into periodic summaries.
- Proxy heartbeat logs were converted into periodic summaries.
- This reduced terminal noise during long-running experiments.
scheduler/resource/hb_log.pyproxy/resource/hb_log.pycore/config.pyscheduler/scheduler.pyscheduler/resource/control_plane.pyscheduler/knowledge/kdn_sync.pyproxy/proxy.py
Owner: yao
- Proxy registration now reports static capability fields, such as max capacity, Instance count, KVCache memory capacity, and KVCache update policy.
- Scheduler maintains Proxy inflight state with an event-driven stream lifecycle and low-frequency Proxy heartbeat calibration.
- This hybrid design reduces accounting overhead while preventing long-term inflight drift.
core/request.pycore/config.pyscheduler/scheduler.pyscheduler/scheduler_cli.pyscheduler/resource/control_plane.pyscheduler/resource/proxy_pool.pyproxy/proxy.pyproxy/sclient/scheduler_client.py
Owner: yao
scheduler_clistatus can display KDN resource-pool state.- KDN refresh was changed to build a new table first and then swap it in, reducing concurrency issues.
- KDN selection strategy was integrated into the Scheduler strategy layer.
- KDN refresh now runs immediately after successful KDN registration.
core/request.pyscheduler/scheduler.pyscheduler/scheduler_cli.pyscheduler/resource/control_plane.pyscheduler/knowledge/kdn_sync.pyscheduler/strategy/base.pyscheduler/strategy/round_robin.pystore/knowledge_base.py
Owner: yao
- Proxy strategies can now operate on the Instance pool instead of using a hardcoded default.
- Proxy initialization supports strategy loading.
- Scheduler builds a KDN pool and initializes its knowledge manifest from registered KDN servers.
- The startup order was clarified:
1. Start Scheduler. It maintains proxy_pool and kdn_pool and exposes control plane 7002.
2. Start KDN and Proxy. They register with the Scheduler control plane and heartbeat.
3. Start Instance. It binds to a vLLM backend, probes resources, and registers with the local Proxy.
core/config.pyscheduler/scheduler.pyscheduler/resource/control_plane.pyscheduler/knowledge/kdn_sync.pyscheduler/resource/kdn_pool.pykdn_server/sclient/scheduler_client.pyproxy/proxy_cli.pyproxy/README.mdtest/demo_kdn.pyREADME.mdproxy/strategy/base.pyproxy/strategy/factory.pyproxy/strategy/round_robin.py
Owner: yao
- Added Proxy CLI support for inspecting Proxy status and the Instance pool.
- Updated Proxy README with usage information.
proxy/proxy_cli.pyproxy/README.md
Owner: yao
- Instances can run on multiple ports, reducing Proxy registration overwrites in multi-Instance demos.
- Proxy and Instance interaction logs were improved.
proxy/resource/p_control_plane.pyinstance/instance_api.pytest/demo_instance.py
Owner: yao
- Implemented the Proxy control plane with FastAPI on default port
8002. - Added
InstancePoolto maintain Instance static state, load fields, andlast_seentimestamps. - Proxy lifespan now creates and starts the InstancePool-backed control plane.
- Instance supports Proxy register / heartbeat / unregister.
proxy/proxy.pycore/config.pyinstance/instance_api.pytest/demo_instance.pyproxy/resource/instance_pool.pyproxy/resource/p_control_plane.pyinstance/pclient/proxy_client.py
Owner: yao
- Proxy registers with Scheduler during startup, heartbeats periodically, and unregisters on exit.
- Added
proxy/sclientfor Scheduler control-plane communication. - Added
proxy/metricsas a placeholder for later local resource aggregation. - Clarified the Proxy dual-plane structure:
- service plane: default
8001; - control plane: default
8002.
- service plane: default
proxy/proxy.pycore/config.pyproxy/sclient/scheduler_client.pyproxy/metrics/local_metrics.py
Owner: yao
- Added a Scheduler-side Proxy pool with static and dynamic fields.
- Scheduler now starts a service plane, resource pool, and control plane.
- Implemented a round-robin scheduling strategy.
- Added
--strategytodemo_scheduler.py. - Moved scheduling decision flow into
Request.build_request. - Expanded Scheduler CLI functionality.
core/config.pycore/request.pyscheduler/resource/control_plane.pyscheduler/scheduler.pyscheduler/scheduler_cli.pytest/demo_scheduler.pyscheduler/resource/proxy_pool.pyscheduler/strategy/base.pyscheduler/strategy/factory.pyscheduler/strategy/round_robin.py
Owner: yao
- Updated
env/README.mdwith vLLM + LMCache image build steps. - Added startup scripts for container and multi-terminal testing.
- Moved
demo_scheduler.pylocal config parameters intocore/config.py. - Reorganized Scheduler directories around
knowledgeandresource. - Added Scheduler control-plane APIs for Proxy interaction and resource synchronization.
env/README.mdcore/config.pytest/demo_scheduler.pyscheduler/scheduler.pytest/quick_start_docker.shscheduler/resource/control_plane.py
Owners: chen, yao
- KDN
/search/textsupports field-level responses. - KDN
/snapshotreturns full knowledge-base state. - Scheduler initializes its knowledge manifest from KDN snapshots instead of a local YAML-only preset.
knowledge_basesupports SHA256-to-int64 mapping for FAISS lookup compatibility.- Scheduler CLI was improved.
- Scheduler supports dynamic KDN knowledge synchronization with a two-stage incremental refresh.
kdn_server/text_db.pykdn_server/kdn_api.pyscheduler/__init__.pyscheduler/scheduler.pyscheduler/kdn_client.pyscheduler/scheduler_clistore/knowledge_base.pycore/request.pyproxy/proxy.pytest/demo_scheduler.pyscheduler/kdn_sync.py
Owner: yao
- Added
kv_builderstate fields so text blocks can indicate whether KVCache has been built. - Extended SQLite schema with KV metadata and backfilled it after KV build completion.
- Integrated text and KVCache registration/query operations into
kdn_register_cli.py.
kdn_server/text_db.pykdn_server/kdn_api.pykdn_server/kv_builder.pykdn_server/kdn_register_cli.pyscheduler/kdn_client.py
Owner: yao
- Standardized KDN knowledge-block storage and naming.
- Generated unique IDs from text hashes.
- Added SQLite indexing.
- Built a KVCache store that can persist CacheGen-compressed KVCache from Redis.
- Implemented KVCache reinjection into Redis.
- Maintained the KDN Server README.
test/demo_kdn.pykdn_server/kdn_api.pykdn_server/text_db.pykdn_server/kdn_register_cli.pykdn_server/kv_builder.pykdn_server/kv_injector.pyutil/kdn_build_kv.py
Owner: yao
- Improved streaming display in
client.py. - Fixed Proxy knowledge injection behavior for chat and completion modes.
client/client.pyproxy/proxy.py
Owner: yao