读见

Cloudflare 为什么开始自己训练模型|Michelle Chen

原题Why Cloudflare Became a Neolab — Michelle Chen, Cloudflare

约 8 分钟原文英文已翻译

视频由 YouTube 提供

看前速览

4 个要点

Cloudflare 的 Michelle Chen 解释了低延迟决策和提取模型为何适合边缘网络,并演示如何减少排查 CI 故障时调用 LLM 的次数。

  1. 模型大小改变了边缘推理的取舍

    Cloudflare 原先预计,模型越小,网络延迟在总用时中的占比越高。前沿模型变大后,平台在边缘计算和存储之外,增加了 Kimi、GLM 和 DeepSeek 等模型的推理服务。

  2. Clef 和 Clairic 分别处理范围明确的任务

    Clef 快速完成程序预先定义的判断。Clairic 读取非结构化文本或图像,返回带类型的数据,工作流可将其交给代码、决策模型或 LLM。

  3. CI 演示先压缩上下文,再交给 LLM 推理

    Clef Flash 缩小可用工具范围,Clairic 找出拉取请求编号和日志里的关键错误。LLM 收到精简后的上下文,再完成最终判断和操作。

  4. 节省幅度来自一项演示任务

    Chen 报告此前一轮的用时约为 9.2 秒和 17.2 秒,成本降低 72%,token 用量减少约 94%,调用 LLM 的次数由 5 次降到 1 次。现场对照也更快,而且得出了相同答案。

完整摘要

Michelle Chen 从 CDN 讲到无服务器计算、存储和 GPU 推理。Workers AI 原本押注模型会变小,从而凸显靠近用户的优势。前沿模型越做越大后,Cloudflare 转而提供大模型推理服务。TypeSafe AI 的 Jev 让团队看到,快速处理边界明确的决策可以重新发挥边缘网络的优势。Cloudflare 训练了用于决策的 Clef,随后推出能从非结构化输入提取带类型字段的 Clairic。在排查 CI 故障的演示中,Clef 缩小工具范围,Clairic 提取字段和日志中的关键信息,最后交给 LLM 综合判断。Chen 报告的一次单独对照中,用时约为 9.2 秒和 17.2 秒,成本降低 72%,token 用量减少约 94%。这是单个任务的实测,换到其他工作负载时仍需验证。

文字稿

查看原文

简要说明Brief Description

Cloudflare 的 Michelle Chen 追溯了公司从内容分发网络转向模型服务、再到模型构建的历程。她介绍了 System One 模型 Clef 和 Clairic 的定位,并演示了它们如何与大型语言模型协同处理 CI 失败问题。Cloudflare's Michelle Chen traces the company's move from a content delivery network to model serving and then model building. She explains where the System One models Clef and Clairic fit and demonstrates how they work alongside a large language model on a CI failure.

目录Table of Contents

  • Cloudflare 为何成为一家新型实验室
    Why Cloudflare became a neolab
  • 从 CDN 到边缘基础设施
    From CDN to edge infrastructure
  • 工作线程与计算原语
    Workers and compute primitives
  • 全栈应用的存储
    Storage for full-stack apps
  • Workers AI 押注小模型
    Workers AI bets on small models
  • 相反,模型变得更大了。
    Models got bigger instead
  • 部署万亿参数模型
    Serving trillion-parameter models
  • 静待东风
    Waiting for the east wind
  • System 1 模型登场
    System 1 models arrive
  • 48 小时内训练 Clef
    Training Clef in 48 hours
  • Clairic,提取模型
    Clairic, the extraction model
  • 演示:排查 CI 故障
    Demo: triaging a CI failure
  • 速度提升 2 倍,成本降低 72%,Token 数减少 94%
    2x faster, 72% cheaper, 94% fewer tokens
  • 人们正在构建的内容
    What people are building
  • 继续前进
    Go onwards

为什么 Cloudflare 成了一个新型实验室Why Cloudflare became a neolab

我叫 Michelle Chen,在 Cloudflare 的产品团队工作,负责 Workers AI、AI Search 和 AI Gateway。今天在 AI Engineer Code Summit 上,我想解释一下 Cloudflare 为什么开始训练自己的模型,以及你可以用它们做些什么。My name is Michelle Chen. I'm on the product team at Cloudflare, where I work on Workers AI, AI Search and AI Gateway. Today at AI Engineer Code Summit, I want to explain why Cloudflare started training its own models and what you can do with them.

