A fair bake-off for local and cloud models using your real tasks

Leaderboards tell you which model wins on someone else's tests. They do not tell you which provider gives the best answers to your support tickets, your product descriptions or your code reviews, at a latency and price you can accept. That is why tools for running the same prompt across several local and cloud models side by side have become popular among developers who juggle Ollama, LM Studio and hosted APIs like Groq or OpenRouter.
This guide shows how to run that comparison properly, with or without a dedicated app. You will build a prompt set from real work, write a small Python harness that sends each prompt to every provider through the OpenAI format, record latency and token usage, rate outputs blind and turn the results into a decision. The keyless free-ai endpoint on this site is included as one of the contestants, since it costs nothing to add.
Frequently asked questions
Why not just trust public benchmarks?
Public benchmarks measure general skills on fixed datasets, some of which may have leaked into training data. Your prompts, language, domain and format requirements differ. A model that ranks lower overall can be the best for your specific task, and the reverse happens too.
How many prompts do I need for a useful comparison?
Thirty to fifty well-chosen prompts are enough to see clear differences for one use case. Include typical cases, hard cases and edge cases. More prompts reduce noise but take longer to rate by hand.
What should I measure besides quality?
Time to first token, total time, output tokens, error rate and cost per request. For structured tasks, also measure the share of outputs that parse correctly. A slightly better model that fails one call in ten may lose overall.
How does blind rating differ from normal rating?
In blind rating, the rater does not know which model produced which output. It removes brand bias and expectation effects, which are surprisingly strong. Shuffle outputs and hide provider names before rating.
Can I use an LLM as the judge?
Yes, for a first pass on large sets, with care. Model judges have biases, for example favouring longer answers or their own style. Validate the judge against your own ratings on a sample before trusting it.
Should I compare local and cloud models in the same run?
Yes, if they expose the same API format. Most local runtimes offer an OpenAI-compatible server, so the harness treats them like any other provider. Keep in mind that local speed depends on your hardware, not on the model alone.
How often should I rerun the benchmark?
Whenever a provider changes models, you change prompts, or prices and limits shift. Hosted models are updated without much notice, so a quarterly rerun of a small set is a reasonable habit for anything in production.
Do desktop benchmarking apps replace a script?
For quick side-by-side checks, a desktop app that sends one prompt to several local and cloud models is convenient and visual. A script is better for repeatable runs over many prompts, for logging errors and timing to a file and for rerunning the same set months later.
Step by step
- Collect real prompts — Pull thirty to fifty prompts from real usage, covering typical, hard and edge cases, and note what a good answer looks like.
- List the providers — Write each provider's base URL, key variable and model name into a configuration list.
- Run the harness — Send every prompt to every provider with the same settings, recording output, timing and token usage.
- Rate blind — Shuffle outputs, hide provider names and score each answer on a simple rubric.
- Combine the numbers — Put quality, latency, reliability and cost side by side and pick per task, not overall.
Start from real work, not trivia
The prompt set decides what the benchmark measures. Riddles and general knowledge questions measure riddles and general knowledge. If you plan to use a model for summarizing customer emails, the prompts should be customer emails with your system prompt, in the languages your customers write in.
Pull prompts from logs if you have them, removing personal data, or write them based on real tasks. For each prompt, note what a good answer must contain or avoid. These notes become your rating rubric and save time later.
Include the awkward cases
Add prompts that tripped up your current model: very long inputs, ambiguous requests, mixed languages, strict formats. Differences between models show up most on hard cases; easy prompts make every model look similar.
Remove personal data
Benchmark prompts go to several third-party services. Replace names, emails and account numbers with realistic placeholders before sending anything.
Configuring providers in one list
Because most providers and local runtimes speak the OpenAI chat completions format, a benchmark can treat them uniformly: a name, a base URL, an environment variable holding the key and a model name. Local servers usually accept any key. The keyless endpoint here accepts any string too.
Keep keys in the environment
Never paste keys into the script or a shared spreadsheet. Read them from environment variables so the harness can be committed and shared safely. And use your own keys only; shared or leaked keys belong to someone else and can be revoked mid-run.
- Keyless: base URL https://api.apifreegroqkey.com/v1, model free-ai, any key
- Groq: its OpenAI-compatible base URL from the docs, your own key, a model from its catalog
- Local runtime: http://localhost with the runtime's port, the loaded model's name
- Aggregators: their base URL and model identifiers, your own key

