Benchmark data · July 2026 · Method re-checked 20 November 2026

LLM benchmark 2026: Ollama vs vLLM vs llama.cpp

We tested four local inference engines (Ollama, vLLM, llama.cpp and SGLang) on three hardware tiers with five popular models. The data was collected 8–10 July 2026 and has not been re-run since. Below are the measured tokens per second, time-to-first-token, memory use and modelled cost, with the full method so you can judge how far the numbers travel to your hardware.

Data availability: raw run logs and harness output are not published for this edition. Treat these numbers as internal single-request measurements from July 2026, not a reproducible benchmark; re-run on your hardware before sizing a deployment.

Short answer. On an NVIDIA GPU, vLLM produced the highest single-stream throughput in this test: 185.2 tokens per second on an RTX 4090 with Llama-3.1-8B, about 44% above Ollama on the same card. On Apple Silicon, llama.cpp led at 51.7 tokens per second on an M4 with the same model, about 22% above Ollama. Ollama was the easiest to set up and the slowest in every matched pair. These are July 2026 measurements on single requests, not a concurrency benchmark; re-test on your own hardware and engine versions before sizing a deployment.

Methodology

All tests were run between 8 and 10 July 2026 on dedicated hardware with no other GPU workloads. Each engine-model-hardware combination was tested 50 times with prompts of varying length (100–2,000 input tokens). Results show the median of 50 runs after 5 warm-up iterations.

Test configuration for the July 2026 local inference benchmark
EnginesOllama 0.5.x, vLLM 0.6.x, llama.cpp b4xxx, SGLang 0.4.x
HardwareMacBook M4 (24 GB unified memory), RTX 4090 (24 GB GDDR6X), 2× NVIDIA A100 (80 GB each, NVLink)
ModelsLlama-3.1-8B, Mistral-7B, Qwen2.5-7B, Llama-3.3-70B (Q4_K_M), Mixtral-8x7B (Q4_K_M)
MetricsTokens/second (output generation), time-to-first-token (TTFT), peak VRAM usage, latency p50 and p95
QuantizationFP16 for GPU, Q4_K_M for CPU/Metal, except where noted
Prompt length500 tokens (median), range 100–2,000
Output length256 tokens (fixed for all runs)
Runs50 measured runs per combination, plus 5 warm-up iterations

Benchmark results

All values are the median of 50 runs. Tokens/s measures output generation throughput only and excludes TTFT. Peak VRAM includes model weights plus the KV cache for the specified context length. Latency p50 is end-to-end request time.

Median tokens per second, time-to-first-token, peak memory and latency by engine, model and hardware (July 2026)
Engine Model Hardware Tok/s TTFT VRAM p50 p95
7B–8B models
OllamaLlama-3.1-8BM4 24GB42.3180ms6.2GB320ms580ms
OllamaLlama-3.1-8BRTX 4090128.565ms5.8GB142ms210ms
vLLMLlama-3.1-8BRTX 4090185.242ms5.8GB98ms165ms
vLLMLlama-3.1-8B2× A100312.828ms6.0GB52ms88ms
llama.cppLlama-3.1-8BM4 24GB51.7155ms6.0GB275ms510ms
llama.cppLlama-3.1-8BRTX 4090162.458ms5.9GB112ms195ms
SGLangLlama-3.1-8BRTX 4090172.648ms5.9GB105ms178ms
OllamaMistral-7BM4 24GB44.8165ms5.1GB295ms540ms
vLLMMistral-7BRTX 4090198.338ms4.8GB88ms152ms
llama.cppMistral-7BM4 24GB54.2140ms4.9GB248ms460ms
OllamaQwen2.5-7BM4 24GB41.0190ms6.5GB340ms610ms
vLLMQwen2.5-7BRTX 4090178.444ms6.2GB102ms172ms
llama.cppQwen2.5-7BM4 24GB49.3162ms6.3GB288ms530ms
30B–70B models (Q4_K_M quantized)
OllamaLlama-3.3-70BM4 24GB2.84.2s22GB*6.8s12.4s
OllamaLlama-3.3-70BRTX 40905.13.1s22GB16.2s28.5s
vLLMLlama-3.3-70B2× A100218.695ms42GB1.2s2.1s
llama.cppLlama-3.3-70BM4 24GB4.13.8s22GB*4.5s8.2s
SGLangLlama-3.3-70B2× A100201.3102ms42GB1.4s2.4s
OllamaMixtral-8x7BRTX 409022.4420ms24GB2.8s5.2s
vLLMMixtral-8x7BRTX 409038.6280ms24GB1.7s3.1s
vLLMMixtral-8x7B2× A10095.2110ms48GB620ms1.1s
llama.cppMixtral-8x7BM4 24GB5.82.1s14GB*3.9s7.5s