准备这场演讲时,我想引用一句话,而 Anthropic 上周末在一篇博客文章中也引用了它。我还是要用这句话。克尔凯郭尔说过:“生活只能回顾着理解,却必须向前去过。”我认为,这句话适用于一家已经走过 16 年历程的公司。一路走来,我们有些事情做对了,最终却不得不转型为一家新型实验室(neolab)。让我们回顾过去,看看这是为什么。When I was preparing this talk, I wanted to use a quote, and Anthropic used it in a blog post last weekend. I'm going to use it anyway. Kierkegaard said, “Life can only be understood backwards, but it must be lived forwards.” I think that applies to a company that's been around for 16 years. We got some of the pieces right along the way and ended up having to become a neolab. Let's look backwards to see why.

从 CDN 到边缘基础设施From CDN to edge infrastructure

Cloudflare 刚在 9 月庆祝了 16 周年。我们最初是一家 CDN。CDN 必须尽可能快速地将内容传送给用户。它位于用户请求与源站之间,可以缓存内容、提供防护并处理安全事务。Cloudflare just celebrated its 16th birthday in September. We started as a CDN. A CDN has to get content to users as quickly as possible. It sits between the user's request and the origin, where it can cache content, provide protection and handle security.

我们于 2010 年基于自有基础设施启动。快速的 CDN 必须遍布各地。这与传统的超大规模云服务商模式不同:他们的计算资源可能集中在 US East 1 或 US West 1。我们的数据中心遍布全球,尽可能靠近用户。We launched in 2010 on our own infrastructure. A fast CDN had to be everywhere. That looks different from the traditional hyperscaler model, where compute might be centralized in US East 1 or US West 1. We have data centers around the world, as close to the user as possible.

工作线程与计算原语Workers and compute primitives

我们已经有了运行在用户附近的计算机,于是我们思考人们还能用它们构建什么。这催生了计算原语。2017 年,我们推出了 Workers,让人们能够运行无服务器函数。你不必租用一整台虚拟机并为它付费,不管用不用都一样;只需执行代码,Worker 随即就会消失。它只需几毫秒即可启动。We already had computers running close to users, so we asked what else people could build with them. That led to compute primitives. In 2017 we launched Workers, which let people run serverless functions. Instead of renting and paying for a whole virtual machine whether you use it or not, you execute your code and the Worker goes away. It takes milliseconds to start up.

随后,我们推出了 Durable Objects 等有状态计算原语。2025 年,我们推出了容器,因为有些工作负载需要更接近虚拟机的运行环境。我们也希望这些工作负载能在 Cloudflare 上运行。We followed that with stateful compute primitives such as Durable Objects. In 2025 we launched containers because some workloads need something more like a virtual machine. We want those workloads to run on Cloudflare too.

全栈应用的存储Storage for full-stack apps

Workers 标志着我们开发者平台的起点。人们开始使用我们的计算原语来构建静态网站等项目。我们希望他们能更进一步,因此增加了存储功能。我们提供 KV、R2 对象存储以及 D1 等数据库。我们的理念是,让人们能够完全在 Cloudflare 上构建全栈、有状态的 Web 应用和平台。Workers marked the start of our developer platform. People began using our compute primitives to build things like static websites. We wanted them to be able to go further, so we added storage. We have KV, R2 object storage and databases such as D1. The idea is that people can build full-stack, stateful web applications and platforms entirely on Cloudflare.

Workers AI 押注小型模型Workers AI bets on small models

到 2023 年,我们已经拥有了网络、算力和存储。同年,ChatGPT 迅速走红,改变了我们对 AI 的看法。我记得在生日周前大约三周,自己坐在一个房间里,思索 Cloudflare 的网络和基础能力可以发挥什么作用。By 2023 we had the network, compute and storage. ChatGPT took off that year and changed how we thought about AI. I remember sitting in a room about three weeks before Birthday Week, asking where Cloudflare's network and primitives fit in.

我们于 2023 年推出了 Workers AI,并在网络中增加了 GPU。它们遵循相同的边缘设计,分布在靠近用户的位置。我们的假设是,随着模型变得更智能、速度更快,它们的规模会缩小,这会使网络延迟变得更加重要。我们推出时采用的是能够在分布式硬件上运行的小型模型。We launched Workers AI in 2023 and added GPUs to the network. They were distributed close to users, following the same edge design. Our hypothesis was that models would get smaller as they got smarter and faster, which would make network latency more important. We launched with small models that fit on our distributed hardware.

