All entries

    TTFT, TPOT and Tokens per Second: Benchmark a Local Coding Model Honestly

    Measure local LLM responsiveness with TTFT, per-token timing and throughput. Use monotonic clocks, fixed workloads and explicit failure counts.

    A pixel-art timing laboratory where the first token arrives at one clock and later tokens travel along a separate conveyor.
    Original GPT-generated pixel-art editorial illustration; conceptual artwork, not a product screenshot or test result.

    Tokens per second is not a complete description of a local coding model. A model can start late and then decode quickly, or start quickly and stream slowly. Measure time to first token, the timing after that first token, full completion time and throughput under a declared workload. Report failures too.

    Choose the user experience you are measuring

    For an interactive code assistant, the delay before useful output matters. For a background batch, completed work over a time interval may dominate. Write down the question before running the benchmark so you do not select a favourable metric afterwards.

    Specify the model revision, quantisation, hardware, runtime, context limits and test inputs. Keep cold loading separate from warm inference. If one run loads the model from disk and another reuses a warm process, the comparison measures more than model-generation speed.

    Use a monotonic clock and a clear start point

    A monotonic timer is suited to elapsed intervals because wall-clock adjustments should not change a duration. Define when timing starts: entering an application queue, sending an HTTP request or starting server execution. Client and server timings can both be useful, but they answer different questions.

    In streaming APIs, a keep-alive or metadata event is not necessarily a generated token. Inspect the protocol and identify the first actual output event. Use the provider's reported token count or a documented compatible counting method; do not treat each network chunk as exactly one token.

    EXPLAINED / SEQUENCE

    One request has multiple intervals

    A timing model rather than a chart of measured model performance.

    Before output

    1. Submission

      Start the client-observed monotonic timer.

    2. First token

      Record when the first actual output token is observed.

    After output begins

    1. Streaming

      Observe later output and distinguish tokens from transport chunks.

    2. Completion

      Record final status, output token count and elapsed time.

    THE KEY DISTINCTION

    A transport chunk can contain several tokens. Do not count chunks as tokens without a justified mapping.

    Author-created explanatory diagram. Arrows show the process described in the article, not measured performance.

    Check the arithmetic with a synthetic fixture

    The following toy request begins at zero, produces its first token at 800 milliseconds, finishes at 2,800 milliseconds and contains 21 output tokens. The two-second interval after the first token spans 20 token intervals. Its average is 100 milliseconds per interval. These numbers are invented solely to make the calculation inspectable.

    JavaScript — synthetic timing fixture, not hardware results
    const run = { start: 0, first: 800, end: 2800, tokens: 21 };
    const ttftMs = run.first - run.start;
    const tpotMs = run.tokens > 1
      ? (run.end - run.first) / (run.tokens - 1)
      : null;
    console.log({ ttftMs, tpotMs }); // 800 ms, 100 ms

    Report distributions and denominators

    Retain raw request observations so you can compute a median and tail values rather than only an average. A few long waits can matter disproportionately in an interactive product. State the number of attempts and how many completed, timed out or failed.

    Scroll the table horizontally to see all columns.

    Report distributions and denominators
    FieldWhy retain itMistake it prevents
    Input sizePrompt processing affects response timingComparing tiny and long-context prompts as equals
    Output sizeCompletion time depends on answer lengthRewarding a model merely for stopping early
    First-output timeSeparates initial wait from streamingHiding a long silent delay behind fast decoding
    Final statusPreserves failed attemptsDropping timeouts from the result
    ConcurrencyDescribes offered loadComparing an idle run with a saturated server

    Distinguish throughput from per-request speed

    Aggregate throughput divides completed output by a declared observation interval. It can rise when a server batches more requests even if an individual request becomes slower. State whether the interval includes warmup, queue drain and failures. Different measurement windows can produce different-looking totals from the same workload.

    Do not multiply one request's speed by a concurrency setting and call that measured server capacity. Run the concurrent workload and observe it. If you cannot run the hardware, publish the method or a clearly labelled simulation rather than a fabricated ranking chart.

    Keep answer quality in the experiment

    A coding model that returns invalid code quickly has not necessarily improved the product. Use a fixed set of tasks with meaningful checks such as compilation, tests, schema validation or a reviewed expected behaviour. Keep those quality results beside timing and cost.

    Also distinguish model execution from the complete agent workflow. Tool calls, retries, repository inspection and test execution add time and can improve correctness. A raw decoding benchmark does not describe that whole workflow. Report the boundary you actually measured.

    Publish enough detail to reproduce the claim

    Include configuration, workload, counting method, timing definitions and failure counts with any future results. Use charts generated from the retained data, not image-generated bars. The strongest benchmark is one whose limitations a reader can understand before using it to choose a model or buy hardware.

    Frequently asked questions

    What is TTFT? Time to first token is the interval from the chosen request start to the first observed output token. State whether your measurement includes client queueing and network time.

    How should I calculate TPOT? State your definition. One common post-first-token average divides completion time minus first-token time by the number of output tokens minus one, excluding cases with fewer than two output tokens.

    Can I compare two published tokens-per-second numbers directly? Only with compatible definitions and conditions. Model, hardware, quantisation, prompt length, output length, concurrency, warmup and failure handling can all change the result.

    FURTHER READING

    Sources

    Technical references checked .

    END OF ENTRY / 130
    Eeshan Singh with Big Ben in London
    BEHIND THE JOURNAL

    Eeshan Singh

    I’m Eeshan Singh Pokharia, an AI Full Stack Developer and CoFounder of UltraFit360. I work across AI features, full-stack product development, and web and mobile experiences—from Figma and frontend interactions to the systems behind them.

    The worked timing fixture below is intentionally synthetic and can be checked with ordinary JavaScript. It explains the calculation; it is not evidence about a GPU, model ranking or our private AI coach.

    Meet the author
    THE CONVERSATION

    Your side of the story.