← Driving RustL2 · When Rust, When Not
Score 0
1/7 Judge the agent

The 800 ms endpoint

Chatboting’s answer endpoint has a p99 of 800 ms. Your agent has a proposal. You believe Rust is useful in a wide variety of projects. Make your move.

the designL2·1
clientFastAPIanswer()Postgrespgvector searchOpenAIreplywhere the 800 ms go (scenario numbers)
The agent says

Python is the bottleneck at this latency. I propose rewriting the answer service in Rust with axum and sqlx, keeping the Postgres schema. Rust services typically serve this kind of endpoint in single-digit milliseconds.

2/7 Two designs — pick one

Two workloads, one Rust

Two components from your own projects. Only one of them wants Rust. Pick it and say why.

the designL2·2
A · chatboting webhook handlerreceivevalidatewritePostgrescall LLMreplyB · VoiceKit audio path, one 20 ms frameG.711decodeVADresampleto STTdeadline: 20 ms per frame, a miss is an audible glitch
3/7 Find the flaw

Five reasons, one is not

Your agent listed five reasons to introduce Rust into a project. Four are real decision drivers. Tap the one that is not.

the designL2·3
a latency floorPython cannot reacha memory ceilingconcurrency you cannotafford to get wronga binary shipped tosomeone else’s machinethe team is excitedto learn Rust

Tap the part that will not survive contact with reality — or press 15.

4/7 Two designs — pick one

Which 200 lines?

Chatboting’s ingest is slow: scrape, chunk, tokenise, embed, store. The profile says chunking and tokenising take 70% of CPU time (scenario). Two ways to fix it.

the designL2·4
A · write the chunker + tokeniser as a PyO3 extensioncalendaringest speedB · use the Rust already shipped as a Python library, batch the callscalendaringest speed
5/7 Judge the agent

Rust for the MIDI bridge

Qualcomm demo: voice → local LLM → MIDI into Cubase, on a 16 GB Snapdragon laptop. Your agent wants the MIDI bridge in Rust. Judge it.

the designL2·5
16 GB laptop — who uses the memory (from your project note)LLMDAW + VSTsOSwhisper.cppMIDI bridge (Python)latency per voice instructionLLM inferenceMIDI bridge
The agent says

The bridge from LLM output to Cubase should be Rust: MIDI is real-time, and we are tight on the 16 GB budget, so a Rust process with no runtime keeps memory low. Python would add latency and a garbage collector.

6/7 Put it in order

Before you say yes

An agent proposes Rust for a component. Put the steps in the order you want followed before the answer is yes. Then run a proposal through the pipeline.

the pipelineL2·6
Rust?123456
    Level 2 cleared

    What survives this level

    waits on IO · CRUD · glue · LLM calls · webhooks · admin the band hot loop · deadline · memory ceiling Python · TypeScript · a better query concurrency correctness · shipped binary · embedded CPU share of wall time → profile before any of this: the profiler already Rust under your Python: tokenizers · tiktoken · pydantic-core · orjson · polars · ruff borrow it before you write it carve ≤ 1,000 lines someone named maintains it
    You can now say to a coding agent“Show me the profile first. If the hot spot is under a thousand lines and no crate already covers it, we carve out exactly that and nothing else.”
    Added to your ledger
    The band: when a project wants a Rust elementRust for a compute loop with a deadline, a memory ceiling, correctness-critical concurrency, or a binary shipped elsewhere; the profile decides, never the feeling.
    Rust already in your Python stackBefore writing Rust, name the Rust-backed library (tokenizers, pydantic-core, polars, orjson) that already covers it and say why it does not.
    The anti-cases: IO-bound services, résumé-driven Rust, no maintainerIf the reason names the team rather than a constraint of the system, or nobody is named to maintain it, it is a side project.

    Back to the map Next: L3 The Shape of a Good Rust Codebase →

    What clearing this level buys you
    “Show me the profile first. If the hot spot is under a thousand lines and no crate already covers it, we carve out exactly that and nothing else.”