模型反而变得更大了。Models got bigger instead

情况恰恰相反。模型从大约 70 亿参数(当时已属前沿规模)发展到约 3 万亿参数。现在回头看,这并不令人意外。缩放定律背后的理念是,规模更大的模型在更多数据上训练后,能够更好地泛化。在迈向 AGI 的过程中,人们不断朝这个方向推进前沿。The opposite happened. Models went from around 7 billion parameters, which was frontier scale at the time, to models with about 3 trillion parameters. Looking back, that isn't surprising. The idea behind scaling laws is that larger models trained on more data can generalize better. On the path toward AGI, people kept pushing the frontier in that direction.

这与我们的假设相悖。模型规模越大,网络延迟对整体请求的影响就越小。于是我们调整了方向,也逐渐擅长为超大型模型提供服务。That went against our hypothesis. When models got larger, network latency mattered less to the overall request. We pivoted and got good at serving giant models as well.

为万亿参数模型提供服务Serving trillion-parameter models

2026 年 3 月,我们从 Kimi 开始,随后陆续推出了 GLM、DeepSeek 以及托管在我们基础设施上的其他大模型。这是无服务器的:调用 API,就能获得一个 token。我们相对较晚才进入这一领域,因为我们希望慎重决定这是否合理。提供这些模型服务与 Workers AI 最初的基础设施定位并不相符,但符合开发者使用该平台的方式。In March 2026 we started with Kimi, then followed with GLM and DeepSeek and other large models hosted on our infrastructure. It's serverless: you hit an API and get a token back. We came to this relatively late because we wanted to make a conscious decision about whether it made sense. Serving these models didn't fit the original Workers AI infrastructure story, but it fit how developers used the platform.

到那时,我们已经拥有一个靠近用户的网络、供智能体使用的 Workers 和 Durable Objects——智能体可以用它们执行任务,并在两次运行之间休眠;我们也有智能体可用来处理数据的存储。我们还有为这些智能体提供动力的大型模型。我们希望成为智能体云,让智能体部署在我们的网络上,并使用这些计算、模型和数据基础设施。不过,我们总觉得还缺了点什么,因为大型模型服务并不完全适合 Workers AI 所面向的基础设施。By then we had a network close to users, Workers and Durable Objects for agents that do tasks and sleep between runs, and storage that agents could use to work with data. We had large models to power those agents. We wanted to be the agent cloud, where agents are deployed on our network and use those compute, model and data primitives. Something still felt missing because large-model serving didn't quite fit the infrastructure Workers AI was designed for.

静待东风Waiting for the east wind

这里有句中国俗语:“万事俱备,只欠东风。”你无法预测风会从哪里来、又会以何种方式到来,但风一来,你就得及时应对。Here's a Chinese saying: “Everything is ready. All that's missing is the east wind.” You can't predict where the wind will come from or how it will arrive, but you need to react when it does.

对我们来说,东风在 2026 年 9 月吹来。TypeSafe AI 发布了 Jev,并提出了 System One 模型的理念。For us the east wind came in September 2026. TypeSafe AI launched Jev and introduced the idea of System One models.

System 1 模型问世System 1 models arrive

我们过去习惯使用的 LLM 是自回归的,需要花时间生成 token。System One 模型只需对输入进行一次前向传播,就能生成可用于决策的输出。The LLMs we were used to were autoregressive and took time to generate tokens. A System One model takes one forward pass through the inputs and generates an output you can use to make a decision.

时机恰到好处。人们把所有事情都交给 LLM 处理,却对成本、token 消耗和耗时感到沮丧。不知道你是不是也有同感,但 LLM 出错时,读它的推理过程有时会让我血压升高。借助 System One,你可以把其中一部分工作交给一个小型、快速的模型。两种类型的模型相辅相成,能让你更快实现最终目标。The timing made sense. People were sending everything to LLMs and getting frustrated by the cost, token use and time. I don't know about you, but reading a reasoning trace sometimes makes my blood pressure rise when the LLM gets something wrong. With System One, you can send some of that work to a small, fast model. The two types of model complement each other and get you to the end goal faster.

