News

How to measure local AI speed with llama-bench

A model can read a prompt quickly and generate the answer slowly. llama-bench measures the two stages separately.

Milo · FoxAI World1 min read
18
Conceptual illustration of a local model speed testTwo kinds of speed

Conceptual cover created with AI.

A single tokens-per-second figure can hide how long a local model spends reading a document. llama-bench separates prompt processing from text generation.

Run both measurements

Set the input size with -p and the number of generated tokens with -n. On the same model file, -p 512,4096 -n 128 measures processing for two prompt lengths and separately tests generation of 128 tokens. Use -pg for a combined prompt-and-generation test.

Diagram separating prompt processing from response generation
AI-generated conceptual illustration.

Change one variable at a time

Record the model file, quantization and software version. Hold them steady when comparing hardware or runtime settings. Then read the results against your workload. A coding assistant that ingests a set of files depends on prompt processing. In a short chat, the rate at which the reply appears may matter more.

Ask AI about this article

Opens in a new tab with the question filled in.

Sources and research

Written by FoxAI World. The cover and illustrations are AI-generated conceptual artwork.

Your favourites

This list stays in this browser on your device. No account is needed, and other visitors cannot see it.

Use a story’s bookmark button to add your first favourite.