Architecture
~8 min readUpdated: December 2026

InferScale: GPU-Native KV Injection & Chunked RoPE for vLLM Serving

InferScale GPU-native KV injection and Chunked RoPE architecture for vLLM serving in Smoke Monkey

InferScale colocates a GPU-native Jasper semantic vector index with a pre-RoPE key-value store to inject precomputed fact states directly into vLLM via its KV-connector interface. Across Llama-3.1-8B, Mistral-7B, Qwen2.5-7B, and Qwen3-14B on LoCoMo, InferScale cuts query-to-first-token latency by 1.7x-8.2x over Mem0 and delivers a 13.3x engine TTFT speedup at 400 retrieved facts.

Technical Review: Smoke Monkey Core Architecture Team
Tested on Node.js 18+ & BunTypeScript 5.x
Quick Answer & Executive Definition

InferScale: GPU-Native KV Injection & Chunked RoPE for vLLM Serving: InferScale colocates a GPU-native Jasper semantic vector index with a pre-RoPE key-value store to inject precomputed fact states directly into vLLM via its KV-connector interface. Across Llama-3.1-8B, Mistral-7B, Qwen2.5-7B, and Qwen3-14B on LoCoMo, InferScale cuts query-to-first-token latency by 1.7x-8.2x over Mem0 and delivers a 13.3x engine TTFT speedup at 400 retrieved facts. Designed as a zero-dependency, open-source TypeScript architecture under the MIT License with native Model Context Protocol (MCP) support and deterministic phase state machines.

Key Architectural Takeaways
Quick Implementation Exampleinferscale-vllm-memory-agent.ts
inferscale-vllm-memory-agent.tstypescript
import { createAgent } from '@smoke-monkey/harness';
// Orchestrate personalized agent memory against a vLLM InferScale KV-connector endpoint
const agent = createAgent({
agentId: 'inferscale-memory-agent',
provider: 'openai-compatible',
baseUrl: 'http://127.0.0.1:8000/v1',
model: 'meta-llama/Llama-3.1-8B-Instruct',
workspacePath: process.cwd(),
mcpServers: {
kvMemory: {
command: 'npx',
args: ['-y', '@smoke-monkey/mcp-kv-memory', '--backend', 'inferscale-jasper'],
env: {
INFERSCALE_CONTEXT_WINDOW: '50',
INFERSCALE_KV_MODE: 'gpu_resident',
VLLM_KV_CONNECTOR: 'InferScaleConnector',
},
},
},
permissions: {
read_file: 'allow',
write_file: 'ask',
run_command: 'ask',
},
});
async function main() {
const result = await agent.run(
'Retrieve top-50 user facts via GPU Jasper index, inject rotated KV blocks, and verify TTFT under 60ms.'
);
console.log('Agent Summary:', result.summary);
}
main().catch(console.error);
Video Guides

Watch: Related Video Guides

How KV Cache Speeds Up LLMs for Faster AI Models on GPUs

How the vLLM inference engine works?

What Is InferScale and Why Does Prefix Caching Fail Personalized Agents?

InferScale (arXiv:2607.27090) is a GPU-native memory serving system that pairs a colocated Jasper vector index with a persistent pre-RoPE key-value store to inject retrieved conversation facts directly into vLLM's attention cache. By eliminating serving-time fact prefill, InferScale achieves 1.7x-8.2x query-to-first-token (QTFT) speedups over Mem0 across 7B-14B models.

Standard prefix caching in vLLM or SGLang requires an identical leading token sequence. In personalized RAG and long-term agent memory, each request retrieves a dynamic subset and permutation of facts, invalidating prefix hashes and forcing quadratic prefill recomputation (O((m+q)^2)) on every turn.

Model (LoCoMo Benchmark)InferScale vs Mem0 (k=50)InferScale vs Mem0 (k=400)InferScale vs Jasper+PI (k=400)InferScale Host-KV Engine TTFT (k=50)
Llama-3.1-8B2.1x faster QTFT3.0x faster QTFT2.5x faster QTFT19.68 ms (vs 88.91 ms CacheBlend)
Mistral-7B-v0.32.2x faster QTFT5.7x faster QTFT5.5x faster QTFT19.33 ms (vs 90.61 ms CacheBlend)
Qwen2.5-7B1.7x faster QTFT3.9x faster QTFT3.5x faster QTFT19.30 ms (vs 88.40 ms CacheBlend)
Qwen3-14B2.1x faster QTFT8.2x faster QTFT8.3x faster QTFT30.77 ms (vs 120.97 ms CacheBlend)

