AiCredits
Throughput Lab

Token Throughput Benchmarks: DeepSeek Flash vs Pro Under Load

Run your own token throughput benchmarks for deepseek-v4-flash vs deepseek-v4-pro under real concurrency, with runnable Python and a routing policy.

Published 2026-10-25 Updated 2026-10-25 8 min

Three throughput numbers, not one

Search for token throughput benchmarks and you'll mostly find a single number: tokens per second, measured with one request in flight and a prompt nobody would actually send. That number is close to useless for capacity planning, because throughput is not a property of a model — it's a property of your workload running against that model.

Three measurements matter, and they move independently. Per-request output rate is how fast a single response streams, which is what a chat user perceives. Aggregate throughput is how many output tokens per second the endpoint sustains while many requests are in flight, which is what your batch pipeline cares about. Cost efficiency is how much usable output you get per unit of spend. deepseek-v4-flash and deepseek-v4-pro diverge most on the second and third, and barely at all on the first when your prompts are short.

Build the harness before you trust any number

The script below sweeps concurrency for both models with an identical prompt and an identical max_tokens, so the comparison is apples to apples. It uses the OpenAI SDK pointed at AiCredits and reads your key from the environment.

import asyncio
import os
import time

from openai import AsyncOpenAI

client = AsyncOpenAI(
    api_key=os.environ['AICREDITS_API_KEY'],
    base_url='https://api.aicreditsapi.com/v1',
)

PROMPT = (
    'Summarize the trade-offs between a token bucket and a sliding window '
    'rate limiter, then recommend one for a public HTTP API. About 200 words.'
)
MODELS = ['deepseek-v4-flash', 'deepseek-v4-pro']


async def one_call(model: str, max_tokens: int = 256):
    start = time.perf_counter()
    resp = await client.chat.completions.create(
        model=model,
        messages=[{'role': 'user', 'content': PROMPT}],
        max_tokens=max_tokens,
    )
    elapsed = time.perf_counter() - start
    return resp.usage.completion_tokens, elapsed


async def sweep(model: str, levels=(1, 4, 8, 16), rounds: int = 3):
    rows = []
    for concurrency in levels:
        total_tokens = 0
        total_wall = 0.0
        per_request_rates = []

        for _ in range(rounds):
            t0 = time.perf_counter()
            results = await asyncio.gather(
                *(one_call(model) for _ in range(concurrency))
            )
            total_wall += time.perf_counter() - t0

            for tokens, elapsed in results:
                total_tokens += tokens
                per_request_rates.append(tokens / elapsed)

        rows.append({
            'model': model,
            'concurrency': concurrency,
            'aggregate_tps': round(total_tokens / total_wall, 1),
            'per_request_tps': round(
                sum(per_request_rates) / len(per_request_rates), 1
            ),
        })
    return rows


async def main():
    for model in MODELS:  # warm the connection pool before measuring
        await one_call(model, max_tokens=16)

    for model in MODELS:
        for row in await sweep(model):
            print(row)


if __name__ == '__main__':
    asyncio.run(main())

Three details decide whether the output means anything. First, completion_tokens from the usage object is the only honest token count — counting streamed chunks overshoots because of role and finish chunks. Second, max_tokens must be identical across models or you're benchmarking the cap, not the model. Third, interleave the models rather than running all-flash-then-all-pro; provider-side load drifts minute to minute and sequential runs quietly bake that drift into your conclusions.

How to read the sweep

  • Aggregate throughput flattens while per-request rate keeps falling? You've hit a queue, not a compute limit. Adding workers past that point buys latency, not throughput.

  • Per-request rate stays roughly flat as concurrency climbs? You still have headroom — keep going until the curve bends.

  • Discard the first round. TLS handshakes and cold connections make round one look like a bad day.

  • Keep output length fixed. A model that writes 400 tokens where another writes 150 'wins' on wall clock and loses on tokens per second.

  • Run the sweep at the same time of day. Off-peak behaves differently from peak, and that holds for every API you'll ever benchmark.

The expected shape: flash vs pro

These are the tradeoffs to design around. Measure the actual values on your own traffic rather than trusting anyone's published chart, including ours.

Dimensiondeepseek-v4-flashdeepseek-v4-pro
Per-request output rateHigher; streams feel snappyLower; heavier compute per token
Aggregate at high concurrencyScales further before flatteningSaturates sooner; queueing arrives earlier
Quality on hard tasksGood for extraction, routing, summariesBetter on multi-step reasoning and refactors
Relative costCheaper per tokenCosts more per token
Default forChat, batch jobs, classification, lintingCode review, long-context analysis, agent planning

The practical consequence: deepseek-v4-flash is your throughput workhorse and the right default for chat, classification, extraction, summarisation, and any batch job where you pay for volume. deepseek-v4-pro spends more compute per output token, so expect a lower per-request rate and an aggregate curve that saturates at lower concurrency — the queue forms earlier. Spend pro where a wrong answer is expensive: multi-step reasoning, code review, long-context analysis, agent planning.

Time-to-first-token deserves its own number

End-to-end throughput tells you when a response finishes, not when it starts. With a human on the other end, TTFT is the number users feel, and it can only be measured on the streaming path.

import asyncio
import os
import time

from openai import AsyncOpenAI

client = AsyncOpenAI(
    api_key=os.environ['AICREDITS_API_KEY'],
    base_url='https://api.aicreditsapi.com/v1',
)


