
Anthropic 将其 Messages API 从 Python 迁移至 Rust,Claude 智能体编写并修复了大部分代码。由于测试不可靠,公司通过对比两个版本在实时流量上的表现完成验证,称新 API 每个请求的 CPU 占用降低约 70%。
Anthropic has moved its Messages API from Python to Rust with Claude agents writing and fixing much of the code. Its tests could not be trusted, so it compared the two versions on live traffic, and says the new API uses about 70% less CPU per request.
Anthropic 周三表示,Claude 背后的主 API 已从 Python 迁移至 Rust,Claude 智能体完成了大部分工作。公司在 9 月将公共流量切换至新版本,期间未使该服务下线——该服务今年曾发生过故障。
Anthropic has moved the main API behind Claude from Python to Rust, with Claude agents doing much of the work, the company said on Wednesday. It switched public traffic over in September without taking offline a service that has suffered outages this year.
Messages API 是客户和 Anthropic 自身应用(如 Claude Code)调用 Claude 的接口。本月 Anthropic 为其增加了消息线程功能,以减少长时间智能体会话中的延迟。
The Messages API is how customers and Anthropic’s own apps, such as Claude Code, reach Claude. Anthropic added message threads to it this month to cut delays in long agent sessions.
Anthropic 称,从 2024 年初到今年秋季,API 流量增长了约 1800 倍。在此期间,公司签署了大规模算力协议,合作方包括 Google 和 Broadcom。与此同时,Python 在每个环节都增加了开销。
Anthropic says the API’s traffic grew about 1,800-fold from early 2024 to this autumn. Over that time, it has signed huge compute deals, including with Google and Broadcom. Python, meanwhile, was adding overhead at every step.
Claude 在约一周内编写出核心代码的初版。验证工作却耗时数月。新代码在 4 月通过了约 98% 的测试,但只有约四分之一的真实请求与旧系统表现一致。
Claude wrote a first version of the core code in about a week. Checking it took months. The new code passed about 98% of its tests in April, but only about a quarter of real requests matched the old system.
部分问题出在测试本身。Claude 协助移植了测试,审计发现有 100 多项检查被削弱。
Part of the problem was the tests themselves. Claude had helped port them, and an audit found more than 100 checks that had been weakened.
因此 Anthropic 以实时流量为测试基准。它让请求同时通过两个版本并逐步对比,过程不读取客户文本。Claude 智能体随后修复每一个差异,工程师逐一审查修复内容。
So Anthropic used live traffic as the test. It ran requests through both versions and compared each step, without reading customers’ text. Claude agents then fixed each difference, with engineers reviewing every fix.
工程师仍需防范走捷径行为。在一个案例中,智能体通过将缺失的工具描述复制到文件中使输出一致,工程师将其判定为一次性代码并予以拒绝。
Engineers still had to catch shortcuts. In one case, an agent made the outputs match by copying a missing tool description into files, which an engineer rejected as throwaway code.
Anthropic 称,新 API 每个请求的算力消耗降低约 70%,内存占用降低逾 80%。对于 Claude Code 用户,首段回复的中位等待时间下降约 20%。
The new API uses about 70% less computing power per request and over 80% less memory, Anthropic says. The median wait for the first part of a reply fell about 20% for Claude Code users.
Anthropic 表示,Claude 现在编写了其合并代码的 80% 以上。该公司认为,检查 AI 编写的代码,而非编写代码,现在已成为瓶颈。
Anthropic has said Claude now writes more than 80% of the code it merges. The company argues that checking AI-written code, not writing it, is now the bottleneck.