像初创公司一样快速交付,像银行一样接受监管
Shipping like a startup, regulated like a bank
原文由官网提供,中文由 GPT-6 Luna 翻译。相邻片段合并排版,正文与时间点保持对应。
已插入 7 张经核对的幻灯片或演示截图;点击图片可放大。图注链接为当前视频时间,左侧正文时间保留原转录版本,二者可能不同。
共 20 个阅读段落

大家好,欢迎。我叫 David。我在一家叫 Revolut 的公司负责 AI 运营。今天我们有 15 分钟的时间。我们会聊高性能工程,以及如何在专用 GPU 上自托管开源模型。大家觉得怎么样?好。这会是一场偏技术的分享,请大家耐心听我讲。
Hello everyone, welcome. My name is David. I lead AI operations at a company called Revolut. We have 15 minutes today together. we'll talk about high performance engineering and self-hosting open source model on dedicated GPU. How does that sound? Cool. So it's going to be a technical one, so bear with me.

开头先简单介绍一下,因为我知道这里是在美国,大家可能不熟悉 Revolut,我先简单说说我们公司。我们是欧洲的一家数字银行。我们有 8000 万客户。业务覆盖 45 个市场。去年,我们的金融应用在欧洲的下载量排名第一。截至 7 月,我们是欧洲规模最大的私营企业。所以发展得还不错。Revolut 的重点是大量推出产品,因此,我们非常重视工程文化,以及高标准的工程实践。我们今天就来聊聊这个。
So maybe to start off, because I know this is the US and you may not know Revolut, quick words about our company. We're a digital bank in Europe. We have 80 million customers. We're live in 45 markets. with the most downloaded financial app in Europe for the last year. And as of July, we're Europe's largest private company. So we're doing okay. The emphasis of Revolut is shipping a lot of product, and so there's a high focus on engineering culture and excellence on that demand. And so we'll talk about that.
先来谈谈 AI。这里有一张图表。
So let's talk about some AI. We have a chart here.

