Anthropic schreibt Messages API in Rust um und senkt CPU-Last um 70 Prozent
Nach rund 1800-fachem Traffic-Wachstum seit Anfang 2024 migrierte Anthropic die Messages API von Python zu Rust. Claude erstellte eine erste Version des Kern-Request-Pfads in etwa einer Woche, die Herausforderung lag in der Verifikation ueber Live-Traffic-Shadowing.

On 25 November 2026 Anthropic published the engineering post on migrating the Messages API from Python to Rust. Traffic had grown roughly 1,800× since early 2024. Claude wrote a first version of the core request path in about a week. The hard part was verification: shadowing live production traffic against the Python service, fixing divergences, and shipping without downtime. Result: ~70% less CPU per request, >80% less memory, and ~20% lower median time-to-first-token on Claude Code requests.
That is a clean infrastructure win. Lower CPU and memory per request means denser packing and less headroom pressure on the API tier. The TTFT improvement is real for agents that wait on a full model turn. It does not move the floor if the agent is also supposed to produce short, timely suggestions while a technical interview or sales call is happening live in another language on Windows.
A usable dual-track overlay still needs two clean PCM streams that stay separate:
Both must stay in shared-mode WASAPI so the call client keeps the device. Exclusive mode would break the call. The Windows Audio Engine ( audiodg.exe + audioeng.dll ) mixes, applies any enabled communications enhancements or vendor APOs, and delivers buffers on a fixed period. Typical shared-mode period is 10 ms; the engine often ignores smaller requests under load.
Rough additive budget once samples leave the callback (modern laptop, enhancements off):
Even if the translation or suggestion model itself returns usable text in a few hundred milliseconds, the capture period and the first partial still dominate the user-visible lag. A cloud API that now starts tokens 20% faster is fine for a backend orchestration loop; for a tight overlay that should show a short suggestion while the other person is still talking, you need the partials much earlier.
// Shared-mode capture client (mic or loopback). // Callback does nothing but copy into a lock-free SPSC ring. // Consumer thread owns resampling, VAD, and the STT or model call. HRESULT hr = pAudioClient -> Initialize ( AUDCLNT_SHAREMODE_SHARED, flags, // AUDCLNT_STREAMFLAGS_LOOPBACK for render endpoint hnsPeriod, // request 10 ms or smaller; engine may ignore 0, mixFormat, NULL ); // In the callback: // Copy GetBuffer samples into ring, ReleaseBuffer, return S_OK. // Zero allocations, zero model work on the audio thread. Enter fullscreen mode Exit fullscreen mode From the ring you can feed:
The Rust rewrite is useful if your local agent has a large set of suggestion templates or tool schemas and you want lower host cost or faster turnaround on the cloud side. It does not shrink the 10 ms period or the time until the first usable partial leaves the audio engine.
Anthropic’s migration shows that verification against live traffic is now the bottleneck once agents write the bulk of the code. For a dual-track overlay the equivalent bottleneck is still the audio path: get the two streams clean, keep the callback trivial, and measure the first partial end-to-end before you optimize the model.
I'm building Talkaside, a Windows app for job interviews and calls in another language. Drafted with AI assistance from this project's code and logs.