Blank white background with no objects or features visible.

Ask TFY:AIゲートウェイ内のあらゆる事象をデバッグ、分析、実行 詳細はこちら

TrueFoundryはSeldon AIの買収を発表し、エンタープライズAI向けコントロールプレーンを拡張します。プレスリリース全文はこちら→

LLM Locust: LLMパフォーマンスのベンチマークツール

What is LLM Benchmarking?

LLM Benchmarking is the process of evaluating how efficiently a Large Language Model (LLM) inference server performs under load. It goes beyond traditional performance testing by focusing on real-time response characteristics that directly impact user experience and system scalability.

Here are some of the key metrics involved:

  • Time to First Token (TTFT):
    The delay between sending a request and receiving the first token of the response. This reflects the model’s initial processing latency.
  • Output Tokens per Second (tokens/s):
    Measures how quickly the model generates response tokens, indicating generation speed and system responsiveness.
  • Inter-Token Latency:
    The time between consecutive tokens in a streaming response. Lower values indicate smoother, more natural-feeling output in real-time applications.
  • Requests per Second (RPS):
    The number of inference requests an LLM can handle per second—an essential measure of throughput.

Tracking and analyzing these metrics is critical for:

  • Comparing LLM providers
  • Optimizing deployments across CPUs, GPUs, or specialized accelerators
  • Fine-tuning server configurations for latency-sensitive applications

That’s where LLM Locust comes in.

Why Traditional Load Testing Tools Like Locust Fall Short for LLM Benchmarking (And How LLM Locust Fixes It)

As LLMs continue to power more real-time and interactive applications, benchmarking their performance accurately is more important than ever. While tools like Locust are excellent for traditional load testing, they fall short when it comes to the streaming, token-level granularity LLMs require.

Enter LLM Locust—a tool purpose-built to bridge this gap.

Why Locust Is Great for Traditional Load Testing

Let’s give credit where it’s due. Locust remains one of the most beloved tools for load testing due to its:

  • Python-native scripting: Flexible and intuitive for test scenario creation
  • Lightweight concurrency: Greenlets allow for thousands of simulated users
  • Real-time Web UI: Simple and powerful for monitoring load tests live

For standard APIs or services, it’s a fantastic choice. But for LLMs? Not quite enough.

The Problem: LLMs Break the Load Testing Mold

1.  No Support for LLM-Specific Metrics

Locust doesn’t natively track LLM-specific performance indicators, such as:

  • Time to First Token (TTFT)
  • Output tokens per second
  • Inter-token latency

These streaming dynamics are fundamental to understanding how well an LLM performs, especially in real-time use cases.

2.  Token Streaming Inconsistency + CPU Bottlenecks

LLM APIs often stream tokens inconsistently—some return zero tokens at first, others send one token at a time, and some deliver multiple tokens in a single chunk.
To measure output tokens accurately, responses must be re-tokenized, since the API responses can’t be trusted to follow a consistent format.

But here’s the catch: tokenization is a CPU-bound task, especially when done for every streaming response. Locust uses greenlets for lightweight concurrency, but they still operate under Python’s Global Interpreter Lock (GIL). That means CPU-heavy operations like tokenization can block the event loop, reducing throughput and skewing your benchmark results.

The combination of inconsistent streaming behavior and Python’s GIL makes this a significant performance bottleneck in traditional Locust setups.

3. No Custom Charts

Want to plot TTFT or streaming throughput? Locust’s UI doesn’t support custom LLM metrics out of the box, leaving key data invisible during test runs.

4.  Competing Tools Are Limited

Tools like genai-perf are valuable, but often provide:

  • One-off benchmark snapshots
  • Limited configurability
  • No real-time visual feedback

They lack the iterative, exploratory flexibility needed in real-world benchmarking.

The Solution: Meet LLM Locust

LLM Locust combines the simplicity of Locust with deep support for LLM-specific benchmarking. Inspired by BentoML’s llm-bench, it introduces a modular architecture and custom frontend for real-time insights.

How LLM Locust Works

1. Asynchronous Request Generation
Simulated users send continuous asynchronous requests to your LLM API, mimicking real-world load. This runs on a separate python process, so there are no tokenization bottlenecks. 

2. Streaming Response Collection
LLM responses are streamed and routed to a metrics daemon for lightweight parsing and analysis.

3. Metrics Processing
The daemon tokenizes responses, calculates TTFT, tokens/s, and inter-token latency, and buckets the results.

