AI platform project 02
GPUs that turn themselves off.
Self-hosted models are cheap only when the GPUs are busy and expensive when they idle. This project is the arithmetic and the Kubernetes wiring for keeping them busy, or off.
From model to running pod
Size, pack and price it
Browser ports of the repo's planner. Prices are illustrative on-demand list prices; pass your own spot discount in the CLI.
Will it fit, and how many requests can it batch?
GPU memory = weights + KV cache (grows with context × concurrent sequences) + runtime overhead. vLLM claims 90% of the card up front.
KV per token for Llama 3.1 8B: 2 × 32 layers × 8 KV heads × 128 × 2 bytes.
Bin-packing replicas onto GPUs
First-fit decreasing, the same algorithm as gpuplan/binpack.py. Each column is one GPU; its height is GPU memory.
Scale-to-zero pays only for active hours, but the first request after idle waits for a node launch, an image pull and a model load.
Cost per million tokens vs latency
More concurrent requests share the same GPU-hour, so cost per token falls. Once every batch slot is busy, extra requests only queue. Cost stops improving while latency keeps climbing.
Real benchmark this model is calibrated on (mock server, not a GPU)
| concurrency | TTFT p50 | latency p50 | tokens/s |
|---|---|---|---|
| 1 | 0.06 s | 1.05 s | 30 |
| 4 | 0.06 s | 1.05 s | 121 |
| 8 | 1.11 s | 2.10 s | 121 |
From bench/loadtest.py against the mock vLLM server (4 slots, 40 tok/s per stream). Real GPU numbers need a real run. The repo claims none.
At the knee (4 concurrent): 115 tokens/s, $1.95 per 1M tokens, 1.12 s per request.
Test me
Concept checks, scenario calls and numbers from the real runs. Answer, then read why. Wrong answers can be retried at the end.
Run it yourself
Free: pytest -q (18 tests: planner maths, manifest policy rules, mock server and load test), python -m gpuplan, and a kind cluster running the mock vLLM with the same taints, labels and tolerations as the real Deployment. Real GPUs cost money: terraform/ installs the GPU Operator and KEDA into an existing EKS cluster with Karpenter. It is validated but has not been applied.