Open-source LLM self-hosting cost: Ollama, vLLM and GPU rentals compared

Updated

This page contains affiliate links. If you buy through them, this site may earn a commission at no extra cost to you. How affiliate links work here. As an Amazon Associate I earn from qualifying purchases.

Running an open-source model yourself is cheapest when you already own a capable GPU or a recent Mac: you pay for electricity and your time, and nothing per token. Renting a GPU around the clock costs far more than a light API bill, so for light or bursty use a paid API is usually cheaper. Self-hosting pays off on cash only at sustained, high volume, or when keeping prompts on your own hardware is the point.

At a glance

Route You pay for Cheapest when Watch out for
Ollama on hardware you own Electricity, your time You already own the GPU or Mac Buying hardware only for this
GPU rental by the hour Running hours, storage Short sessions you stop afterwards Instances left running
GPU server by the month Flat fee, setup fee Steady load every day Paying for idle hours
vLLM on a rented GPU The rental Many requests at once Overkill for one person
Paid API Tokens in and out Light or bursty use Bills that grow with volume

For the wider picture, start at the self-hosted AI hub. If you have not run a model yet, read how to run an LLM yourself first; this page covers only cost.

What you actually pay for

  • Compute. Hardware you buy once, or GPU time you rent. GPU memory (VRAM) decides which models fit, so it decides which tier you need.
  • Electricity. Only at home; rental prices include it.
  • Storage. Model files are large: Ollama’s library lists the Gemma 3 12B tag at 8.2 GB and the 27B tag at 17 GB. Rentals bill disks separately.
  • Your time. Updates, downloads, monitoring and fixes. Put your own hours into the self-hosting cost calculator instead of trusting anyone’s estimate.

Ollama vs vLLM in cost terms

Both are free, open-source software; they differ in the hardware they suit and how many users they serve.

Ollama is MIT-licensed and runs on machines you may already own: its GPU docs list NVIDIA cards with compute capability 5.0 or newer, AMD cards through ROCm, Apple devices through Metal, and more through Vulkan. Its FAQ says it binds to 127.0.0.1 port 11434 by default, keeps a model loaded for 5 minutes after use, and on most backends handles one request per model at a time unless you raise OLLAMA_NUM_PARALLEL. That fits one person or a household. Ollama sells plans for its cloud models, but its pricing page says running models on your own hardware is always unlimited.

vLLM calls itself “a fast and easy-to-use library for LLM inference and serving” and claims “state-of-the-art serving throughput” from PagedAttention memory management and continuous batching of incoming requests. It ships an OpenAI-compatible API server and can split a model across GPUs with tensor parallelism. Its GPU install page lists Linux as the OS and NVIDIA GPUs with compute capability 7.5 or higher, plus AMD, Intel and Apple Silicon options. Batching lowers cost when many requests arrive at once, because one rented GPU does more work per hour. For one person sending one prompt at a time, that advantage largely disappears and Ollama is simpler.

GPU rental prices

On-demand, single-GPU prices from official pricing pages. The 730-hour column (24 x 365 / 12) is arithmetic, not a listed price.

Provider and GPU VRAM Listed price 730 hours (a 24/7 month)
Runpod RTX 4090, Community Cloud 24 GB $0.34 per hour, billed per second 0.34 x 730 = $248.20
Runpod RTX 4090, Secure Cloud 24 GB $0.89 per hour, billed per second 0.89 x 730 = $649.70
Lambda NVIDIA A10, 1 GPU 24 GB $1.29 per GPU per hour, plus tax 1.29 x 730 = $941.70
DigitalOcean RTX 4000 Ada GPU Droplet 20 GB $0.76 per GPU per hour, billed per second 0.76 x 730 = $554.80
Hetzner GEX45, RTX PRO 4000 Blackwell SFF (excl. VAT) 24 GB €214.00 per month or €0.3429 per hour, plus €209.00 one-time setup €214.00 (monthly price)
Runpod volume disk (storage) n/a $0.10 per GB per month while running, $0.20 while idle n/a