4. Aggregation
Every 2 seconds, data is sent to a FastAPI backend which mimics locust backend, which stores and aggregates metrics globally.

5. Real-Time Visualization
Locustのフロントエンドのカスタマイズ版では、以下が表示されます。

  • リクエストあたりのTTFT
  • 時系列トークンスループット
  • 📊 RPS、レイテンシ、その他の主要な統計情報

詳細なアーキテクチャは以下の通りです。 


実際の動作のデモはこちらです。 

結論

Locustは優れた負荷テストツールですが、LLMのテストにはそのままでは適していません。
LLM Locust は、今日の強力な言語モデルを適切にベンチマークするために必要な、ストリーミングおよびトークンレベルの精度を提供します。

自社インフラにオープンソースモデルをデプロイする場合でも、LLM API間でパフォーマンスを比較する場合でも、LLM Locustは 明確さ、柔軟性、そして制御 を適切に行うための手段を提供します。

Githubリンク: https://github.com/truefoundry/llm-locust

よくある質問

LLM Locustとは何ですか?

LLM Locustは、Locustフレームワークを基盤として構築されたオープンソースのベンチマークツールで、大規模言語モデル(LLM)の評価に特化しています。標準的な負荷テストツールとは異なり、本番環境でモデルが高い同時実行トラフィックを処理できることを保証するため、最初のトークンまでの時間(TTFT)や1秒あたりのトークン数といった生成AIに特化したメトリクスを測定します。

LLM Locustは言語モデルのパフォーマンス テストにどのように役立ちますか?

ストリーミング応答とトークン生成レートを分析することで、モデルが重い同時負荷の下でどのように動作するかについて深い可視性を提供します。このデータにより、エンジニアはインフラストラクチャを最適化し、デプロイ前に潜在的なボトルネックを特定し、さまざまなハードウェアおよびサービングエンジンの構成全体で、エンドユーザーに対して一貫した応答速度を保証できます。

LocustはLLM APIの負荷テストに使用できますか?

はい、標準的なLocustは基本的なAPIには機能しますが、LLM Locustは生成AIの独自の要件に合わせて特別に設計されています。ストリーミング応答を正確に追跡し、複数の同時リクエストにわたるスループットを計算することで、従来の負荷テストツールと比較して、LLMがどのようにスケールするかをより明確に把握できます。

LLM LocustをLangfuseのような可観測性ツールとどのように組み合わせますか?

LLM LocustをLangfuseのようなプラットフォームと統合することで、高負荷テスト中のパフォーマンス トレースをダッシュボードで直接視覚化できます。特定の負荷パターンとモデルの障害やレイテンシーの急増を関連付けることができ、実際のプレッシャー下での自律エージェントの信頼性と品質に関する深い洞察を提供します。

LLM LocustをTrueFoundryとどのように使用しますか?

TrueFoundryでLLM Locustを実行すると、プライベートクラウド内にデプロイされたモデルをベンチマークできます。vLLMやTGIのような異なるサービングエンジンを簡単にテストして、特定のハードウェアに最適な構成を見つけ、デプロイがコストと速度の両方で完全に最適化されていることを保証できます。

Try now.

One gateway for all your models, MCP servers, and agents.
No credit card needed.

Start free
Table of Contents

One Gateway for Every LLM, Agent and MCP Server

Book a 30-min with our AI expert

Book a Demo

The fastest way to build, govern and scale your AI

Book Demo
Summarize with
ChatGPT logo by OpenAI
Perplexity AI logo
Blurry red snowflake on white background, symmetrical frosty design with soft edges and abstract shape.

Discover More

No items found.
August 17, 2026
|
5 min read

Sandboxed Code Agents: Let Models Execute Without Letting Them Roam

No items found.
Portkey AI Gateway Pricing
August 15, 2026
|
5 min read

2026年版 Portkey AI Gateway 料金:完全ガイドと比較

No items found.
MCP registry connecting agents to governed MCP servers
August 15, 2026
|
5 min read

2026年版 最高のMCPレジストリ:開発者と企業向け比較

No items found.
TrueFoundry AI gateway powers enterprise AI platform engineering at scale
August 15, 2026
|
5 min read

AIプラットフォームエンジニアリングとは?エンタープライズチームのための実践ガイド

No items found.
No items found.

Recent Blogs

Black left pointing arrow symbol on white background, directional indicator.
Black left pointing arrow symbol on white background, directional indicator.
Take a quick product tour
Start Product Tour
Product Tour