上面有两条曲线。这是过去一年对 2000 名工程师绩效的抽样。绿色曲线表示交付周期。也就是从工程师开始处理一项功能到该功能合并并准备部署所需的时间。蓝色曲线表示编码时间。绿色曲线的单位是天,蓝色曲线的单位是小时。为了让大家回想起时间线,毕竟 AI 发展得非常快。Claude Code 大约在 2025 年 2 月发布,对吧?说的是 Claude Code,也就是 Sonnet 3.7,那个会把你的生产数据库删掉的版本,对吧?
I'm going to see two lines. This is a sample of 2,000 engineers' performance over the last year. So the green line is going to be lead time. So it's going to be when an engineer picks up a feature until a feature is merged and ready to be deployed. The blue line is going to be coding time. So the green line is in days. The blue line is in hours. Just to reset the timeline in case people forget, because AI moves really fast. Claude Code came out around February 2025, right? And that's the Claude Code, Sonnet 3.7, the one that would delete your prod database, right?
不是我们今天用的安全版 Cloud 和 Codex。所以谈到采用情况时,请记住这一点。图表上显示的是 2025 年 1 月,那时我们首次在公司内部引入 AI,对吧?Gemini。那是大家第一次能够在 AI 中使用私有数据。大约 2 月,我们开始试用 Claude Code;然后到了 1 月,我们首次大规模推出 Claude Code。从图上可以看到,Gemini 让交付周期改善了 10%,编码时间改善了 20%,也就是说,大家不用再去 Stack Overflow 查资料或读文档了。但当时 Claude Code 的影响就没那么大。
Not the safe cloud and codex that we have today. So bear in mind when we talk about adoption. So what you see on this chart is January 25, first introduced AI in the company, right? Gemini. First time people were able to use private data within AI. Around February, we started playing around with Claude Code, and then January is when we first launched Claude Code at scale. What you see is Gemini had 10% improvement in lead time, 20% improvement in coding time, so that's people no longer need to look at Stack Overflow and reading documentation. But then Claude Code, not so much impact at the time.
所以刚推出时,我们对 AI 的成本非常谨慎。我们看到有工程师一个月花 1000 美元,甚至一个月花 10000 美元,但投资回报并不明显。因此我们推出时,设置了严格的预算上限。然后我们开始寻找下一步,对吧?怎样才能给工程师提供有限数量的 token,让他们能毫无顾虑地使用 AI,同时成本只占一小部分?于是我们研究了开源方案。大约在 4 月 26 日,我们开始自托管开源模型。我们很喜欢用 GLM 编码。所以,大约在那段时间,你们可以看到,4 月 26 日,GLM 5.1,我们的编码时间改善了 60%,编码时间方面。
So when we launched it, we were highly skeptical about the cost of AI. we were seeing engineers spend a thousand a month, 10,000 a month with not so much ROI. And so when we launched it, we launched it with strict budget limits. And so we're looking at the next thing, right? So how can we provide limited tokens to our engineers so they can use AI guild-free for a fraction of the cost? And so we looked into open source. So around April 26 is when we started self-hosting open source model. We're a big fan of GLM for coding. so around that time what you see April 26th, GLM 5.1 we see 60% improvement in coding time
交付周期改善了 70%,影响非常巨大。我们从中学到了什么?好,交付周期受到的影响更大,编码时间受到的影响相对较小。我们发现,工程工作的瓶颈未必在编码。节省很多时间的方式,包括不用再翻查收件箱,也不用再折腾 Jira 和 Confluence。即便 token 数量有限,你也可以自由地用来做这些事,不必再把 token 留到季度末,或者留给最困难的任务。那么我们现在是什么情况?开源现在是 Revolut 的优先事项,而且经济上很划算,计费是固定的,每个月都不会出现账单冲击,而前沿模型则属于例外情况。
70% improvement in lead time so traumatic impact what do we learn from this? well there's more impact on the lead time than on the coding time so what we find is the bottleneck for engineering is not necessarily coding you can save a lot of time not having to dig through your inbox or messing with Jira and Confluence and so when you have a limited token you're free to do that. You no longer have to save your tokens for the end of the quarter or the most difficult task. So where do we stand? Well open source is now a priority, a revolute, and your economics are favorable, the billing is flat, we don't have any bill shock any of the month, and the frontier is the exception.
显然,我们仍然会用 Codex、Claude Code。最新的模型都很出色。Jimmy 和我也进展得很好。但我们把它们作为例外使用。那我们是怎么做到的?
So obviously we keep using codex, code code. The latest model are fantastic. Jimmy and I are going very good as well. But we keep them as exception. So how do we get there?

自托管模型时,有些指标很重要。要服务 2000 名工程师,我们大致需要 56 张 B200。这是为了托管 GLM 5.3。GLM 是个大模型,对吧?有 85 亿个参数。你要争取达到的是首 token 延迟低于 3 秒。这是根据经验观察得出的。一旦超过 5 秒,我的 Slack 收件箱就会被消息轰炸,所以我们知道这就是上限。至于吞吐量,它就没那么重要了。从交互体验来说,我们提供每秒 200 个 token。
Some metrics that matter when you're self-hosting model. So to serve 2,000 engineers, we roughly need 56 B200. And that's to host GLM 5.3. GLM is a big model, right? 8.500 billion parameters. What you want to aim for is sub-3 second time to first token. This is empirical evidence. As soon as you exceed 5 seconds, my Slack inbox starts to blow up, and so we know that's the limit. In terms of throughput, it doesn't really matter as much. We serve, in terms of interactivity, 200 tokens per second.
大家觉得够用了。没必要再提高。人们的工作方式已经改变。我们不再盯着连续输出的思考 token。大家会并行运行多个任务任务完成后再回来查看。但如果你的吞吐量需求很高,而且你是 Revolut 的工程师,只要在下午 5 点之后连接到一张 GPU,你就能获得每秒 800 个 token,那体验就非常棒了。从成本和效果来看,自托管 GLM 时,混合后的 token 成本是每百万个 30 美分。所以我们的账单只有之前在 Anthropic 和 OpenAI 上花费的十分之一。运行开源模型需要做大量调优,
People are fine. You don't need to go higher. The way people work has changed. which we no longer look at the stream of thinking tokens. People run tasks in parallel and check in when the task is done. But if you're in a high throughput and you're an engineer at Revolut, you just connect after 5 p.m. when one is on GPU you can get 800 TPS and then, you know, it's a dream. In terms of cost, in terms of impact, self-hosting, GLM, or blended cost of token is 30 cents per million. And so our invoice is one-tenth of what we were spending on Anthropic and OpenAI. So there's a lot of tuning

