---
title: "We Hit 10,500 Tokens/Sec on B200"
url: "https://www.morphllm.com/blog/morph-breaks-10k-barrier"
description: "Technical deep-dive: custom CUDA kernels + speculative decoding for 2.3x speedup"
date: "2025-09-15"
author: "Tejas Bhakta"
---
# We Hit 10,500 Tokens/Sec on B200

![Performance graph showing Morph v3-fast breaking through 10,500 tokens per second](/images/breakthrough.png)

**TL;DR**: on a single B200 the code editing model now does 10,500 tokens/sec per request. Last version it was 4,500. Put network latency back in and most real file edits return in 1-3 seconds. One note on the numbers up front: every timing in this post is a single request from a cold start, nothing batched and nothing hand-picked to look good.

So, how we more than doubled it, and why that number is worth caring about.

## Why the speed is the point

Search and replace has an arithmetic problem. Every chunk you want to edit is a separate tool call, so a change touching ten spots is ten round trips before the file settles. FastApply skips all of that. The model describes every change to the file at once, reading the original plus partial snippets marked with `// ... existing code ...`, and we apply the set in a single pass. It's close to `git merge`, except the thing it's merging came out of an LLM. On [our benchmarks](https://morphllm.com/benchmarks) that comes out roughly 35% faster end-to-end.

There are two models. morph-v3-fast runs at 10,500+ tok/sec in 40GB and takes the speed-critical edits, which is most of them. morph-v3-large trades speed for room, 5,000 tok/sec in 80GB, for the bigger architectural jobs.

## Getting to 10,500

The kernels were where the cheap memory wins were hiding, so I started there. Folding attention and feedforward into a single pass took three trips through HBM out of the hot path, and the FlashAttention variant I wrote leans on the way code nests inside itself instead of treating it as flat tokens. The profiler didn't leave much room for interpretation. We went from 1.6TB/s of memory bandwidth on the H100 up to 2.1.

Speculative decoding did the rest, and it's the piece I'd have bet against going in. You draft the next few tokens before you've finished proving out the current ones, then verify the whole batch in one forward pass and keep whatever survived. On general text the accept rate is mediocre and the whole thing is a wash. On code merges it was a different story once we measured it, and the reason turned out to be unglamorous. Code repeats itself. The indentation that follows a newline is usually the one you'd predict, and a bracket that opened has to close somewhere down the file, so the drafts the model floats tend to be right. When they're right you've bought tokens for nothing, and when they're wrong the miss costs almost nothing to throw away, which is why the accept rate ends up mattering so much.

![Speculative decoding: draft tokens race ahead of the verified frontier as outlines, verification accepts them in chunks, rejects flash red and get thrown away](/animations/spec-decode.webp)

Shrinking the model helped more than I expected it to. We're running 7B where you might have reached for 34B, and it has never learned to do anything but this. The vocab is cut down to the tokens code editing actually hits, which is why you won't find Chinese characters in there, and the positional encoding got replaced with one that follows a file's nesting rather than treating it as flat text. The narrow model gives up plenty in exchange. You can't hand it the kind of reasoning Claude or GPT-4 will do, it's no help writing your email, and without the markers it loses track of what stayed the same. All of that was fine by me against the throughput we got back.

The comparisons that matter here are the ones running the same task on the same hardware. vLLM serving Llama 3.1 8B tops out near 3,200 tok/sec. TensorRT-LLM on CodeLlama 7B does better, around 4,800. Even the Morph release right before this one sat at 4,500. Getting past 10,000 took all three of the changes above at once.

## What it looks like in production

A typical apply runs 1-3 seconds once file size and network are in the mix. That's fast enough to change the shape of the workflows around it. You can refactor across files and watch the result assemble, coordinate edits inside an agent loop without losing accuracy, or start applying a suggestion while the model is still writing the next one.

## Where it still falls short

Structured languages are where it's happy. Python, JS, Go. Heavy macro-based C++ gives it a hard time. It also leans on the markers to know what didn't change, and it takes one request at a time with no conversation memory.

The next targets are 15k+ tok/sec on the Blackwell B200 kernels, atomic edits across a whole repo, and a sub-100ms p50 from pushing inference nearer the edge.

## Try it

**API endpoint**: `POST https://api.morphllm.com/v1/code/apply`

```bash
curl -X POST https://api.morphllm.com/v1/code/apply \
  -H "Authorization: Bearer YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "morph-v3-fast",
    "instructions": "Print universe instead of world",
    "initial_code": "def hello():\n    print(\"world\")",
    "edit_snippet": "def hello():\n    print(\"universe\")"
  }'
```

**Pricing**: $0.80/1M input, $1.20/1M output

[Get API key](/dashboard/api-keys) • [Full docs](https://docs.morphllm.com) • [Benchmarks](https://morphllm.com/benchmarks)

Want to help us get to 15k tok/sec? We're hiring: info@morphllm.com