Prices checked 2026-12-05 on the Runpod, Lambda, DigitalOcean and Hetzner pricing pages.

  • Runpod charges more for a volume while the pod is idle, so delete volumes you no longer need.
  • DigitalOcean GPU Droplets have a 5-minute minimum. The page says use beyond its standard 672-hour monthly figure is still charged, so a Droplet left running costs the full 730 hours, and a powered-off Droplet bills until destroyed.
  • Hetzner’s GEX45 is a dedicated server in Helsinki. The setup fee applies to hourly billing too, so it suits only steady, long-running use. Lambda adds sales tax or VAT.
  • Vultr’s pricing page refused automated access when checked, so Vultr is left out.

Electricity for a GPU machine at home

The maths matches the home server power cost tool: watts times hours, divided by 1,000, gives kWh; kWh times your price gives the cost. The wattages are assumptions, not measurements: 40 W idle and 200 W while generating. For scale, Hetzner lists its GEX45 GPU server at 39 W idle and 188 W maximum; a desktop with a large consumer GPU can draw much more.

Scenario (assumed) kWh per day Cost per month Cost per year
2 h generating, 22 h idle (40 x 22 + 200 x 2) / 1,000 = 1.28 1.28 x 365 / 12 x 0.1817 = $7.07 $84.89
8 h generating, 16 h idle (40 x 16 + 200 x 8) / 1,000 = 2.24 $12.38 $148.56
24 h generating 200 x 24 / 1,000 = 4.80 $26.53 $318.34

Rate checked 2026-12-05: 18.17 cents per kWh, the EIA U.S. average residential price for September 2026 (preliminary). It is an average, not your rate.

Measure your own machine with a plug-in power meter, idle and while generating, and use your bill’s rate in the tool.

Hardware is not included; the home server build guide covers choosing low-idle hardware.

Standard-tier prices per million tokens from each provider’s official pricing page.

Model Input, per 1M tokens Output, per 1M tokens Notes
OpenAI gpt-6-luna $0.10 $0.50 Prompts up to 272K tokens
OpenAI gpt-6.1-terra $1.00 $5.00 Prompts up to 272K tokens
Anthropic Claude Haiku 5.5 $0.10 $0.50 Prompts up to 100,000 tokens
Anthropic Claude Sonnet 5.5 $2.00 $10.00
Google Gemini 3.5 Flash-Lite $0.30 $2.50 Paid tier
Google Gemini 3.1 Pro Preview $2.00 $12.00 Prompts up to 200k tokens

Prices checked 2026-12-05 on the OpenAI, Anthropic and Google pricing pages.

OpenAI, Anthropic and Google list batch prices at half these rates for jobs that can wait. Tokenizers differ: Anthropic says its newer models produce about 30% more tokens for the same text than its earlier ones, so compare cost per job, not only per token.

Worked example: a month of API use

Volumes are assumptions: light use is 2 million input and 0.5 million output tokens a month; heavy use is 100 times that.

Model Light month Heavy month
gpt-6-luna 2 x 0.10 + 0.5 x 0.50 = $0.45 $45.00
gpt-6.1-terra 2 x 1.00 + 0.5 x 5.00 = $4.50 $450.00
Claude Haiku 5.5 $0.45 $45.00
Claude Sonnet 5.5 $9.00 $900.00
Gemini 3.5 Flash-Lite $1.85 $185.00
Gemini 3.1 Pro Preview $10.00 $1,000.00

Arithmetic on the prices above, checked 2026-12-05.

At light volume, the cheapest API models cost less than the electricity in the 2-hour home scenario. For most individuals the plain answer is an API, or Ollama on hardware you already own.

Break-even: when a rented GPU beats an API

A GPU rented around the clock is a fixed cost. Divide it by a blended API price, assuming 4 input tokens per output token, to get the monthly volume where both cost the same. Dividing that by the seconds in a month (2,628,000) gives the average rate the GPU must sustain, day and night.