* Uses system RAM via unified memory, not dedicated VRAM. The M4 runs 70B models via memory swapping with a significant performance penalty.

Key takeaways from the benchmark data:

  • vLLM was the fastest on GPU — 185.2 tok/s on RTX 4090 with Llama-3.1-8B, 44% faster than Ollama on the same hardware.
  • llama.cpp led on Apple Silicon — 51.7 tok/s on M4 versus 42.3 tok/s for Ollama, a 22% improvement.
  • SGLang was close to vLLM on raw throughput — 172.6 tok/s versus 185.2 on the RTX 4090 — and adds constrained decoding that neither Ollama nor llama.cpp offers natively.
  • 70B models need server-grade hardware for usable performance. On a single RTX 4090, expect about 5 tok/s, too slow for interactive use.
  • Mixtral-8x7B is particularly challenging — its MoE architecture uses all 24 GB of RTX 4090 VRAM, leaving no room for batch size or extra context.

Engine comparison

Local inference engines compared on role, setup, GPU requirement and API surface
EngineBest forSetupGPU requiredOpenAI API
OllamaQuick experimentation, prototyping, CPU inferenceSingle binaryOptional/v1/chat/completions, /v1/embeddings
vLLMProduction throughput, high concurrency, multi-GPUpip installRequired (CUDA)Full OpenAI surface plus PagedAttention
llama.cppApple Silicon, CPU inference, edge deployment, quantisationBuild from sourceNo (CPU and Metal optimised)/v1/chat/completions, /v1/completions
SGLangComplex reasoning, structured output, constrained decodingpip installRequired (CUDA)Full surface plus constrained decoding and grammar support

Ollama

Best for: quick experimentation, simple setup, good CPU performance.

Ollama is the easiest local inference engine to install and use. A single binary, one command to pull a model, and you have an OpenAI-compatible API running on port 11434. It works on CPU, Apple Silicon and NVIDIA GPUs. Performance is good but not class-leading: on the RTX 4090 it trailed vLLM by about 31% on Llama-3.1-8B, and on the M4 it trailed llama.cpp by about 18%.

Strengths: easiest setup, large model library via ollama pull, a Modelfile system for customisation, and it runs almost everywhere.

Weaknesses: lowest throughput of the four in this test, limited batching, no PagedAttention and no native constrained decoding.

vLLM

Best for: highest throughput, production workloads, GPU servers.

vLLM is the throughput leader in this test. Its PagedAttention mechanism manages the KV cache in pages rather than contiguous blocks, which reduces memory fragmentation and allows larger batches. On the RTX 4090 with Llama-3.1-8B it delivered 185.2 tok/s, 44% above Ollama. On two A100s with tensor parallelism it reached 312.8 tok/s on the same model.

Strengths: highest token throughput, continuous batching for concurrent requests, PagedAttention, tensor and pipeline parallelism, and a broad OpenAI API surface including function calling.

Weaknesses: requires an NVIDIA GPU (CUDA), no CPU inference, more complex setup and higher VRAM overhead for small models.

llama.cpp

Best for: Apple Silicon, CPU optimisation, edge deployment.

llama.cpp is the most versatile engine for non-NVIDIA hardware. Its Metal backend on Apple Silicon delivered 51.7 tok/s on the M4 with Llama-3.1-8B, outperforming Ollama by about 22%. It supports the main quantisation formats (GGUF, IQ, Q4_K_M) and runs on hardware from a Raspberry Pi to a multi-core server.

Strengths: best CPU and Apple Silicon performance in this test, broad quantisation support, a small binary, and backends for ARM, x86, Metal, CUDA and Vulkan.

Weaknesses: lower GPU throughput than vLLM, no PagedAttention, the server path requires compilation and the OpenAI API surface is narrower.

SGLang

Best for: complex reasoning, structured output, constrained decoding.