How Context-Window Encoding and Chunked RoPE Preserve Accuracy

Encoding extracted facts in isolation (w = 0) strips pronouns and antecedent context, dropping Mistral-7B accuracy on LoCoMo from 64.35% down to 37.22%. InferScale resolves this offline and online through two mechanisms:

  1. Context-Window Encoding (w preceding turns): During offline ingestion, InferScale prepends up to w = 50 preceding conversation turns before the target fact during prefill, then retains only the fact tokens' pre-RoPE keys and values while discarding the window states. Stored KV size depends strictly on the fact's token length, lifting LoCoMo accuracy at k = 50 to 60.26% on Llama-3.1-8B (vs 63.25% Mem0) and 58.30% on Mistral-7B.
  2. Positional Composition via Chunked RoPE: Because rotary embeddings encode relative offset via (R_a q)^T (R_b k) = q^T R_{b-a} k, InferScale stores pre-RoPE keys k_pre and applies k_serve = R_p k_pre at serving time for contiguous offset b_i = s + sum_{j<i} c_j, bypassing cross-fact recomputation completely.
  3. GPU-Resident vs Host-Pinned Placement: For Llama-3.1-8B on LoCoMo, per-conversation persistent Fact KVs require 5,225.97 MB alongside a 13.50 MB Jasper graph. Keeping Fact KVs in pinned host DRAM drops VRAM pressure while still beating CacheBlend's 15% recomputation path (92.70 ms vs 128.88 ms QTFT).

Memory-Budget Rule for Pre-RoPE KV Caching

Calculate persistent fact storage using S_fact = 2 * L * c * h_kv * d * b bytes. Models with aggressive Grouped-Query Attention (such as Mistral-7B at 2,410 MB per LoCoMo conversation vs Llama-3.1-8B at 5,226 MB) double your GPU-resident fact capacity.

Reproducible KV Capacity & Latency Profiling Script

Before deploying pre-RoPE fact injection on single-GPU or multi-GPU vLLM workers, calculate exact memory capacity and verify vLLM KV-connector readiness locally:

bash
# Compute persistent pre-RoPE fact storage footprint for Llama-3.1-8B vs Qwen2.5-7B
python3 - << 'EOF'
configs = [
    ("Llama-3.1-8B (BF16)", 32, 8, 128, 2),
    ("Qwen2.5-7B (BF16)",   28, 4, 128, 2),
    ("Qwen3-14B (BF16)",    40, 8, 128, 2),
]
tokens_per_fact = 32
facts_stored = 10000
for name, L, h_kv, d, bytes_per_elem in configs:
    per_fact_kb = (2 * L * tokens_per_fact * h_kv * d * bytes_per_elem) / 1024
    total_gb = (per_fact_kb * facts_stored) / (1024 * 1024)
    print(f"{name:22s} | {per_fact_kb:7.1f} KiB/fact | 10k facts = {total_gb:.2f} GB")
EOF
Google Search Questions & Answers

Frequently Asked Questions

Q:Does InferScale require modifying vLLM attention kernels or fine-tuning the LLM?

No. InferScale integrates through vLLM's standard KV-connector interface using the unmodified serving model weights for both offline Context-Window Encoding and online serving.

Q:Why does InferScale store keys before RoPE instead of post-RoPE keys?

Post-RoPE keys bake in fixed absolute token positions from offline encoding. Storing pre-RoPE keys allows Chunked RoPE to rotate each retrieved fact into contiguous serving positions dynamically on the GPU.

Q:How fast is InferScale when scaling retrieved facts from 5 to 400?

On Llama-3.1-8B, engine time-to-first-token increases only from 16 ms (5 facts) to 25 ms (400 facts), yielding a 13.3x speedup over Mem0's 327 ms engine TTFT.

Q:What happens if precomputed fact KV states exceed available GPU VRAM?

InferScale supports a host-resident mode that keeps the lightweight 13.5 MB Jasper semantic index and fact-ID map on GPU while storing pre-RoPE Fact KVs in pinned host DRAM and transferring only top-k facts over PCIe.

Related Alternatives & Comparisons

Related Architecture Guides

View all guides

Build with Smoke Monkey Harness

Zero dependencies. 24 built-in tools. Human-in-the-loop safety. 100% open source under the MIT License.

npm install smoke-monkey-harness