Leanpub Header

Skip to main content

Tokens per Dollar

A Kubernetes Field Guide to Affordable LLM Inference

Tokens per Dollar

Most self-hosted LLM deployments run at 10–30% utilization — full retail price for GPUs that mostly sit idle. Tokens per Dollar is a deliberately short field guide for platform engineers: tune vLLM (2–4x throughput on the same hardware), quantize to halve your GPU count, cache the prompt tokens you keep re-paying for, and autoscale on real token traffic instead of CPU. Working YAML throughout, and a case study that cuts a 70B deployment from $29,200 to $8,600 a month with better latency. Read it in an evening; it pays for itself the first day you apply it.

Minimum price

$9.99

$15.00

You pay

Author earns

$

Also available for 1 book credit with a Reader Membership

PDF
About

About

About the Book

Running open-weights models like Llama 3.1 in production is expensive in a way almost nothing else in your cluster is. An idle nginx pod wastes pennies; an idle 2×A100 model server wastes $10 an hour. Most teams are paying full price for GPUs that do useful work 10–30% of the time — same old overprovisioning habits, at 500x the cost.

This micro-book is the fix, written for platform engineers, SREs, and cloud architects who know Kubernetes but not inference internals. No theory tour, no framework survey — just the levers that move the bill, in order of payoff:

  • Think in cost per million tokens, the only unit that matters — and measure yours before touching anything
  • Tune vLLM properly: the three flags worth 2–4x throughput on identical hardware, with a full production Deployment manifest
  • Use quantization (FP8, INT4/AWQ) to halve your GPU count — plus the golden-set eval workflow that makes it safe
  • Turn on prefix caching and sticky routing to stop paying for the same system prompt thousands of times an hour
  • Autoscale on real token traffic with KEDA and Karpenter — queue depth, not the CPU and "GPU utilization" metrics that lie
  • Buy compute well: spot burst tiers, MIG, and why commitments come last, not first

It closes with a realistic case study that takes a $29,200/month 70B deployment to $8,600 — a 71% cut, with better peak latency — and a one-page checklist of the whole book.

Every example is working YAML. Every claim comes with the arithmetic. Deliberately short: read it in an evening, apply it this sprint, and it pays for itself the first day.

What Readers Will Learn (bullets field)

  • How to compute and track cost per million tokens for any deployment
  • The VRAM budget model (weights + KV cache) that determines your real concurrency ceiling
  • Production vLLM configuration: --max-model-len--gpu-memory-utilization--max-num-seqs, probes, and model-weight loading that doesn't wreck cold starts
  • When FP8 vs INT4 quantization is safe, and how to verify quality with your own eval set
  • Prefix caching, sticky routing, and response caching — and which one can silently return wrong answers
  • KEDA autoscaling on vllm:num_requests_waiting with asymmetric scale-up/scale-down, plus Karpenter node provisioning with a blast-radius cap
  • Spot-instance burst tiers, MIG partitioning, and benchmark-driven GPU selection

Who This Book Is For

Platform engineers, SREs, DevOps engineers, and cloud architects running (or about to run) open-weights LLMs on Kubernetes. Assumes working Kubernetes knowledge; assumes zero inference knowledge. Not for you if you need training/fine-tuning guidance or a managed-API cost guide.

Author

About the Author

Nix

SmNix writes practical guides on AI systems, prompt architecture, automation, and technology workflows. His work focuses on turning complex tools into structured, usable systems for professionals, creators, and everyday users who want better results from modern AI.

Get the free sample chapters

Click the buttons to get the free sample in PDF or EPUB, or read the sample online here

The Leanpub 60 Day 100% Happiness Guarantee

Within 60 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.

See full terms...

Earn $8 on a $10 Purchase, and $16 on a $20 Purchase

We pay 80% royalties on purchases of $7.99 or more, and 80% royalties minus a 50 cent flat fee on purchases between $0.99 and $7.98. You earn $8 on a $10 sale, and $16 on a $20 sale. So, if we sell 5000 non-refunded copies of your book for $20, you'll earn $80,000.

(Yes, some authors have already earned much more than that on Leanpub.)

In fact, authors have earned over $15 million writing, publishing and selling on Leanpub.

Learn more about writing on Leanpub

Free Updates. DRM Free.

If you buy a Leanpub book, you get free updates for as long as the author updates the book! Many authors use Leanpub to publish their books in-progress, while they are writing them. All readers get free updates, regardless of when they bought the book or how much they paid (including free).

Most Leanpub books are available in PDF (for computers) and EPUB (for phones, tablets and Kindle). The formats that a book includes are shown at the top right corner of this page.

Finally, Leanpub books don't have any DRM copy-protection nonsense, so you can easily read them on any supported device.

Learn more about Leanpub's ebook formats and where to read them

Write and Publish on Leanpub

You can use Leanpub to easily write, publish and sell in-progress and completed ebooks and online courses!

Leanpub is a powerful platform for serious authors, combining a simple, elegant writing and publishing workflow with a store focused on selling in-progress ebooks.

Leanpub is a magical typewriter for authors: just write in plain text, and to publish your ebook, just click a button. (Or, if you are producing your ebook your own way, you can even upload your own PDF and/or EPUB files and then publish with one click!) It really is that easy.

Learn more about writing on Leanpub