SGLang compiles the generation graph ahead of time, which allows joint optimisation of prompt processing and token generation. Its RadixAttention caches prefix KV across requests, which helps when many calls share a long system prompt. In this test it reached 172.6 tok/s on the RTX 4090, close to vLLM. The reason to shortlist it is constrained decoding: JSON mode, tool calling and grammar-constrained generation. This test measured plain chat completion, so it does not quantify that advantage.

Strengths: strongest structured-output tooling of the four, RadixAttention prefix caching, ahead-of-time compilation and competitive raw throughput.

Weaknesses: requires an NVIDIA GPU, a smaller community than vLLM, fewer pre-built model recipes and a steeper learning curve.

Hardware guide

Choosing hardware for local inference depends on model size, latency requirement and budget. This guide is based on the measurements above and rounds them to a planning range.

Hardware tiers, the largest practical model and the engine that measured best
TierHardwareMax modelExpected tok/sBest engine
LaptopM4/M4 Pro (16–24 GB), Intel/AMD with an 8 GB GPU7B–8B (Q4_K_M)40–55 tok/sllama.cpp (Apple), vLLM (CUDA)
DesktopRTX 4090 (24 GB), RTX 5090 (32 GB)7B–30B (FP16), 70B (Q4_K_M)130–200 tok/s (7B)vLLM or SGLang
Workstation2× RTX 6000 Ada (96 GB), 4× RTX 409070B–120B (FP16)180–300 tok/s (70B)vLLM (tensor parallel)
Server2× A100 (80 GB), 8× H10070B–405B (FP16/FP8)200–400 tok/s (70B)vLLM or SGLang

Laptop tier (Apple Silicon): MacBooks with M4 chips are surprisingly capable. A 24 GB M4 ran 7B models at 40–55 tok/s with llama.cpp, fast enough for interactive chat and most development workflows. 70B models are technically possible via memory swapping but ran at 2–4 tok/s, which is too slow for practical use.

Desktop tier (RTX 4090): the RTX 4090 is the sweet spot for local inference in this dataset. Its 24 GB runs all 7B models at over 128 tok/s with any engine; with vLLM it reached 185 tok/s on Llama-3.1-8B. Mixtral-8x7B fits but fills VRAM completely, limiting concurrency. 70B models run via Q4_K_M at about 5 tok/s, usable for batch processing but not chat.

Server tier (A100/H100): datacentre GPUs with NVLink enable tensor parallelism across cards. Two A100-80GB cards ran Llama-3.3-70B at 218.6 tok/s with vLLM, competitive with cloud API performance. The advantage is large-model support: with 8× H100 you have enough memory for a 405B-class model, subject to the engine supporting it.

Cost analysis

The economics of local versus cloud inference depend on token volume. The table is the modelled total cost of ownership for the July 2026 exercise, including hardware amortisation over three years, electricity and maintenance. It is a model, not a measured bill.

Modelled cost per million tokens by deployment and monthly volume (July 2026)
Cost per million tokensLocal (M4)Local (RTX 4090)Local (2× A100)Plugsky APIOpenAI API
1M tok/mo$2.80$5.20$31.70$20.00$150.00
10M tok/mo$0.44$0.65$3.50$10.00$150.00
100M tok/mo$0.30$0.31$0.53$2.00$150.00

Local cost includes hardware amortised over three years ($1,600 M4 Mac mini, $3,000 RTX 4090 desktop, $30,000 2× A100 server) plus electricity at $0.12/kWh. The Plugsky column uses Hobby/Starter pricing for a Llama-3.1-8B-equivalent workload. The OpenAI column is the July 2026 page’s own comparison figure, not a GPT-4o-mini rate. Treat all three cloud columns as order-of-magnitude inputs for the break-even argument, not as quotes, and re-check current plan terms before you put a number in a business case.

Key findings:

  • At low volume (1M tok/mo): local inference looks cheaper per million tokens because the hardware is a sunk cost. Cloud APIs cost $20–150/MTok on the same comparison, but the upfront hardware bill ($1,600–30,000) has to be paid first.
  • At medium volume (10M tok/mo): local is cheaper for anyone who already owns the hardware and keeps it busy. Cloud at $10–150/MTok is hard to justify if a capable GPU is sitting idle.
  • At high volume (100M tok/mo): local costs $0.30–0.53/MTok in this model, approaching the marginal cost of electricity. Cloud costs $2–150/MTok on the same comparison.
  • Break-even: the page’s own model puts an RTX 4090 system ($3,000 total) at break-even against the Plugsky column at roughly 2M tokens per month over two years. Against the OpenAI column it is immediate. Both figures depend on utilisation, which is the assumption most likely to be wrong.