这让我们回到了 Workers AI 最初设想中的小型快速模型。我们起步得很早。当模型响应迅速时,网络延迟又变得重要起来。Jev 是闭源的,因此我们无法自行托管并利用自己的基础设施。于是我们决定构建自己的版本。Jev 于 9 月 15 日发布。三天后,也就是 9 月 18 日,我们已经开始试验自研版本的第一个版本。That brought us back to the small, fast models in the original Workers AI hypothesis. We were early. When the model responds quickly, network latency matters again. Jev was closed source, so we couldn't host it ourselves and take advantage of our infrastructure. We decided to build our own version. Jev launched on September 15. Three days later, on September 18, we were experimenting with a first version of our own.

48小时内训练 ClefTraining Clef in 48 hours

我们花了一周时间反复斟酌是否要进军这片新领域。我们不知道自己需要了解什么,也不知道是否配得上自称为一家新实验室。周五晚上,我们决定放手一试。我们利用周末花了48小时训练模型,并在接下来的一周将其发布。我们把它命名为 Clef。We spent a week deliberating whether to go into this new territory. We didn't know what we needed to know, or whether we'd live up to the expectations of calling ourselves a neolab. On a Friday evening we decided to go for it. We trained the model in 48 hours over the weekend and launched it the following week. We called it Clef.

Clef 让智能体能够自主做出一些决策。你可以通过编程将决策逻辑编码进去,这样智能体就能直接采取行动,无需等待 LLM 花上几分钟进行推理,也不必等人醒来处理。快速、低成本的决策模型可以减轻 LLM 的负担,让它们专注于需要它们处理的工作。Clef lets agents make some decisions for themselves. You can encode decisions programmatically so that the agent can act without waiting for an LLM to reason for minutes or for a human to wake up. Fast, inexpensive decision models take some of the pressure off the LLMs and leave them available for work that needs them.

Clairic,抽取模型Clairic, the extraction model

我们询问大家还会让 LLM 承担哪些任务,而这些任务可能因为模型生成文本的方式而成本过高、速度过慢或容易产生错误答案。三周后,我们推出了一款名为 Clairic 的信息抽取模型。最终,我们在三周内推出了四款模型。We asked what other workloads people give to LLMs that might be too expensive, too slow, or prone to incorrect answers because of the way the model generates text. We launched an extraction model called Clairic three weeks later. Ultimately, we'd launched four models in three weeks.

Clairic 是一种 System One 模型,只需进行一次前向传播。现实世界不会直接给你格式完美的 JSON,而是给你电子邮件、推文和 Slack 消息。Clairic 能处理非结构化输入,并从中提取、计算、估算和预测数值。它会返回智能体可以处理的类型化 JSON。你可以向它提供图像和文本。你可以让它读取一段文本中的内容,将输出传给 Clef 来决定采取什么行动,再引入 LLM 完成智能体工作的其余部分。Clairic is a System One model that makes a single forward pass. The world doesn't hand you perfectly typed JSON. It gives you emails, tweets and Slack messages. Clairic takes unstructured input and can extract, compute, estimate and forecast values from it. It returns typed JSON that agents can work with. You can give it images as well as text. You might ask it to read what's in a piece of text, pass the output to Clef to decide what to do, and bring in an LLM for the rest of the agent's work.

System One 模型是基础设施、计算与数据基础组件,以及驱动智能体的模型之间缺失的一环。自行构建模型,让我们能够在所需模型为闭源或面临监管限制时,仍有空间打造所需的解决方案。System One models were the missing piece between the infrastructure, the compute and data primitives, and the models powering agents. Building models ourselves gives us room to create something when what we need is closed source or we face a regulatory constraint.

演示:排查 CI 失败Demo: triaging a CI failure

在开发者工作流中,你能用这些模型做什么?想象一个代理正在为某个拉取请求排查 CI 构建失败的问题。它有 40 个工具可用,并且可能运行在 Durable Object 上的 Pi Durable 中。在纯 LLM 的设置下,模型发起一次调用、获取结果,然后再发起下一次调用,直到问题解决。假设它与 GLM-5.3 进行了五轮往返调用。如果每次都发送全部 40 个工具,你就会不断把相同的内容添加到上下文中。What can you do with these models in a developer workflow? Imagine an agent triaging a failed CI build for a pull request. It has 40 tools available and might be running Pi Durable on a Durable Object. In an LLM-only setup, the model makes a call, gets the result and makes another call until the problem is resolved. Think of five back-and-forth calls to GLM-5.3. If you send all 40 tools each time, you keep adding the same material to the context.