A minimal benchmark harness
The script below runs every prompt against every provider, streams the response to measure time to first token, and writes results to a CSV file. It pauses between calls to stay within rate limits. Add providers by appending to the list.
Same settings for everyone
Use identical system prompts, temperature and maximum tokens across providers. Differences in settings produce differences in output that have nothing to do with the model.
Record errors, do not hide them
Timeouts, 429 rate limits and 503 busy responses are part of a provider's real behaviour. Count them. A provider that fails often under your traffic pattern is a worse choice even if its answers are good.
import csv, os, time
from openai import OpenAI
PROVIDERS = [
{"name": "keyless", "base": "https://api.apifreegroqkey.com/v1", "key": "free", "model": "free-ai"},
{"name": "local", "base": "http://localhost:11434/v1", "key": "local", "model": "llama3.1:8b"},
]
if os.environ.get("GROQ_API_KEY"):
PROVIDERS.append({"name": "groq", "base": "https://api.groq.com/openai/v1",
"key": os.environ["GROQ_API_KEY"], "model": os.environ.get("GROQ_MODEL", "set-a-model")})
PROMPTS = [line.strip() for line in open("prompts.txt", encoding="utf-8") if line.strip()]
SYSTEM = "You are a concise support assistant. Answer in under 120 words."
with open("results.csv", "w", newline="", encoding="utf-8") as f:
out = csv.writer(f)
out.writerow(["provider", "prompt_id", "ttft", "total", "output", "error"])
for p in PROVIDERS:
client = OpenAI(base_url=p["base"], api_key=p["key"], timeout=120)
for i, prompt in enumerate(PROMPTS):
start, first, text, err = time.perf_counter(), None, "", ""
try:
stream = client.chat.completions.create(
model=p["model"], stream=True, temperature=0.3, max_tokens=400,
messages=[{"role": "system", "content": SYSTEM}, {"role": "user", "content": prompt}])
for ev in stream:
d = ev.choices[0].delta.content if ev.choices else None
if d:
first = first or time.perf_counter() - start
text += d
except Exception as e:
err = type(e).__name__
total = time.perf_counter() - start
out.writerow([p["name"], i, f"{first or 0:.2f}", f"{total:.2f}", text, err])
time.sleep(1.2)Rating outputs without bias
Once results are in, export them to a sheet with columns for prompt, output and a hidden provider column. Shuffle the rows. Rate each output against your rubric on a simple scale, such as zero for unusable, one for usable with edits and two for ready to use. Only reveal providers after rating is done.
If several people rate, have them rate the same sample independently and compare. Large disagreements usually mean the rubric is vague, not that the raters are wrong. Tighten the rubric and try again.
Write down the rubric before you see any outputs and keep it short: three or four criteria per task, such as factual accuracy against the source, following the format, appropriate length and tone. A rubric written after reading outputs tends to reward whatever the first impressive answer happened to do.
Pairwise comparison
An alternative to absolute scores is to show two outputs for the same prompt and ask which is better. People are more consistent at choosing between two answers than at assigning numbers, and the results convert easily into rankings.

Using a model as a judge, carefully
For hundreds of prompts, manual rating becomes tedious. A strong model can pre-rate outputs against your rubric, but it brings biases: preference for longer answers, for its own writing style and for the first option shown. Mitigate them by randomizing order, asking for a short justification before the score and checking agreement with your own ratings on a sample of thirty or so.
If the judge disagrees with you often, do not use it for the final decision. Use it to flag clearly broken outputs and rate the rest yourself.
Do not let a contestant judge itself
A model rating its own outputs tends to favour them. Use a judge from a different family than the models being compared, or at least rotate judges.
Reading speed numbers correctly
Latency figures from a benchmark reflect conditions at the moment you ran it: your network, the provider's load, your local GPU. Run speed tests at different times of day and report the median and the slow tail. Our article on time to first token explains why the wait before the first word often matters more than raw generation speed.
Local models depend heavily on hardware and quantization. A result on your workstation says little about a colleague's laptop. Note the hardware and model file alongside the numbers so the comparison can be repeated.
Separate warm and cold runs
Local runtimes load models on the first request, which can take many seconds. Discard or report the first call separately so it does not distort the averages.

From numbers to a decision
Put the results in one table per task: average quality, share of ready-to-use answers, median and slow-tail latency, error rate and estimated cost per thousand requests. Often there is no single winner. One provider leads on quality for long answers, another on speed for short ones, and a local model wins on privacy for sensitive inputs.
That is a good outcome. It tells you to route tasks to different models instead of forcing one choice everywhere. Our guide to LLM routing shows how to put such a split into code, and the comparison of subscriptions and per-token pricing helps with the cost column.
Finally, write the decision and its reasons in a short note next to the results. When someone asks in six months why the team uses a particular provider for a task, the note and the data answer the question, and they make it easy to revisit the choice when conditions change.
Weigh what matters to you
Assign rough weights to quality, speed, reliability and cost before looking at results. Deciding weights afterwards makes it too easy to justify the provider you already liked.
Notes on the keyless contestant
Adding the keyless endpoint to a benchmark costs nothing and gives a useful reference point: free-ai is an independent open-weight model of about 35B parameters, tuned to refuse less than commercial assistants. It is not a model hosted by Groq, and this site is not affiliated with Groq. Expect it to do well on short, well-specified tasks and to trail large commercial models on complex reasoning and long-form writing.
Its limits shape how you run the benchmark: one request per second per IP with small bursts, two parallel requests, a 32,000-token context and up to 16,000 output tokens. The pause in the harness keeps you within them. There is no SLA, so a few 503 responses at busy times are normal and should be retried after a few seconds.
Try reasoning mode as a separate contestant
The optional "reasoning": true flag makes the model think before answering. Treat it as a separate entry in the benchmark, with max_tokens raised to 2000 or more, because it changes both quality and latency.
Keep the results file
Save the CSV and ratings with the date and model names. When a provider updates its model months later, rerunning the same prompts and comparing with the old file shows exactly what changed.

Send a request to the keyless free-ai endpoint from the home page and see how it fits your project, no sign-up needed.
Read also
- How to Build a Devil's Advocate Generator With a Chat API
- How to Clean Up Speech-to-Text Dictation With an LLM API
- How to Build a Document Q&A Service With FastAPI and an LLM API
- What Is Graph RAG, and When Does It Beat Plain Vector Search?
- LangChain vs the Plain OpenAI SDK: Which Should Your LLM App Use?