---
title: "How to serve trillions of tokens for trillion-parameter coding agents"
description: "Modal describes how it serves Moonshot AI's trillion-parameter Kimi K2.6 model for coding-agent traffic at trillions of tokens."
url: "https://swe.quest/articles/how-to-serve-trillions-of-tokens-for-trillion-parameter-coding-agents-0508c7c515fa8a14"
canonical: "https://modal.com/blog/trillion-tokens-trillion-parameters"
source: "Modal"
published: "2026-09-23"
difficulty: "hard"
kind: "Case study"
reading_minutes: 32
tags: ["inference","llms","caching","performance","hardware"]
---

# How to serve trillions of tokens for trillion-parameter coding agents

A post on [Modal](https://swe.quest/sources/modal.md), published 2026-09-23, 32 min read, Case study. Original: [https://modal.com/blog/trillion-tokens-trillion-parameters](https://modal.com/blog/trillion-tokens-trillion-parameters)

## Summary

Modal describes how it serves Moonshot AI's trillion-parameter Kimi K2.6 model for coding-agent traffic at trillions of tokens. In that workload, requests average about 100k input to 500 output tokens with heavy prefix overlap across session turns. Their approach was to optimize a single replica first, raising interactivity and then throughput, and to scale out afterward. The changes included NVFP4 quantization on B200/B300 GPUs, tensor parallelism within 8-GPU NVLink domains, DFlash speculative decoding, freeing and quantizing HBM intermediates, and extending the KV cache into CPU RAM with SGLang HiCache. Together they improved per-replica performance 2.8x per user and 5.6x across users, and the post argues that small 8-GPU replicas match larger NVL72 deployments on per-GPU throughput while being far easier to schedule.

Written by swe.quest, not by the author.

**Difficulty:** Hard: written for specialists in the field

## Topics

- [Inference & serving](https://swe.quest/tags/inference.md) (AI & ML)
- [LLMs](https://swe.quest/tags/llms.md) (AI & ML)
- [Caching](https://swe.quest/tags/caching.md) (Backend & APIs)
- [Performance engineering](https://swe.quest/tags/performance.md) (Reliability & operations)
- [Hardware](https://swe.quest/tags/hardware.md) (Infrastructure)

## Prerequisites

- Transformer architecture basics ([easy posts on System design](https://swe.quest/tags/system-design.md?difficulty=easy))
- KV cache and prefill/decode ([easy posts on Caching](https://swe.quest/tags/caching.md?difficulty=easy))
- GPU memory hierarchy ([easy posts on Hardware](https://swe.quest/tags/hardware.md?difficulty=easy))
- Tensor parallelism ([easy posts on Concurrency](https://swe.quest/tags/concurrency.md?difficulty=easy))

## Keywords

Kimi K2.6, SGLang, HiCache, NVFP4, DFlash, speculative decoding, B200, NVLink

## Related posts

- [Benchmarking inference at scale: coding agents](https://swe.quest/articles/benchmarking-inference-at-scale-coding-agents-f8c09180ef476b13.md): Together AI · 2026-05-19 · Hard · 6 min read · Inference & serving, Performance engineering, LLMs, AI for coding
  On a long-context, high-concurrency coding agent workload (prompts ~45k–200k tokens, ~450-token outputs, EAGLE speculative decoding) running Kimi K2.5 on B200 GPUs, Together Inference Engine delivers 31% more per-user TPS than TensorRT-LLM at 2.5M TPM.
- [How a global fintech scaled coding agent traffic with Dedicated Model Inference](https://swe.quest/articles/how-a-global-fintech-scaled-coding-agent-traffic-with-dedicated-model-inference-84f93581c0f0597b.md): Together AI · 2026-09-18 · Medium · 6 min read · Inference & serving, AI for coding, Capacity planning, Load balancing
  A global fintech serves its internal coding-agent traffic on GLM 5.2 via Together's Dedicated Model Inference, where spiky, engineering-hours load with long prompts (ISL p50/p95 of roughly 81K/178K tokens) at low RPS made concurrency, not throughput, the design priority.
- [Launching a trillion-parameter model at Sakana AI](https://swe.quest/articles/launching-a-trillion-parameter-model-at-sakana-ai-9bcebf1840c2211d.md): Modal · 2026-10-23 · Hard · 6 min read · Inference & serving, LLMs, Performance engineering, Serverless
  Modal served Sakana Namazu, a ~1T-parameter Japanese-focused MoE model, by quantizing only the routed experts to NVFP4.
- [Kimi K3 by Moonshot now available on Modal](https://swe.quest/articles/kimi-k3-by-moonshot-now-available-on-modal-c3db2e556f76303f.md): Modal · 2026-07-27 · Easy · 3 min read · Inference & serving, LLMs
  Moonshot's Kimi K3, a 2.8T-parameter mixture-of-experts multimodal model with a 1M token context window, is available on Modal from release day via an OpenAI-compatible Shared API and dedicated Auto Endpoints.
- [Key research and product announcements at the AI Native Conf](https://swe.quest/articles/key-research-and-product-announcements-at-the-ai-native-conf-07f3b657efde83f0.md): Together AI · 2026-03-05 · Hard · 7 min read · Inference & serving, Hardware, Model training, AI agents, Performance engineering
  Together AI announced seven research and product releases spanning GPU kernels, reinforcement learning infrastructure and inference optimization.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
