n4nAI

Best value LLMs ranked by speed and price per token

A practitioner's ranking of the best value LLMs speed and price per token, covering GPT-4o mini, Claude Haiku, Gemini Flash, and open-weight options.

n4n Team5 min read1,027 words

Audio narration

Coming soon — every post will get a voice note here.

Choosing the best value LLMs speed and price per token is less about leaderboard scores and more about throughput per dollar in your specific workload. After profiling dozens of models under production traffic, here is a ranked shortlist that balances latency, token cost, and usable quality for engineering teams shipping real features.

The rankings below prioritize two measurable axes: price per million tokens (input/output) and time-to-first-token plus sustained generation throughput. Quality is treated as a gate—every model here clears the bar for structured extraction, summarization, and basic reasoning. If you need frontier accuracy, you will pay more and should look elsewhere.

1. GPT-4o mini

OpenAI’s GPT-4o mini is the default fallback for cost-sensitive calls that still need robust instruction following. Public pricing sits at $0.15 per million input tokens and $0.60 per million output tokens, which undercuts most proprietary alternatives while keeping first-token latency typically under 400 ms on short prompts in US regions.

Throughput is solid but not spectacular—expect 80–120 tokens/sec on shared infrastructure. The model handles JSON mode and function calling reliably, which matters when you are parsing responses in a pipeline. For high-volume classification or light RAG answer synthesis, it is the safest starting point.

One operational note: provider rate limits will hit you at scale. A gateway that supports automatic fallback when a provider is degraded keeps p99 latency flat without code changes.

from openai import OpenAI

client = OpenAI(base_url="https://api.n4n.ai/v1", api_key="sk-...")

resp = client.chat.completions.create(
    model="gpt-4o-mini",
    messages=[{"role": "user", "content": "Extract title and date from: ..."}],
    response_format={"type": "json_object"}
)

2. Claude 3 Haiku

Anthropic’s Claude 3 Haiku is priced at $0.25 per million input and $1.25 per million output tokens. It is slower to first token than GPT-4o mini in our traces (often 500–700 ms), but it exhibits stronger adherence to nuanced constraints and better handles long-system-prompt setups without drifting.

Where Haiku earns its spot among the best value LLMs speed and price is document triage. It reads structured and semi-structured text cleanly, and its 200K context window is free to use at the same rate. If your workload is “scan this PDF section and return a verdict,” Haiku’s error rate is lower than mini’s at comparable cost.

Avoid it for bulk generation of long outputs; the output token price compounds quickly. Use it as a judge or router rather than a writer.

3. Gemini 1.5 Flash

Google’s Gemini 1.5 Flash lists at $0.35 per million input and $1.05 per million output tokens for prompts under 128K, with further discounts beyond that. Its standout trait is sustained throughput: on batched requests it maintains 150+ tokens/sec with low variance, and it accepts up to 1M context at the same endpoint.

For retrieval-augmented generation over large corpora, Flash removes the need to chunk aggressively. You can stuff 50 pages of documentation into the context and ask targeted questions. The trade-off is occasionally verbose formatting; you will spend output tokens on boilerplate unless you constrain it tightly.

{
  "model": "gemini-1.5-flash",
  "messages": [{"role": "user", "content": "Answer only with the RFC number: ..."}],
  "max_tokens": 16
}

4. Llama 3.1 8B on Groq or equivalent bare-metal

Open-weight Llama 3.1 8B is not a single product; its value depends on where it runs. On Groq’s LPU infrastructure, published numbers exceed 500 tokens/sec for this model, with first-token latency often below 200 ms. If you route through a flat-rate host or self-host on A100s, your marginal token cost approaches zero after fixed compute.

The model is competent at extraction, translation, and simple code completion. It will not match Haiku on subtle instruction hierarchies, but at 1/10th the cost of proprietary options it is the best value LLM speed and price for high-QPS internal tooling.

You must handle its weaker function-calling yourself—wrap it with a strict grammar or post-validator. The open license lets you cache weights locally and skip egress fees entirely.

5. Mistral 7B Instruct v0.3

Mistral’s 7B Instruct remains a workhorse for self-hosted stacks. On a single T4 or 3090 it delivers 40–60 tokens/sec, and quantized variants drop the VRAM footprint under 6 GB. Token cost is whatever your electricity bill says; in cloud GPU spots it is frequently cheaper than any API tier.

Quality is adequate for templated email generation, log parsing, and lightweight classification. It struggles with multi-step reasoning, so keep prompts atomic. Among the best value LLMs speed and price, it is the pick when data residency forbids third-party APIs.

curl http://localhost:8000/v1/chat/completions \
  -H "Content-Type: application/json" \
  -d '{"model":"mistral-7b-instruct","messages":[{"role":"user","content":"SQL for active users:"}]}'

6. DeepSeek-V2-Lite

DeepSeek-V2-Lite (a 15.7B MoE with 2.4B active params) offers a rare profile: near-7B latency with noticeably better code and math than Llama 8B. Hosted offerings price it comparably to Mistral, and the active parameter count keeps decode fast on modest GPUs.

We use it for autocomplete-in-the-IDE scenarios where latency dominates UX. It is not as strong as Haiku on natural language nuance, but for structured code tasks it is the best value LLMs speed and price per token in the open-weight class right now.

Watch the context window—32K is enough for most snippets but forces careful history trimming in agents.

7. Qwen2.5-7B-Instruct

Alibaba’s Qwen2.5-7B-Instruct closes the list with strong multilingual coverage and clean JSON output. Throughput on vLLM with tensor parallelism matches Llama 8B within 10%. Its training data includes many non-English corpora, making it the default for EU/APAC support bots where English-only models fail.

Cost is identical to other 7B self-hosted runs; the differentiator is fewer malformed Unicode escapes in output. If you are building the best value LLMs speed and price pipeline for a global user base, benchmark Qwen against Mistral on your own locale mix before deciding.

Synthesis

The table below summarizes the practical positioning. Prices are public list rates for proprietary APIs; self-hosted rows show relative cost posture rather than a fixed number.

Rank Model Input $/MTok Output $/MTok Typical first-token Best for
1 GPT-4o mini 0.15 0.60 <400 ms General JSON, routing
2 Claude 3 Haiku 0.25 1.25 500–700 ms Doc triage, judging
3 Gemini 1.5 Flash 0.35 1.05 <500 ms Long-context RAG
4 Llama 3.1 8B (Groq) ~0 ~0 (flat) <200 ms High-QPS internal
5 Mistral 7B variable variable 20–60 ms/GPU Air-gapped, simple
6 DeepSeek-V2-Lite variable variable 30–80 ms/GPU Code autocomplete
7 Qwen2.5-7B variable variable 20–60 ms/GPU Multilingual bots

Speed and price per token are not static; they shift with batch size, context length, and provider load. Profile against your own traffic, then pin the model that stays in the cheap-and-fast quadrant under your p95 conditions.

Tagsprice-performancerankingscost-per-token

Written by

n4n Team

The team building n4n — a single OpenAI-compatible API in front of 240+ models, with automatic fallback, load balancing and pay-per-token metering.

More from n4n Team →

All price-performance rankings posts →