跳到正文
AI 教程与实战Anthropic:Research · 情报速递· 2026-12-04 10:13

Anthropic 如何将 Messages API 从 Python 迁移到 Rust

AI 智能总结
30 秒速读
  • 核心提炼:Anthropic 将 Messages API 从 Python 迁移到 Rust,每请求 CPU 用量降低约 70%,首 token 中位延迟缩短约 20%,全程未停服也未冻结功能开发。
  • 编辑部看点:原文给出把生产系统本身当作验证器、用检查点和指纹定位差异并让智能体自动修复的迁移方法,可复用于其他大型系统重写。
  • 频道与评分:tip · 质量评分 69 分 · 来源 Anthropic:Research

情报档案

本帖由 AOB 情报系统同步至 BBS 讨论区,欢迎在下方展开技术拆解、实测反馈与延伸讨论。

完整原文内容

完整原文共 24,000 字

Many problems have a generator–verifier gap: it’s often far easier to verify that a solution is correct than to come up with one. Sudoku is a classic example. It’s simple to check the solution (just count the numbers in each row, column, and box), but finding that solution can take a long time. Many ambitious Claude projects have relied on this gap: formalizing proofs in mathematics or migrating large, well-tested codebases are tasks Claude can take on as long as it has a reliable way to verify its work. But as Claude has become more capable, it’s begun to take on projects in live systems, where generating the work is easier than verifying it. In these systems, users often rely on edge cases and quirks that fall outside the test suite , and it’s hard to write a definition of “correct” that covers everything . Without a reliable way to check Claude’s work, the migration of a live system is hard to trust—however quickly Claude can generate the code for it. We ran into this problem when we migrated our Messages API from Python to Rust. This API is the primary way that customers—as well as our own apps, like Claude Code and Cowork—reach Claude. From early 2024 to fall 2026, API traffic grew roughly 1,800 times. Rust would allow us to use far less CPU per request. Claude wrote a first version of the API’s core request path in about a week. But building trust in the migration required us to find a way to verify that our Rust API was at parity with our production API. This proved hard for several reasons, including that the Python API continued changing throughout the migration, so parity was a moving target; Claude can reply nondeterministically to the same request, so a difference between two outputs didn’t necessarily mean a bug; and we couldn't read customer requests, so w…

一键内容反馈
点击快速标记内容质量或反馈原链问题,登录后同步发出快捷回复
推荐反馈:
问题反馈:
第三方网络采集内容(AI 已初审):运行代码、安装依赖或跳转外链前请自行二次审查,安全问题由使用者自行负责,本站不承担任何责任。
免责声明

全部回复(0)

暂无回复,抢个沙发分享你的看法吧。
添加一条新回复
回复附件(图片 / 纯文本,发布回复时自动绑定)
友好交流,高价值解答可被楼主采纳获赠悬赏积分
社区风控提示:常规技术讨论与经验回复将秒级放行,异常广告与风险外链自动拦截复核。