这些工作都得安排好。如果你只是拿到 GPU,然后把模型权重加载到 GPU 上,接着开始推理,你会发现性能很糟糕。这是因为工作负载会非常依赖你设置的参数。看图表最左侧,蓝线表示需求,也就是每秒请求数。它会成为影响 GPU 延迟的瓶颈。红线则是我们要优化的指标,也就是首 token 延迟。所以我们 4 月刚开始时,每秒请求数大约是 3,这个数值偏高但还不算特别高,而首 token 延迟超过 10 秒,非常慢。
that goes into running open source models. If you just get GPUs and upload weights on a GPU and you start doing some inference, you're going to get terrible performance. That's because your workload is going to be very dependent on the parameters that you set. So if you look all the way to the left of that chart, the blue line is going to be demand, so that's request per second. That's going to be what's going to be the bottleneck for your latency for your GPUs. And the red line is what we're optimizing for, that's the time to first token. So when we started back in April, you could see request per second around 3, which is high but not so high, and time to first token over 10 seconds, which is very slow.
你看到的所有数据都是在GPU 数量相同的情况下得出的。我们在使用 LLF56 时增加过 GPU 数量。到最后,也就是 8 月时,每秒请求数超过了 7,首 token 延迟则降到了大约 1.6 秒。因此,需求增加了 76%,性能却提升了 88%。由此我们学到,很多参数都可以优化;如果你打算自托管模型,就要克制盲目扩容的冲动,这一点尤其适用于考虑自托管模型的情况。我们来聊聊这些参数。没有什么秘诀,但需要考虑以下几点。
All of the data that you see is the same number of GPU. We did an increase GPU count with LLF56. And by the end, you see in August, requests per second were over 7, and time to first occur, and we're around 1.6. So we've had 88% improvement in performance for 76% increased demand. So the learning from this is there's a lot of parameters that you can improve on, and you really need to resist scaling. if you're looking to self-host a model. So let's talk parameters. There's no secret recipe, but the things you consider are the following.
第一,长上下文就是个骗局。你真的要留意,即便你能提供 100 万 token 的上下文,你真正需要的其实是 256。量化方面,如果你运行的是 Blackwell 一代 GPU,就不应该使用高于 FP4 的精度。而且 FP4 最好;大致来说,从 FP4 换到 FP8,GPU 占用能减少 40%,精度却完全没有损失。其他需要考虑的参数还有张量并行,虽然 GLM 能用 TP4 跑起来,但 KV缓存不够,所以 TP8 可能更合适,具体要看你的工作负载有多大。
First one, long context is a scam. You really need to be mindful that even though you can serve one million token, 256 is really what you need. Quantization, if you're running Blackwell generation GPU, you don't want to run anything higher than FP4. And the FP4 is best, roughly going from FP4 to FP8 is a 40% saving in GPU footprint for zero loss in precision. Other parameters to consider, tensor parallelism, even though GLM fits on TP4, you don't have enough KV cache, and so maybe a TP8 works better, depending on how large your workload is.
接下来是更专业一些的内容:检查缓存命中率,编码测试的缓存命中率需要高于 90%,也就是缓存命中率。你还可以研究如何优化推测解码、顺序预填充,以及 PD 解耦。这些方法都可以考虑。好。
and then on the more esoteric check your cache hit coding test needs to be above 90% cache hit and you can look into optimize spec decoding sequential pre-fill, PD disaggregation all of these cool

