Context-aware LoRA adapter routing for VS Code
LoRA-JIT is an open, local-first orchestration layer that watches your editor, routes intent to the right domain-specific LoRA adapter, pages adapters in and out of GPU memory, and generates completions — with measurable routing accuracy and latency at every step.
General-purpose code models are mediocre at everything and excellent at nothing. Domain specialists (SQL, React, FastAPI, AWS SDK) are better — but only if you can select the right one fast enough to feel instant.
Today, most developers either:
LoRA-JIT closes the gap: automatic adapter routing from live editor signals, with a benchmark harness to prove it works before you ship completions.
Editor telemetry → Intent classification → Adapter paging → GPU activation → Token generation
| Layer | Responsibility |
|---|---|
| VS Code extension | Streams cursor, text, and symbol events; surfaces routing decisions in the status bar |
| Control plane (FastAPI) | Buffers telemetry, runs the router, manages paging state, records traces |
| Runtime | MockRuntime (default, CI-safe) or PyTorchPeftRuntime (real LoRA hot-swap) |
| Benchmark harness | Replay traces, compare predictors, train a lightweight learned router |
Every routing decision exposes: adapter ID, confidence, paging status (warm_hit / cold_miss), activation latency, and generation latency.
Be honest when evaluating or adopting:
| Expectation | Reality today |
|---|---|
| Copilot-speed inline ghost text | Completions are logged to the output channel, not inserted inline |
| Works out of the box with trained adapters | Only sql_postgres has a full training recipe; other ontology adapters are registry entries |
| One-click VS Code Marketplace install | Extension runs via Extension Development Host (F5) |
| Real GPU VRAM paging | Paging is a simulator with LRU eviction; activation latency is real, VRAM telemetry is not |
| Sub-100 ms generation on laptop GPU | 40-token generation on RTX 3050 6 GB is ~7.5 s with Qwen1.5-0.5B |
LoRA-JIT is best understood as routing infrastructure with observability, not a finished consumer coding assistant.
Strong fit:
Weak fit (for now):
127.0.0.1 only)top1_accuracy, cache_miss_rate), not assumedRTX 3050 6 GB laptop, Qwen/Qwen1.5-0.5B + sql_postgres LoRA:
| Metric | Value |
|---|---|
| Cold route (no preload) | ~6 700 ms |
| Warm route (preload enabled) | ~6 ms |
| Subsequent warm routes | 6 – 20 ms |
| 40-token generation | ~7 500 ms |
| Router confidence on SQL files | ~99 % |
| Test suite | 48 / 48 passing |
See BENCHMARK.md for methodology.