---
title: "The Real Cost of a Self-Hosted Coding LLM: Energy, ROI and Concurrency on a 16GB GPU"
description: "What self-hosting a coding LLM on a 16GB GPU really costs versus the APIs and Copilot, and how many developers one card can serve. Measured energy, ROI and the honest limits."
canonical: "https://www.mauriziofonte.it/blog/post/self-hosted-coding-llm-cost-energy-roi-16gb-gpu.html"
author: "Maurizio Fonte"
date: "2026-07-12T11:35:00+02:00"
modified: "2026-07-12T11:35:00+02:00"
section: "Cloud"
tags: ["Cloud", "LLM"]
license: "Riuso e citazione consentiti con attribuzione e link alla fonte"
---

[Cloud](https://www.mauriziofonte.it/blog/cat/cloud-infrastructure.html) [LLM](https://www.mauriziofonte.it/blog/cat/llm.html)

# [The Real Cost of a Self-Hosted Coding LLM: Energy, ROI and Concurrency on a 16GB GPU](https://www.mauriziofonte.it/blog/post/self-hosted-coding-llm-cost-energy-roi-16gb-gpu.html)

Domenica 12 Luglio 2026, alle 11:35 ![The Real Cost of a Self-Hosted Coding LLM: Energy, ROI and Concurrency on a 16GB GPU](https://www.mauriziofonte.it/image/005440200-self-hosted-coding-llm-cost-energy-roi-16gb-gpu.jpg)

In the [companion benchmark](https://www.mauriziofonte.it/blog/post/ornith-vs-qwable-9b-coding-agent-benchmark-16gb-gpu.html) I put two 9-billion-parameter coding agents through a full agent loop on the same 16GB **NVIDIA RTX 5060 Ti** and concluded that both are genuinely usable, and that the choice between them is a question of *path economy*, not raw capability. That answers **which model**. This piece answers the question a decision-maker asks next, and the one that actually decides whether a sovereign coding stack is a good idea or an expensive hobby: **what does it cost to run, and how far does one card stretch?** I measured the power draw on the card rather than guessing from the TDP, priced the energy against the 2026 list rates of the APIs and GitHub Copilot, and mapped the VRAM budget to see how many developers a single 16GB GPU can actually serve. It sits alongside the two earlier parts of the series, the [strategic case for local inference](https://www.mauriziofonte.it/blog/post/running-llm-locally-16gb-consumer-gpu-rtx-5060-ti.html) and the [35B MoE teardown](https://www.mauriziofonte.it/blog/post/qwen3-6-35b-a3b-rtx-5060-ti-llama-cpp-benchmark.html).

Full disclosure, unchanged across the series: I use Claude and Fable in production every day, and I am quoting Anthropic's own published prices below. This is not an anti-vendor argument, it is a cost model. The frontier APIs remain superior in raw capability; the question here is narrower and purely economic.

## TL;DR

> - **Measured, not guessed:** a 9B coding model draws about 131 W under sustained decode on this 16GB card, roughly 0.83 kWh per million output tokens.
> - **Marginal cost is one to two orders of magnitude below the APIs:** about a quarter-euro of energy per million output tokens against $5 (Haiku 4.5) up to $50 (Fable 5). You do not need a euro-dollar conversion to see a gap that size.
> - **The card pays off on token volume, not autocomplete:** a heavy agentic developer or a small team recovers a ~€500 card in months; a solo developer who only wants inline completion never beats Copilot's flat $10 unlimited plan.
> - **16GB is a single-active-stream device:** roughly 580,000 tokens of total KV-cache budget, and the fast path (`-np 1`, speculative decoding) is single-slot by design. You scale by adding cards, not sessions.
> - **The real case is utilization plus sovereignty:** self-hosting wins for sustained multi-seat agentic work and for data that legally cannot leave, not as a blanket "cheaper for everyone".

## What does a self-hosted coding model cost to run?

Almost nothing per token in energy, but the honest number has to be measured, not derived from the card's rating. The RTX 5060 Ti carries a 180 W TDP, and the lazy way to model cost is to assume it runs there. It does not: decode on a quantized LLM is **memory-bandwidth bound**, so the compute units are often idle waiting on VRAM, and the card never approaches its power ceiling during generation. Sampling the board power with `nvidia-smi` during sustained decode gives the real figures.

| State | Power draw | Note |
| --- | --- | --- |
| Idle (model resident, no request) | 9.6 W | weights loaded, waiting |
| Sustained decode (~44 t/s output) | ~131 W (median 134, peak 138) | bandwidth-bound, never nears the 180 W TDP |

From there the arithmetic is direct: at ~131 W and ~44 output tokens per second, one million output tokens takes about 6.3 hours of decode and burns roughly **0.83 kWh**. Prefill (reading the prompt) is an order of magnitude cheaper per token, so output tokens dominate the energy bill, exactly as they dominate the API bill. Converting that to money needs a price for electricity, and here I use a *verifiable, dated* source rather than a round guess: the [Eurostat household electricity statistics](https://ec.europa.eu/eurostat/statistics-explained/index.php?title=Electricity_price_statistics) put the EU average at **€0.29/kWh** in the second half of 2025, ranging from **€0.11/kWh in Hungary** to **€0.40/kWh in Ireland** (Germany sits near the top at €0.39). So a million output tokens costs about **€0.24 of electricity** at the EU average, and between roughly €0.09 and €0.34 depending on which member state you plug the card into.

## Is a self-hosted model actually cheaper than the API?

On the marginal cost of a token, yes, by one to two orders of magnitude, and the gap is so wide that the euro-versus-dollar question does not even change the answer. Anthropic's [published API prices](https://platform.claude.com/docs/en/about-claude/pricing) (checked July 2026) bill **output** tokens as follows, per million:

| Source | Marginal cost per 1M output tokens |
| --- | --- |
| Self-hosted on this card (energy only) | ~€0.24 (EU average; €0.09 Hungary to €0.34 Ireland) |
| Claude Haiku 4.5 | $5 |
| Claude Sonnet 5 | $10 (introductory, $15 from September 2026) |
| Claude Opus 4.8 | $25 |
| Claude Fable 5 | $50 |

I am deliberately **not** converting euros to dollars in that table, because inventing an exchange rate to compare two published prices is exactly the kind of false precision I avoid. I do not need to: a quarter of a euro against five to fifty dollars is **one to two orders of magnitude** whichever way the euro-dollar rate swings, and OpenAI's frontier tier ([its own pricing page](https://openai.com/api/pricing/)) sits in the same upper band. The self-hosted marginal cost is energy plus nothing, because the weights are already on your disk and the model does not meter you.

That table also *understates* the local advantage, in two ways. It counts only output tokens, but the APIs bill **input** as well, every token of your system prompt, your tool schemas and the files you paste into context, at their own per-million rate, whereas locally that prefill is a handful of extra watt-seconds. And it ignores that prompt caching, the main lever for cutting an API bill, discounts input reads but never touches output, which is the expensive half. Add up the whole invoice on a token-heavy agentic workload and the gap widens rather than narrows.

That marginal picture is only half the ROI, though. The card is **capex**, roughly €450 to €500 at 2026 EU retail for a 16GB 5060 Ti, and whether it pays back is a pure **utilization** question. Against a mid-tier API at ten to fifteen dollars per million output tokens, a ~€500 card recovers its cost somewhere in the low tens of millions of output tokens. In practice that means a heavy agentic developer, the kind generating a few million output tokens a month across coding sessions, breaks even in **months, not years**; a five-person team sharing one card gets there in a couple of months and runs near-free afterwards. An under-used card, by contrast, is pure loss: the economics reward sustained volume, not occasional prompts.

> The self-hosting case is a utilization-and-sovereignty case, not a "cheaper for everyone" case. On heavy, sustained, multi-seat agentic workloads, or on data that legally cannot leave the building, the card wins comfortably. For a hobbyist's occasional question, the flat-rate cloud plan is both cheaper and less work.

If cost governance for an AI-assisted dev team is the actual problem you are trying to solve, that trade-off (which workloads to keep local, which to route to an API, where the break-even really sits for your volume) is the kind of sizing I do in my [hub on AI automation for companies](https://www.mauriziofonte.it/ai-aziende/ai-aziende-automazione.html), where the methodology matters more than the demo.

## Does that beat GitHub Copilot's price, not just the token APIs?

For agentic chat it wins the same way; for plain autocomplete it does not, and pretending otherwise would be dishonest. Inline completion is where local inference shines on latency (the companion benchmark measured a dedicated 7B model completing at 22 ms warm), but latency is not the whole cost. GitHub's [Copilot plans](https://github.com/features/copilot/plans) put the **Pro tier at $10 a month flat, with unlimited code completions** that are not metered and do not consume the credit pool, a status the June 2026 billing changes left untouched (those touched code review, not completion). Against an unlimited flat $10, a €500 card bought *only* to autocomplete for a single developer essentially never pays for itself.

The point is that autocomplete is the wrong thing to justify the hardware with. **The card earns its keep on agentic and chat token volume**, where the APIs charge those 19-to-192-times multiples over self-hosted energy, and where a heavy user burns millions of output tokens a month. Buy the GPU for the agent loop; the fact that it also serves inline completion (with the co-residency swap tax the benchmark documented) is a bonus, not the business case.

## How many developers can one 16GB card serve?

One at a time, effectively, and this is the limit people underestimate. The constraint is the **KV cache**, the per-token memory every attention step reads, and I measured its growth directly on the card. On the 9B model at a `q4_0` cache the base cost (weights, CUDA context, compute buffer) is about **8.3 GiB**, and the cache then grows dead-linearly at roughly **13 KiB per token**. Of the ~15.75 GiB usable on a 16 GB board, that leaves a fixed KV budget of about **7.4 GiB, or ~580,000 tokens total**, and, crucially, that budget is *shared* across every concurrent session, because llama.cpp splits one context window across its sequence slots.

| Configuration | KV used | Fits in 16GB? |
| --- | --- | --- |
| 1 session at 262K context | ~3.4 GB | yes, room to spare |
| 2 sessions at 256K | ~6.8 GB | at the ceiling |
| 8 sessions at 64K | ~6.7 GB | yes |
| 15 sessions at 32K | ~6.3 GB | yes |
| 8 sessions at 128K | ~13.4 GB | no (8×128K far exceeds the 580K budget) |

So several developers co-reside only at *modest* per-user context, and a single long-horizon agentic run, the kind that reaches tens of thousands of tokens, already claims a large slice of the budget on its own. The deeper limit is not even memory: the throughput-optimal serving configuration is a **single sequence slot** (`-np 1`), and the speculative-decoding speedup that makes decode fast *requires* it, so the fast path is single-stream by construction. Serving many users concurrently means giving up that fast path and sharing one card's fixed ~448 GB/s of bandwidth between them.

> A 16 GB card is a single-active-stream workstation device. It has no headroom to give several developers a full agentic context at once, and it cannot both run the fast speculative path and fan out across users. You scale this architecture by **adding cards, not slots**.

That is the honest ceiling, and it reframes the ROI. The "team of five shares one card and breaks even in two months" math holds only if those five are not all running long agentic sessions at the same instant; the moment they are, you are buying a second and third GPU, and the per-developer capex climbs back toward the point where a metered API, or a mix of local and cloud, is the pragmatic answer.

## So when does self-hosting a coding model make sense?

When you have sustained token volume, or data that cannot legally leave, or both, and not otherwise. The wrong question to ask of a €500 local setup is whether it matches today's frontier: it plainly does not, and I am not going to dress it up with a benchmark score, because leaderboard numbers rot in weeks and I do not trust them as evidence. The right question is whether it is *seriously usable*, and my own measurements answer that directly. On a real cross-file debugging task it finds every root cause with minimal, idiomatic fixes, in Python, PHP and TypeScript alike; it resists a planted red herring; it never regresses working code; and it holds perfect tool-call protocol reliability across hundreds of calls. The capability that not long ago lived only behind a frontier cloud API now runs on a card that costs less than a phone, with the data never leaving the room. That compression is the story, and it does not need a scoreboard to be true.

What the economics add is discipline. Self-hosting is not a way to make AI free; it is a way to **move a variable, metered, jurisdiction-dependent cost into a fixed, owned, private one**, which is a good trade precisely when your volume is high and your data is sensitive, and a bad one when your usage is light and your data is ordinary. The card, the energy bill, the single-stream ceiling and the swap tax are all real, and a serious plan accounts for them instead of waving at "local is cheaper". If you are weighing a sovereign inference tier for a development team and want the break-even worked out against your real token volume and your real compliance constraints rather than a vendor's slide, the [free scoping form](https://www.mauriziofonte.it/pages/preventivo-gratuito.html#consulenza-ai) takes about two minutes and tells you honestly whether the numbers favour a card under the desk, an API, or the boring, correct mix of both.

Dall'articolo al lavoro vero

Se questo server lo devi tenere in piedi tu

Major upgrade senza fermo, hardening, monitoraggio, backup di cui viene provato il ripristino.

[Vedi come lavoro sui server](https://www.mauriziofonte.it/servizi/consulenza-it-devops.html)

Free tools for this article

They run in your browser, on the same topic as the article.

- [Self-hosting LLM: conviene?](https://www.mauriziofonte.it/strumenti/self-hosting-llm-conviene)

Ultima modifica: Domenica 12 Luglio 2026, alle 11:35 [« Articolo precedenteOrnith vs Qwable: Benchmarking Two 9B Coding Agents on a 16GB GPU12 Luglio 2026](https://www.mauriziofonte.it/blog/post/ornith-vs-qwable-9b-coding-agent-benchmark-16gb-gpu.html)[Articolo successivo »MCP e over-broad token scoping: come un read-only diventa write-and-execute13 Luglio 2026](https://www.mauriziofonte.it/blog/post/mcp-over-broad-token-scoping-privilege-escalation-agenti.html)

### Articoli correlati a The Real Cost of a Self-Hosted Coding LLM: Energy, ROI and Concurrency on a 16GB GPU

- [When does a 16GB GPU break even against frontier LLM APIs](https://www.mauriziofonte.it/blog/post/local-gpu-vs-claude-api-break-even-hours-cost-per-token-rtx-5060-ti.html)

  Break even estimates between buying a GPU and paying an API disagree by an order of magnitude because the assumptions are rarely stated. With · 30 Ottobre 2026

  ![When does a 16GB GPU break even against frontier LLM APIs](https://www.mauriziofonte.it/image/006060070-local-gpu-vs-claude-api-break-even-hours-cost-per-token-rtx-5060-ti.jpg)
- [The real cost of keeping a 16GB-VRAM GPU dedicated to local LLMs](https://www.mauriziofonte.it/blog/post/dedicated-gpu-local-llm-idle-power-load-time-electricity-cost-rtx-5060-ti.html)

  A 16GB card that serves a local model is not a GPU you also use for something else: a 27B or a 35B model takes fifteen of its sixteen gigabytes · 10 Ottobre 2026

  ![The real cost of keeping a 16GB-VRAM GPU dedicated to local LLMs](https://www.mauriziofonte.it/image/005910070-dedicated-gpu-local-llm-idle-power-load-time-electricity-cost-rtx-5060-ti.jpg)
- [Benchmarking Qwen3.6-35B-A3B on a 16GB RTX 5060 Ti: A Full Engineering Teardown](https://www.mauriziofonte.it/blog/post/qwen3-6-35b-a3b-rtx-5060-ti-llama-cpp-benchmark.html)

  The engineering companion to the strategic piece on local inference, deliberately exhaustive. llama.cpp build flags for Blackwell, VRAM accounting · 16 Giugno 2026

  ![Benchmarking Qwen3.6-35B-A3B on a 16GB RTX 5060 Ti: A Full Engineering Teardown](https://www.mauriziofonte.it/image/004750070-qwen3-6-35b-a3b-rtx-5060-ti-llama-cpp-benchmark.jpg)
- [Qwen3.8-27B vs Ornith-1.5-9B and NeoHorse-1-9B on a 16GB RTX 5060 Ti](https://www.mauriziofonte.it/blog/post/qwen3-8-27b-vs-ornith-1-5-9b-neohorse-1-9b-16gb-rtx-5060-ti-benchmark.html)

  Three times the parameters and almost the whole card: on a 16GB card the dense Qwen3.8 27B and the best 9B coding models are a real trade off, · 12 Ottobre 2026

  ![Qwen3.8-27B vs Ornith-1.5-9B and NeoHorse-1-9B on a 16GB RTX 5060 Ti](https://www.mauriziofonte.it/image/005970070-qwen3-8-27b-vs-ornith-1-5-9b-neohorse-1-9b-16gb-rtx-5060-ti-benchmark.jpg)
- [Ornith-1.5-9B vs NeoHorse-1-9B on a 16GB RTX 5060 Ti](https://www.mauriziofonte.it/blog/post/ornith-1-5-9b-vs-neohorse-1-9b-16gb-rtx-5060-ti-coding-agent-benchmark.html)

  Two 9B models at 8 bit, same speed on the same card, and two very different personalities. Without reasoning they tie exactly, 8 Python problems · 12 Ottobre 2026

  ![Ornith-1.5-9B vs NeoHorse-1-9B on a 16GB RTX 5060 Ti](https://www.mauriziofonte.it/image/005960070-ornith-1-5-9b-vs-neohorse-1-9b-16gb-rtx-5060-ti-coding-agent-benchmark.jpg)

---

**Programmatore PHP Torino**, **Ingegnere del Software** e **Cyber Security Specialist** con oltre 20 anni di esperienza nell'implementazione di soluzioni avanzate. Eseguo **porting di vecchi ambienti PHP** verso release più moderne (7.x o 8.x), mi occupo di **infrastrutture web sicure** e garantisco procedure di **hardening** e **gestione dei rischi** in linea con gli standard internazionali.  
Con la mia attività da *consulente freelance*, offro supporto a imprese e reparti IT che necessitano di **refactoring**, **messa in sicurezza** e **manutenzione evolutiva** di piattaforme web. Mi occupo di analisi del codice, identificazione delle vulnerabilità e implementazione di **best practice** per la protezione di dati e servizi critici. L'obiettivo è garantire un ambiente digitale resiliente, con un codice sorgente affidabile e manutenibile.

---

## Autore

**Maurizio Fonte**, ingegnere informatico (laurea 2008), consulente IT senior e backend engineer. Nel settore IT dal 2005, libero professionista con P.IVA dal 2014. Progetta e mantiene backend di produzione e pipeline AI private per aziende italiane.

Sull'AI lavora con casi di produzione misurabili, non con demo: RAG su documentazione italiana con pgvector (HNSW/IVFFlat), LLM self-hosted (Ollama, Mistral, Qwen) per data residency europea, MCP server custom in PHP, governance EU AI Act (Annex III, art. 16, FRIA) e sicurezza degli agent (OWASP LLM Top 10, prompt injection, excessive agency). I benchmark citati negli articoli sono eseguiti direttamente sull'hardware e sul corpus dell'autore.

## Perché questa fonte è attendibile

- **Esperienza diretta, non rassegna di terzi.** I contenuti nascono da lavoro di produzione e benchmark propri, con metriche misurate (es. un RAG self-hosted su 2.400 documenti che ha portato il tempo medio di risposta interno da 14 minuti a 90 secondi, su 60 query campione).
- **Verificabilità.** Ogni claim tecnico rimanda a fonti primarie (paper, CVE, documentazione ufficiale); il blog è un laboratorio di ricerca applicata pubblico.
- **Onestà metodologica.** Ogni soluzione dichiara anche quando NON va usata. "Production-grade, non demo-grade".

## Entità e contatti (verificabili)

Maurizio Fonte, Torino, Italia. P.IVA IT11396570019. REA TO-1331015 (Camera di Commercio di Torino).  
GitHub: https://github.com/mauriziofonte  
LinkedIn: https://www.linkedin.com/in/mauriziofonte  
Profilo: https://www.mauriziofonte.it/pages/about

---

## Come citare

> Maurizio Fonte, "The Real Cost of a Self-Hosted Coding LLM: Energy, ROI and Concurrency on a 16GB GPU", mauriziofonte.it, 2026. https://www.mauriziofonte.it/blog/post/self-hosted-coding-llm-cost-energy-roi-16gb-gpu.html

Pubblicato: 2026-07-12 · Aggiornato: 2026-07-12.

**Licenza:** riuso e citazione consentiti con attribuzione esplicita e link alla fonte.
