CASE STUDYvLLM V1 · KV-cache schedulingActive · suite green on vLLM V1

AgentOS

A per-agent KV-cache and context resource-control plane over vLLM V1.

HEADLINE RESULT128tests passing · 84 CPU + 44 real-torch KV, validated on RTX A4000
ANIMATED RESEARCH CONCEPT · NOT A PERFORMANCE FIGURE
01 · PROBLEM

The problem

Serving stacks treat KV cache as one shared pool. Run twenty agents against it and there is no per-agent budget, no policy for whose blocks get evicted, and no way to pause an agent and resume it with its context intact. A background agent can quietly evict the cache of the one a user is waiting on.

02 · APPROACH

The approach

Treat each agent the way an operating system treats a process: live per-agent token and KV-block budgets, a selectable eviction policy, priority and preemption, and KV snapshot/restore so a preempted agent resumes instead of recomputing. Built on vLLM's dynamic KV connector plus a custom scheduler.

  1. 01
    Shared pool

    The default: anyone evicts anyone

  2. 02
    Per-agent budgets

    Token + KV-block quotas

  3. 03
    Eviction policy

    Evict inside low-priority allocations

  4. 04
    Preempt & restore

    KV snapshot instead of recompute

  5. 05
    Invariants

    84 CPU + 44 real-torch tests

An agent is a process. Its KV cache is memory the scheduler owns.

03 · THE HARD PART

What made it hard

Correctness of injected KV. Restoring blocks into a running engine is easy to make fast and very easy to make subtly wrong — a misaligned block yields plausible tokens from a corrupted past, which no throughput metric catches. The work went into invariants covered by 84 CPU tests and 44 real-torch KV tests.

04 · RESULTS & EVIDENCE

What it showed

Scheduler and snapshot paths are working against vLLM V1 with the test suite green. Runtime validated on an RTX A4000.

84CPU tests
44real-torch KV tests
vLLM V1custom scheduler + KV connector
A4000runtime validated on RTX A4000
FIGURES
================ GPU VERIFICATION ================
model: Qwen/Qwen2.5-0.5B-Instruct
[1] scheduler_cls loaded + generation ran: PASS  (planner=32, searcher=25 tokens)
[2] per-agent token metering: PASS  (planner charged=51, expected=51)
[3] hard budget cap (abort): PASS  (searcher charged=28/28, generated=25/64)
[+] VTC service difference: 2.0
==================================================
GPU verification run on an RTX A4000 with a real vLLM V1 engine (scripts/gpu_verify.py), as recorded in the repository's verification notes.

Simulated cache hit rate at frozen capacity

Deep tree · LRU
0.765
Deep tree · Belady (optimal)
0.809
Wide fanout · LRU
0.664
Wide fanout · Belady (optimal)
0.671
Long pause · LRU
0.699
Long pause · Belady (optimal)
0.818
Simulated cache hit rates at the frozen capacity, from the mock benchmark and not from a GPU run. On wide-fanout, LRU is within a point of the optimal Belady policy, so that workload cannot separate eviction policies.
05 · WHAT DIDN'T WORK

What didn't work

  • The first GPU baseline was not a baseline

    All nine profile and seed runs finished, but live KV events read zero because of a topic mismatch, stdout logs corrupted the JSON, and seeds 42 to 44 gave identical traces.

  • One workload cannot tell policies apart

    On wide-fanout, LRU scored 0.664 against 0.671 for Belady. Any policy looks about as good there, so a separation threshold of 2 points was set.

  • The core idea is not new

    Workflow-aware eviction exists as a concept. The contribution has to be a measured result, and live GPU numbers do not exist yet.

06 · EXPLORE THE WORK