现在我们来谈谈生产环境的配置。显然,GLM是纯文本模型,这对有些人来说是个限制。我认为我们每次都会做出这样的取舍:选择更聪明的模型,再想办法用其他方式识别图像。你可以轻松搭建本地路由器,OpenCode 和 Codex 就是这样的工具,可以把所有图像识别请求转给 Gemini 或 Luna,同时把主要任务交给 GLM。如果确实需要视觉模型,GLM 5G Flash 表现很好。我们的 UI 设计师就充分利用了它。UI 产品的交付速度已经有了非常、非常大的提升。最后一点是智能体运行框架。所有这些端点都提供兼容 OpenAI 的 API,并支持 Responses API。因此你可以在OpenCode、Codex 和 Codex 应用里使用,效果都很好。
so now let's talk about production setup GLM obviously is a text only model which is a limitation for some people the trade off I would say we would make every time is get the smarter model and figure out how to do image recognition another way. You can easily have a local router, open codex is one, where you would route any image recognition to Gemini or Luna and keep GLM for the main task. If you really need some vision model, GLM 5G flash works really well. We have our UI designer making great use of it. Turnaround for UI product has gone a really, really long way. And then the last one is going to be about the harness. So all of these endpoints are going to be OpenAI compatible API with response API. And so you can use them inside OpenCode Codex, Codex app as well, works very well.
这就是我们的建议。
And so that's what we recommend.

最后还有一点,这是说给在座 CIO 听的。使用中国开源模型一直伴随着很多偏见。需要考虑的是,你并没有在使用部署在中国的专用推理端点。你只是取得模型权重,然后把它们部署到美国的服务上。所以就数据共享而言,这完全没问题。尤其是 Revolut,因为我们是一家受欧盟监管的银行,我们受到最严格的合规制度约束。因此我们发现,所有这些编码任务都不被视为自主智能体。
And then last message, this one is for the CIO in the room. There's been a lot of stigma in using Chinese open source model. So the thing to consider is you're not using inference, dedicated endpoint that goes to China. you're just getting the weights and putting them on a US-based service. So for data sharing side, this is totally fine. Revolut in particular, because we're an EU-regulated bank, we fall under the most strict regime in terms of compliance. so what we find that works is all of these coding tasks are not considered autonomous agents.
它们始终有人参与其中。那么,怎样才能让人放心,确保有人参与其中呢?可以先创建一个沙盒来保证这一点。沙盒意味着,如果你用过 Codex 或 Claude Code,就会看到它们都有“替我批准”之类的功能。你只需要为操作设定规则,禁止你不想放行的操作。例如,你可以允许 grep,但不允许 Gradle。这会让监管机构放心,因为它不是一个自主智能体,因此不需要采用另一种监督方式。这个沙盒也能保护你免受失控使用的影响。公司里可能会有心怀不轨的人,你需要对此加以防范。
They're always with a human in the loop. And so how do you give reassurance that you have a human loop? You start by creating a sandbox that guarantees that. And the sandbox means now if you've used Codex Claude Code, it has all of these features of approve for me. You just have to set the rules for the operations that you don't want to allow. So you can allow grep but not gradle, for instance. And that's gonna give confidence to your regulator that it's not an autonomous agent that needs different supervision. This sandbox also protects you from rogue use. You may have bad actors inside your company, and you want to shield for that.
大公司里可能发现的情况,会让你大吃一惊。最后一点是提示注入。考虑到现在的模型已经很聪明,这种情况不那么常见了,但始终都需要留意。关于数据隐私,我们刚才已经谈过了。只要数据存放在数据等效框架所涵盖的国家,比如美国、欧盟、英国、以色列,就没有问题;你可以在那里获取 GPU。所有推理服务商或 GPU 服务商默认都会做到零数据留存。最后一点是你需要有非常完善的 OpenTelemetry,这样一旦发生事件,你就能深入查看日志。
You'd be surprised what you find in a large company. And then the last one is prompt injection. Not so much a thing now, given how smart models are, but always a thing. In terms of data privacy, we spoke about it. As long as the data sits in one of the countries that are in the data equivalency framework, so US, EU, UK, Israel, you're fine, you can get your GPUs there. All of your inference provider or GPU provider are going to have zero data retention by default. And then the last thing you need is a very strong open telemetry so that if you ever have an incident, you need to be able to go deep and look at the logs.
它还可以为你提供一些分析数据。好,谢谢大家。我的演讲到此结束。
Also gives you some analytics. All right, thanks everyone. That was all for my talk.