When local beats cloud

Local inference has clear advantages in several scenarios:

  • Privacy: data does not leave your machine. No third party sees your prompts, completions or embeddings. That matters for healthcare, legal, finance and any workload with personal data or trade secrets.
  • Latency: local GPU inference measured 88–142 ms p50 for 7B models on the RTX 4090, against the 100–500 ms range the page uses for cloud APIs. The difference is noticeable in interactive chat.
  • Offline operation: no internet required. Run the pipeline in an air-gapped environment, during travel or through a network outage.
  • Cost at high volume: beyond 10M tokens per month the modelled local cost is $0.30–3.50/MTok, against $2–150/MTok for cloud. If you have sustained throughput, local can pay for itself; if you are not sure, rent GPU capacity for a month before buying a workstation.
  • Development iteration: no rate limits, no queueing and no API cost during prompt engineering.

When cloud beats local

Cloud APIs are the better choice in other situations:

  • No hardware investment: start building immediately without buying a GPU. A paid plan starts at $8/month with no upfront cost.
  • Access to large models: cloud APIs run 70B–405B models on multi-GPU backends. Running a 405B-class model locally needs a server most teams do not own.
  • Scalability: cloud APIs scale from one request to thousands of concurrent requests. Local hardware has a fixed throughput ceiling.
  • Team access: cloud APIs provide API keys, usage tracking, team management and SSO. Self-hosting means building the auth layer yourself.
  • Model breadth: one API key reaches the whole hosted model catalogue. Local requires downloading and managing each model separately.
  • Uptime: a hosted provider carries the on-call. Local inference goes down with your internet, power or hardware failure. Plugsky’s headline is a 99.9% uptime target; the signed plan terms and exclusions govern.

Limits of this test

Read the numbers with five constraints in mind. They are the difference between a useful baseline and a misleading one.

  • Single-stream measurement. Each run measured one request at a time. The test did not measure throughput under concurrent load, which is exactly where continuous batching and PagedAttention change the ranking.
  • One prompt distribution. Prompts ranged from 100 to 2,000 input tokens with a 500-token median and a fixed 256-token output. Very long context and very short outputs will produce different latency profiles.
  • Engine versions are pinned. Ollama 0.5.x, vLLM 0.6.x, llama.cpp b4xxx and SGLang 0.4.x were current in July 2026. All four projects ship frequently, so re-run before you size hardware.
  • Quantisation differs by tier. FP16 on GPU and Q4_K_M on CPU/Metal is a sensible default, not a controlled comparison of quantisation effects.
  • One machine per tier. A single M4, a single RTX 4090 and a single pair of A100s. Thermal throttling, driver versions and background processes can move a result by several percent.

The ranking is therefore a starting hypothesis, not a procurement decision. The KV cache calculator and the VRAM calculator help translate the memory column into your own context length and concurrency.

Local to production without a rewrite

You do not have to choose between local and cloud. A productive setup develops against Ollama or vLLM, then sends production traffic to Plugsky without changing application code.

Every local engine tested here exposes an OpenAI-compatible API. Code written against any of them works against Plugsky after a base URL and key change:

python
# Local development: Ollama, vLLM, llama.cpp or SGLang
client = OpenAI(
    base_url="http://localhost:11434/v1",
    api_key="ollama",
)

# Production: Plugsky, no application changes beyond config
client = OpenAI(
    base_url="https://api.plugsky.com/v1",
    api_key="sk-live-PLUGSKY...",
)

# The rest of your code stays the same
resp = client.chat.completions.create(
    model="plugsky-pro",
    messages=[{"role": "user", "content": "Hello!"}],
)

The API host above is https://api.plugsky.com/v1. The docs also show https://plugsky.com/v1 as a documented alias; do not mix both hosts in one client.

This pattern lets you:

  • Develop locally with real models, real data, zero latency and zero API cost.
  • Test in CI against a local vLLM instance for deterministic results.
  • Deploy to Plugsky when you need production scale, team access or models your hardware cannot run.
  • Route by sensitivity — keep personal data on a local model and send general traffic to the cloud.
python
import os
from openai import OpenAI

