P.K. SHARMA

Cyber security intelligence, AI governance, practitioner analysis

OpenAI rewrote Habitat from Python to Rust. The important decision was waiting a year.

Two engineers working with Codex and GPT-5.5 rewrote a service that had handled more than 20 million requests per second. OpenAI reports 6× CPU and 15× memory efficiency, but its sequencing lesson matters more than the language contest.

By Parminder Kumar Sharma · · 3 min read

AI-generated engineering editorial image of one server module replacing another in a hyperscale data centre.

The rewrite followed interface and reliability work

OpenAI’s Habitat engineering account says the team deferred a Python rewrite for a year while it addressed more urgent platform constraints. At its peak, the Python service handled more than 20 million requests each second.

In the second quarter of 2026, two engineers working with Codex and GPT-5.5 rewrote the service in Rust. OpenAI says the Rust implementation now handles 95% of production requests and that Python is due for retirement. Its internal measurements show 6 times better CPU efficiency, 15 times better memory efficiency, and lower average and tail latency.

Those are vendor measurements from one production system, not a general benchmark proving that every Python service should move to Rust.

OpenAI Habitat rewrite summary showing Python peak traffic, Rust production share and reported efficiency improvements.
Original editorial visual by P.K. Sharma.

Habitat keeps the online path deliberately narrow

Habitat exposes a NoSQL interface built around client-defined objects and edges. Objects and their direct edges are colocated for horizontal partitioning, while broad graph traversal is intentionally inefficient. Complex querying moves to isolated Rockset instances through change data capture.

That separation protects the online Azure Cosmos DB path from analytical and search workloads. Product teams get simple bounded operations by default and take responsibility for scaling the secondary system when they need complex analysis.

The platform choices around the rewrite

ChoiceBenefitTrade-off
Bounded object and edge APIPredictable online queriesNo general graph traversal
Partition-local direct edgesHorizontal scaleRemote hops can be expensive
CDC to isolated RocksetProtects the serving pathExtra provisioning for client teams
Rust serviceLower measured resource useMigration and operational complexity

A rewrite should remove a measured constraint

The useful sequence is interfaces first, migration second. By delaying the language change, the team could stabilise load balancing, connection pooling, downstream protection and the client contract. Once CPU and memory became material constraints, the service boundary made a replacement easier to compare and roll out.

Teams considering a similar move should capture representative request mixes, tail latency, memory under pressure, failure behaviour and operational toil before changing languages. Run both implementations behind the same contract, compare them under production traffic and preserve a fast rollback route.

The position

The headline efficiency gains are striking, but the stronger engineering signal is restraint. Python carried Habitat through hypergrowth and more than 20 million requests per second. Rust arrived after the platform knew which problem the migration needed to solve.

OpenAI says the wider storage layer serves more than 500 petabytes and 70 million requests per second, with more detail promised in a second article. Until that appears, the rewrite should be read as one layer of the system rather than the explanation for its full scale.

Sources

  1. PrimaryRapidly scaling online storage to serve over 1 billion ChatGPT usersOpenAIaccessed 2026-09-13

Share this briefing

Know someone who owns this problem? Send it to them.

Related briefings

The briefing, in your inbox

Practitioner analysis of cyber and AI security news. No vendor noise.

One email per briefing. Unsubscribe any time.