Fixed monthly cost API compared Blended price per 1M tokens Break-even tokens a month Tokens per second needed
Runpod RTX 4090 Community, 24/7: $248.20 gpt-6-luna or Claude Haiku 5.5 (4 x 0.10 + 0.50) / 5 = $0.18 1,378.9 million 524.7
Same gpt-6.1-terra $1.80 137.9 million 52.5
Same Claude Sonnet 5.5 $3.60 68.9 million 26.2
Home machine, electricity only, 24 h: $26.53 gpt-6.1-terra $1.80 14.7 million 5.6

Arithmetic on prices checked 2026-12-05 and stated assumptions; nothing was measured.

The last column is what you must check yourself. Call your setup’s real throughput T: tokens per second, input and output combined, for your model, quantization, prompt lengths and number of simultaneous users. If T is below the column, the GPU cannot produce enough tokens to break even, and adding GPUs raises the fixed cost. Idle rental hours still count.

The comparison also assumes the open model does the job. A model that fits in 24 GB of VRAM is not interchangeable with every API model above; test on your own tasks. The trade-offs beyond money are in self-hosted AI vs ChatGPT.

When self-hosting is the wrong choice

  • Light or bursty use. Occasional chats cost less through an API than the electricity for a GPU machine.
  • You need the strongest models. First test whether an open model you can afford to host is good enough.
  • You would buy a GPU only to cut a small API bill. At light volume it takes years to pay back.
  • Nobody will maintain it. Drivers and runtime updates are ongoing work.

It does make sense when you already own the hardware, when prompts must stay on your machine (Ollama’s FAQ says it does not see your prompts or data when you run locally), or when sustained, concurrent traffic keeps a vLLM GPU busy, after you have measured T.

Keep it private and patched

  • Ollama listens on localhost by default. If you change OLLAMA_HOST to reach it from other devices, use a VPN or an SSH tunnel, never the open internet. Treat a vLLM server on a rented GPU the same way, or restrict it with an IP allowlist.
  • If something must be public, put a reverse proxy with TLS and authentication in front.
  • Update the runtime, GPU drivers and operating system regularly.
  • Back up configuration, prompts and chat history; models can be downloaded again.

For automations that call your model, see self-hosted AI agents.

Frequently asked questions

Is self-hosting an LLM cheaper than using a paid API?
For light or bursty use, usually not. The cheapest API models cost very little at low volume, while a rented GPU bills for every hour it runs. Self-hosting wins on cash mainly when you already own the hardware or keep a GPU busy around the clock.
Should I use Ollama or vLLM?
Use Ollama for one person or a household on hardware you already own, including Macs. Use vLLM when you serve many concurrent requests on Linux with a supported NVIDIA or AMD GPU and want each GPU hour to do as much work as possible.
How much does electricity add for a home GPU machine?
It depends on your machine's draw, how many hours it works and your rate. The example here uses assumed wattages and the EIA U.S. average residential price for September 2026. Put your own measured watts and bill rate into the home server power cost tool.
Can I rent a GPU only for the hours I use it?
Yes. Runpod and DigitalOcean bill GPU time by the second, with a five-minute minimum at DigitalOcean. Delete instances when you finish: DigitalOcean keeps billing a powered-off Droplet until you destroy it, and Runpod bills idle volumes. Hetzner's GPU servers add a one-time setup fee, which makes short tests expensive.
Are open models as good as the paid API models in the price table?
This article does not compare quality, and model size matters a lot. Run your own tasks through the open model you can afford to host and through an API model before you decide on cost alone.

Sources, checked December 5, 2026

  1. Runpod: Pricing
  2. Lambda: AI cloud pricing
  3. DigitalOcean: GPU Droplet pricing
  4. Hetzner: Dedicated GPU servers (GEX line)
  5. OpenAI API: Pricing
  6. Claude API docs: Pricing
  7. Gemini API: Pricing
  8. Ollama on GitHub (README and licence)
  9. Ollama docs: FAQ
  10. Ollama docs: Hardware support (GPU)
  11. Ollama: Pricing
  12. Ollama library: gemma3
  13. vLLM documentation (stable)
  14. vLLM docs: GPU installation
  15. vLLM docs: Conserving memory
  16. EIA Electric Power Monthly, Table 5.6.A

More in Self-hosted AI