def get_client():
    """Route based on environment."""
    env = os.getenv("APP_ENV", "development")
    if env == "development":
        return OpenAI(base_url="http://localhost:11434/v1", api_key="ollama")
    return OpenAI(
        base_url="https://api.plugsky.com/v1",
        api_key=os.getenv("PLUGSKY_API_KEY"),
    )

def route_by_sensitivity(prompt: str):
    """Route sensitive prompts locally, others to Plugsky."""
    sensitive_keywords = ["ssn", "salary", "health", "password"]
    if any(kw in prompt.lower() for kw in sensitive_keywords):
        return OpenAI(base_url="http://localhost:11434/v1", api_key="ollama")
    return OpenAI(
        base_url="https://api.plugsky.com/v1",
        api_key=os.getenv("PLUGSKY_API_KEY"),
    )

The keyword filter above is an illustration, not a compliance control. Classification belongs in your data layer, not in a string match against a prompt.

Reproducing the test

The method above is enough to reproduce the comparison on your own hardware. Use the same model files, the same prompt-length range and the same fixed output length, then report the median of at least 50 runs after warm-up. Record the engine version, driver version and quantisation with every result; without those three fields the numbers are not comparable.

Three practical notes from running this test:

  • Warm the model first. The first request after a load is dominated by weight transfer and CUDA graph capture. Discard at least five runs.
  • Measure TTFT and decode separately. A single end-to-end number hides whether a regression is in prompt processing or token generation.
  • Pin the output length. Comparing runs with different output lengths mostly measures the output length.

The July 2026 raw runs and harness are not published as a public archive on this page. If you need the underlying data for a procurement review, request it through the docs and we will confirm what exists and what can be shared.

Frequently asked questions

Which local inference engine is fastest?

vLLM delivers the highest throughput on NVIDIA GPUs (185 tok/s on RTX 4090 with Llama-3.1-8B). On Apple Silicon, llama.cpp leads at 52 tok/s on M4 with the same model. SGLang excels at structured output tasks. Ollama is the slowest but easiest to set up.

What hardware do I need for local inference?

For 7B-8B models: 16 GB RAM or 6 GB+ VRAM. For 30B models: 24 GB VRAM or 32 GB unified memory. For 70B+ models: 48 GB+ VRAM (multi-GPU) or 64 GB system RAM with quantization. Apple Silicon Macs with 16-24 GB unified memory run 7B models well via llama.cpp.

How does local inference latency compare to cloud APIs?

Local GPU inference has lower p50 latency than cloud APIs for small models (50-180ms vs 100-500ms). Cloud has higher throughput for large models due to multi-GPU backends. Local CPU inference is slower than both. For interactive chat, local GPU is noticeably snappier than cloud.

Is local inference cheaper than cloud APIs?

At low volume, local is cheaper because you already own the hardware. At 1M tokens/month, cloud costs $20/mo (Plugsky Hobby) or ~$150/mo (OpenAI). Local requires $3,000+ GPU capex upfront. Beyond 10M tok/mo, local becomes cheaper if you fully utilise your GPU. At 100M tok/mo, local costs ~$0.30/MTok vs cloud ~$0.50-2.00/MTok.

Can I use Plugsky with local inference tools?

Yes. Develop locally with Ollama, vLLM, llama.cpp, or SGLang, all of which expose an OpenAI-compatible API. When you need production scale, change your base_url to https://api.plugsky.com/v1 and swap the API key. Your chat completions, streaming, function calling, and embeddings all work identically. No code changes needed.

Related pages

Develop locally, deploy at scale

Build against Ollama or vLLM today. When you need production throughput, team access or models beyond your hardware, switch to Plugsky with a config change.

Start Free → See pricing

Sources

Engine capabilities, ports and API surfaces were checked against the linked official documentation on 20 November 2026. The benchmark figures come from the July 2026 test described above and were not re-measured for this page.

  • Ollama: OpenAI compatibility — endpoint, port and supported request fields. Checked 20 November 2026.
  • vLLM documentation — PagedAttention, continuous batching and the OpenAI-compatible server. Checked 20 November 2026.
  • llama.cpp repository — backends, quantisation formats and server binaries. Checked 20 November 2026.
  • SGLang documentation — RadixAttention, constrained decoding and supported models. Checked 20 November 2026.
  • LangGraph overview — orchestrating agents across a local or hosted model endpoint. Checked 20 November 2026.

Last checked 20 November 2026. Plugsky plan limits and prices live at /pricing; the canonical model list is at /models.