async def ttft(model: str, prompt: str = 'List five idempotency pitfalls in REST APIs.'):
    start = time.perf_counter()
    first_chunk_at = None
    chunks = 0

    stream = await client.chat.completions.create(
        model=model,
        messages=[{'role': 'user', 'content': prompt}],
        max_tokens=300,
        stream=True,
    )

    async for chunk in stream:
        if not chunk.choices:
            continue
        delta = chunk.choices[0].delta
        if delta and delta.content:
            if first_chunk_at is None:
                first_chunk_at = time.perf_counter()
            chunks += 1

    end = time.perf_counter()
    return {
        'model': model,
        'ttft_s': round((first_chunk_at or end) - start, 3),
        'e2e_s': round(end - start, 3),
        'chunks': chunks,
    }


async def main():
    for model in ('deepseek-v4-flash', 'deepseek-v4-pro'):
        print(await ttft(model))


if __name__ == '__main__':
    asyncio.run(main())

Compare TTFT at the same output length and at the concurrency you actually run. A model with excellent single-request TTFT can still queue badly under load, and that degradation is the failure mode your users notice first.

Cap concurrency instead of chasing it

The most common performance regression in LLM applications is an unbounded asyncio.gather. Fan out 500 requests at once and you don't get 500× throughput — you get a queue, a pile of timeouts, and a retry storm that makes everything slower than before. Wrap calls in an asyncio.Semaphore sized to the point where your aggregate curve goes flat, add exponential backoff with jitter, and treat a 429 as a signal to shed load rather than to retry immediately. Benchmark the semaphore value, not just the model.

Turn the numbers into a routing policy

Once you know the shape of both curves, the optimisation is obvious: stop sending traffic to pro that flash can handle. Route on cheap signals — prompt length, task keywords, whether the request is interactive — and escalate on failure.

import os

from openai import OpenAI

client = OpenAI(
    api_key=os.environ['AICREDITS_API_KEY'],
    base_url='https://api.aicreditsapi.com/v1',
)

HARD_SIGNALS = ('prove', 'refactor', 'architecture', 'stack trace', 'migrate', 'audit')


def pick_model(prompt: str) -> str:
    lowered = prompt.lower()
    if len(prompt) > 4000 or any(sig in lowered for sig in HARD_SIGNALS):
        return 'deepseek-v4-pro'
    return 'deepseek-v4-flash'


def ask(prompt: str, max_tokens: int = 800) -> str:
    model = pick_model(prompt)
    try:
        resp = client.chat.completions.create(
            model=model,
            messages=[{'role': 'user', 'content': prompt}],
            max_tokens=max_tokens,
        )
        return resp.choices[0].message.content
    except Exception:
        if model == 'deepseek-v4-pro':
            raise
        resp = client.chat.completions.create(
            model='deepseek-v4-pro',
            messages=[{'role': 'user', 'content': prompt}],
            max_tokens=max_tokens,
        )
        return resp.choices[0].message.content

Log which model you picked and how often you escalated. A healthy mix is mostly flash with a small, stable pro share. If pro's share keeps creeping up, your routing rules are too eager and you're paying for compute you never needed.

The throughput that actually bills you

Wall-clock throughput and spend are separate axes. deepseek-v4-flash costs less than deepseek-v4-pro, cache hits cost less than cold prompts, and off-peak costs less than peak. Two habits follow directly.

Keep your prompt prefix stable. Put the static system prompt and instructions first and the variable user content last, so the prefix stays cacheable. Reordering a prompt because it 'reads better' can silently turn every cached call into a cold one — a real throughput regression that no benchmark chart will show you. And avoid re-sending a long document on every turn of a conversation when a short reference will do.

Throughput is a property of your workload, not the model. Benchmark your prompts, at your concurrency, at your time of day.

Current rates for both models live on aicreditsapi.com/pricing. Re-run the sweep above whenever you change prompt length or concurrency, because those two variables will move your numbers more than any model swap.

FAQ

Can I compare flash and pro fairly from one machine?

Yes. The harness runs both models through the same client with the same prompt and max_tokens. Interleave the runs and repeat them, because the thing you can't control is provider-side load — running all of one model and then all of the other bakes that drift into your results.

Why does aggregate throughput stop improving past a certain concurrency?

You've hit either a per-key concurrency limit or the point where queueing latency outweighs the extra parallelism. The script prints per-request rate alongside aggregate, so the tell is simple: aggregate flat plus per-request dropping means stop adding workers.

Does streaming change throughput?

Not the total token count, but it changes perceived latency a lot. Measure time-to-first-token separately from end-to-end time — for chat interfaces TTFT is the number users actually feel.

Which model should be my default?

deepseek-v4-flash for nearly everything, with a rule-based escalation to deepseek-v4-pro for long prompts and hard task classes. Then measure your escalation rate instead of guessing at it.

Where do I get an API key to run this?

aicreditsapi.com issues DeepSeek API credits payable by card or PayPal — no Chinese phone number or bank account required. Set it as AICREDITS_API_KEY and the scripts above run unchanged.

Try Lint in 2 seconds

Wrote something? Paste it here for a free grammar check. No account needed.

More Tools →

Related Tools

💻Code Explainer

Was this article helpful?

| Share on X Reddit Copy link

服务器宕机了?别等用户告诉你

Wakeless 梦哨 帮你 30 秒监控网站 / API / SSL 证书,宕机秒级告警到邮箱、飞书、Slack。免费档 30 个监控,永久免费,无需信用卡。

免费开始监控 →
💬
反馈意见 / Feedback ×