为了提高速度,我们可以使用 Clef Flash 来精简工具列表。智能体可能只需要这 40 个工具中的 10 个。然后,Clairic 可以从输入中提取 PR 编号。我们用代码执行 API 调用,并让 Clairic 从日志中提取相关信息。与其把 300 或 600 行内容粘贴到 LLM 中,不如直接传入实际错误、错误消息以及受影响的行。我们仍会在需要汇总结果并采取行动时使用 LLM。For speed, we can use Clef Flash to prune the tool list. Perhaps the agent needs only 10 of those 40 tools. Then Clairic can extract the PR number from the input. We use code to run the API calls and ask Clairic to pull relevant information from the logs. Instead of pasting 300 or 600 lines into an LLM, we can pass the actual error, its message and the lines it affects. We still use the LLM where we need it to pull together the result and act.

我们并排运行了纯 LLM 方案和 System One 方案。当时正值工作日的中午,实时演示连接的是会议场地的 Wi-Fi。System One 方案先完成了。瀑布图显示,该方案一侧的区块比另一侧代表模型生成的紫色条形更小。We ran the LLM-only and System One approaches side by side. It was the middle of the workday and the live demo was running on conference Wi-Fi. The System One side finished first. The waterfall chart shows smaller blocks on that side than the purple bars for the model generation on the other.

速度提升 2 倍,成本降低 72%,Token 数减少 94%2x faster, 72% cheaper, 94% fewer tokens

两次运行得出了相同的答案。在实时对比中,仅使用 LLM 的一方调用了六次 LLM,使用了约 40,000 个 LLM token;而 System One 一方只调用了一次,使用了约 1,800 个 token。在一次不依赖会议 Wi-Fi 的运行中,两者耗时分别约为 9.2 秒和 17.2 秒。该方案的速度几乎快了一倍,成本降低了 72%。在这次对比中,LLM 调用次数从五次降至一次,token 用量降低了约 94%。Both runs reached the same answer. In the live comparison the LLM-only side used six LLM calls and about 40,000 LLM tokens, versus one call and about 1,800 tokens on the System One side. In a run away from the conference Wi-Fi, the times were about 9.2 seconds and 17.2 seconds respectively. The setup was almost twice as fast and 72% less expensive. In that comparison, LLM calls fell from five to one and token use was about 94% lower.

人们正在构建什么What people are building

这就是结合使用系统一和系统二的一个例子。你可以腾出时间和计算资源,用于更重要的任务,并支持更多并发工作。人们已经在构建路由器,并将这些模型应用于欺诈、垃圾邮件和网络钓鱼检测。Clairic 可以从网页和支持工单中提取数据。我们发布了早期预览版,之后还将推出另一个版本。That's one example of using System One and System Two together. You can free up time and compute for the more important tasks and support more concurrent work. People are already building routers and applying the models to fraud, spam and phishing detection. Clairic can extract data from web pages and support tickets. We released an early preview and have another launch coming.

继续前进Go onwards

有了这些新的模型选项,可供打造的东西多得很。我们关于模型规模的假设未能成立后,Cloudflare 转而提供大型模型服务,因为这对智能体云来说合情合理。东风到来时,我们再次转向,构建了适合自身基础设施的决策模型。回顾过去能让我们明白自己是如何走到今天的。重要的是,我们如何利用当下所拥有的一切。With these new model options, there's a lot to build. Cloudflare pivoted to serving giant models when our hypothesis about model size didn't hold, because that made sense for the agent cloud. When the east wind came, we pivoted again and built decision models that fit our infrastructure. Looking backwards tells us how we got here. What matters is what we do with what we have now.

最后,我想引用托尔斯泰的一句话:“请记住,只有一个时刻最重要:现在。它是最重要的时刻,因为只有在此刻,我们才拥有力量。”今天你打算创造什么?I'll leave you with a quote from Tolstoy: “Remember then, there's only one time that is important: now. It is the most important time because it's the only time when we have any power.” What are you going to build today?

值得记下

  1. 模型响应一旦足够快,网络延迟就重新变得重要。
  2. Clairic 接收非结构化输入,可以从中提取、计算、估算和预测数值。
  3. 两次运行都得出了同一个答案。