Urgent.News

What's breaking now, across hundreds of outlets.

AI

Anthropic Says Claude Helped Rebuild Its API in Rust, Cutting CPU Use by 70%

Anthropic says Claude helped migrate its Messages API from Python to Rust, cutting CPU use by 70%. But getting the AI-generated code ready for production took months of testing and human review.

Anthropic reported significant performance improvements after migrating its Messages API from Python to Rust, resulting in a 70% reduction in CPU use and a 20% reduction in median time to first token. The AI model Claude played a crucial role in helping rebuild the API request path, initially producing a working implementation in about a week and eventually writing over 80% of the code within months of testing and human review.

While the performance gains were substantial, proving that the code behaves correctly under real-world conditions proved to be a challenging task.

The Messages API handles requests from Anthropic's customers and products like Claude Code and Cowork, experiencing a growth in traffic by roughly 1,800 times between early 2024 and fall 2026. The initial Python implementation proved costly to run, and Anthropic initially tried replacing only the code that processed model output with Rust, achieving an 8-10% reduction in CPU usage.

However, a hybrid design introduced issues such as three-way communication between Python and Rust, adding complexity and overhead. To overcome these challenges, Anthropic decided to rebuild the entire request path using Rust, a language known for its low-level performance and memory-safety features.

Claude aided the migration process, producing an initial working implementation of the core request path in roughly a week. By May 2026, Claude was generating more than 80% of the code merged across the company. Despite these achievements, Anthropic's measurements of performance improvements have different scopes, with CPU results coming from one region and the response-time improvement measured using Claude Code requests over a shorter period.

Additionally, the migration required careful consideration and testing to ensure the new Rust API matched the functionality of the Python version, including handling character encoding differences and numerous integration tests.

Rewritten by urgent.news; may contain errors — check the original.

Source: techrepublic.com

Read the original at techrepublic.com →

More from TechRepublic on urgent.news

Report a problem with this story

Get the day's news by email. Daily, weekly or monthly. Sign up

More in AI

Banks look to dump AI debt

Banks including Citi and JPMorgan are marketing portfolios of loans to manage risk or, in some cases, ready themselves to take on even more.

More from Thursday, 26 November 2026 →