Inference on rented GPUs has a billing shape most tutorials leave out, and it is not the per-second meter. What empties an account is the instance that keeps existing while nobody serves anything: stopped overnight, paused after an outbid, cached and forgotten for a month.
This runbook stands up a private, OpenAI-compatible endpoint on Vast.ai with vLLM 0.34, points an ordinary OpenAI client at it, and then puts a ceiling on the bill from outside the box. Request limits go inside, a watchdog with a dollar figure goes somewhere else, and one rule decides whether "off" means stop or destroy. Prices checked: 2026-12-04 from the marketplace's own search API; every rate is a snapshot that can move within hours, and the arithmetic is printed so you can redo it at today's rate.
At a glance
- Who this is for: engineers who need a model behind a stable API without a $1,200-a-month reservation, and who can live with a cold start measured in minutes.
- What it costs: one 80 GB card ran $0.20 to $4.67 an hour in the 2026-12-04 sample. A 65 GB model that bursts twice a day came to about $81 a month; the same model left running came to $1,287.
- When it pays: spiky or internal traffic, and any case where per-token API pricing cannot be capped per customer.
- The caveat that decides everything: storage bills while an instance is stopped. On a host that charges $0.664 per GB-month, doing nothing with a 100 GB disk costs $66 a month.
What you are actually renting
Vast.ai is a marketplace, not a cloud. Hosts set their own rates on three products: on-demand with fixed pricing and guaranteed resources, reserved with prepayment and up to a 50% discount, and interruptible with a bidding system the documentation describes as often 50% or more cheaper, at the cost of being paused when someone outbids you or an on-demand customer wants the machine. You cannot convert an interruptible instance to on-demand later; you rent a new one. A paused instance keeps its data and stops working, which is worth remembering when you read your bill next month.
That structure is why the offer card shows six numbers where other providers show one. Four of them decide your month.
Four numbers on every offer card
The hourly rate is the one everyone sorts by, and it is the least interesting of the four. The other three decide what happens between working sessions, which for most private endpoints is most of the time.
| Number on the card | What it bills | What the 2026-12-04 sample showed | Decision rule |
|---|---|---|---|
dph_total | every second the instance is active | $0.202 to $4.667 an hour for one 80 GB card; H100 SXM on-demand median $3.668, interruptible median $1.829 | Multiply by the hours you will actually run. Never by 730 by default. |
disk_bw | nothing directly, but it sets every reload | 179 to 10,342 MB/s across the same card class | Below about 1,000 MB/s, a 65 GB reload stops being a restart and becomes a coffee break. |
storage_cost | every second the instance exists, stopped included | $0.040 to $0.867 per GB-month | At 100 GB that is $4 to $87 a month for an instance that serves nothing. |
inet_down_cost | every byte pulled to the box, weights included | $2.6 to $15.4 per TB, and never free in this sample | A full 65 GB re-download costs $0.17 to $1.00, which is the price of a destroy. |
The two halves of the meter
Compute is the easy half: Vast bills it per second for the time an instance is active, so a 40-minute burst is charged as 40 minutes. The second half is what surprises people: storage is charged for every second an instance exists and is online, in every state except offline. Stopping an instance does not stop that charge. Destroying it does, and takes the model cache with it.
Bandwidth is the third, smaller line: inbound ran $2.6 to $15.4 per TB depending on the host, which makes a fresh 65 GB download a $0.17 to $1.00 event. That number is the exact price of the decision this piece is really about.
What the 2026-12-04 sample looked like
Filter for the shape of card you need, then read the four numbers together instead of sorting on rate. The public search endpoint returned 64 verified offers with at least 75 GB of VRAM in one pull, and 57 reported CUDA 13.0 or newer, the requirement for the current vLLM image. Every row below is a real offer from that pull. The reference model is a 65 GB mixture-of-experts checkpoint such as openai/gpt-oss-120b, which fits on one 80 GB card.
| Offer, one 80 GB card | $/hour | Disk read | Storage $/GB-mo | Cold start, 65 GB | Decision rule |
|---|---|---|---|---|---|
| A100 SXM4, on-demand, US | $0.423 | 650 MB/s | $0.867 | 3 min 20 s | Cheapest hour on the list and the worst place to keep anything. |
| A100 SXM4, on-demand, New York | $0.430 | 4,855 MB/s | $0.267 | 1 min 53 s | Best all-round buy for a single 65 GB model. |
| A100 SXM4, interruptible, Iowa | $0.202 | 179 MB/s | $0.200 | 7 min 44 s | Fine for overnight batch, painful for anything a person waits on. |
| H100 SXM, interruptible, Czechia | $0.661 | 10,342 MB/s | $0.664 | 1 min 46 s | Fastest reload here, most expensive shelf on the list. |
| H100 SXM, on-demand, US | $4.667 | 3,806 MB/s | $0.040 | 1 min 57 s | The one to keep warm if traffic is continuous. |
Cold start in that column is weights read plus engine init, and the init half is not a guess. A published Vast.ai deployment of a 30B FP8 model showed 146 seconds from container start to a serving endpoint with the weights already on disk, and 198 seconds on a first run that still had to download them.
The cheapest hour is not the cheapest month
Take the two extremes. The $0.423 host charges $0.867 per GB-month for storage, so a 100 GB disk costs $86.70 whether the GPU runs or not; the $4.667 host charges $0.040, so the same disk costs $4.00. If the cheap host sits stopped for a month, its shelf bill alone is worth 50 idle GPU-hours at $1.736 an hour. The expensive host has to run 55 hours a month before its hourly rate costs more than the cheap host's storage.
For a bursty workload the answer is not "pick the expensive host". It is to destroy the instance between sessions and pay the re-download, so the only question is how often that is worth it. A month of storage divided by $0.17 per re-download gives the break-even: 118 relaunches at the median $0.200 rate, about four a day; 391 at $0.664, thirteen a day. Below that frequency, destroying is cheaper than keeping the disk.
If you want the per-token comparison against API pricing before you commit, the GPU rental break-even piece does that math on the same cards.
Launch the instance
Vast's CLI and REST API are the fast path, and the API key is worth scoping before you write an automation. A default key has full account access, including billing; one limited to instance management covers everything here, and it is what the watchdog should hold.
Install the CLI, scope the key, and rent
The query language is field-operator-value, and the useful filters are boring ones: enough disk, a fast enough disk, a modern driver, and a reliability score above 0.99. Three offers in the sample reported CUDA 12.0, so the driver filter is not decorative.
pip install vastai vastai set api-key "$VAST_API_KEY" # stored at ~/.config/vastai/vast_api_key vastai show user # confirms the key and the balance vastai create api-key --name ci-watchdog \ --permissions '{"manage_instances": true, "manage_billing": false}' vastai search offers 'gpu_name=H100_SXM num_gpus=1 gpu_ram>=75 \ disk_space>120 reliability>0.99 cuda_vers>=13.0 rentable=True' \ -o 'dph_total-' --type bid --storage 100 vastai create instance OFFER_ID \
--image vllm/vllm-openai:v0.34.0 \
--disk 100 \
--bid_price 1.85 \
--onstart-cmd 'echo ready'
Two details cost people real money. `--disk 100` is what the storage line bills every second, so size it to the model plus page cache. And `--bid_price` is a standing bid, not a price guarantee: if the market moves past it the instance pauses instead of ending, and the storage meter keeps running. This is where the [cheapest way to rent a GPU for inference](https://www.vervebrief.com/2026/11/self-host-llm-or-pay-per-token-2026-gpu.html?ref_id=887688) turns into a monthly number rather than an hourly one. ### Publish the port without publishing the model The container reaches the internet on a mapped host port, and the instances endpoint reports it: `curl -H "Authorization: Bearer $VAST_API_KEY" https://console.vast.ai/api/v1/instances/` returns `public_ipaddr` and `ports` for each instance, and the entry for container port 8000 is your base URL. Resist the urge to hand that address out. Bind vLLM to `127.0.0.1` inside the container and reach it through an SSH tunnel, or terminate TLS in a proxy that also adds rate limits you control. A mapped port on a marketplace host is plain HTTP, and the next section explains why the API key is not the lock most people assume. ## Serve the model The current image is `vllm/vllm-openai:v0.34.0`, built on CUDA 13.0, which needs an R580 or newer host driver. That is not a footnote on a marketplace: three of the 64 offers in the sample reported CUDA 12.0, and 57 reported 13.0 or newer. On an older driver, vLLM's compatibility libraries cover R535 and R570 on datacenter cards via `VLLM_ENABLE_CUDA_COMPATIBILITY=1`. ### The serve command that fits an 80 GB card Version 0.34 changed the memory defaults: the extensible KV cache is on by default and sizes itself from the memory free after warmup, so leave `--gpu-memory-utilization` out unless another process shares the card. On one 80 GB GPU with a 65 GB checkpoint that leaves roughly 8 GB for cache, activations and graphs: enough for a handful of long conversations, not dozens.
bash
vllm serve openai/gpt-oss-120b \
--served-model-name gpt-oss-120b \
--download-dir /workspace/models \
--host 127.0.0.1 --port 8000 \
--api-key "$VLLM_API_KEY" \
--max-model-len 32768 \
--max-num-seqs 16 \
--max-num-batched-tokens 2048 \
--enable-prefix-caching
`--max-model-len` is the first real ceiling in this design. Left unset, vLLM takes the model's advertised maximum, which for a 128K-context model means the cache must hold 128K tokens for one sequence before it will start. The suffix parser is worth memorizing: `16k` is 16,000 tokens and `16K` is 16,384. `--download-dir` points the cache at the big disk, which is what lets a stop-and-restart skip the download. ### Check it the way your client will Two checks are enough before wiring an application to it: one confirms the served name, the other a real generation, and both expose the metrics you will want later.
bash
curl -s http://127.0.0.1:8000/v1/models -H "Authorization: Bearer $VLLM_API_KEY"
curl -s http://127.0.0.1:8000/v1/chat/completions \
-H "Authorization: Bearer $VLLM_API_KEY" -H "Content-Type: application/json" \
-d '{"model":"gpt-oss-120b","max_tokens":64,"messages":[{"role":"user","content":"one line: what is a KV cache?"}]}'
curl -s http://127.0.0.1:8000/metrics | grep -E 'num_requests_(running|waiting)|kv_cache_usage_perc'
From Python it is the ordinary client with the base URL swapped, which is the point of the exercise: `OpenAI(base_url="http://127.0.0.1:8000/v1", api_key=...)`, and the rest of your code stays as it is. ### What the API key does not protect vLLM's own documentation is blunt about this. `--api-key` authenticates endpoints under `/v1`, `/v2`, `/inference` and `/cohere`, and other endpoints on the same process stay open, including `/invocations`, which exposes the same inference capability as `/v1`. It also does nothing about transport encryption. On a rented host the key is a speed bump, not a wall. Treat `127.0.0.1` plus a tunnel or reverse proxy as the boundary, and the API key as the second layer. That architecture solves a second problem: the proxy is where per-customer rate limits belong, which is how you cap what one client can cost you. ## Put a ceiling on the bill Three layers, in order of what they cost to build: configuration, thirty lines of Python, and a decision you make once per workload. ### Layer one: request ceilings `--max-model-len` caps what one request can consume, and `--max-num-seqs` caps how many can run at once, which bounds the KV cache and the worst case a spike can produce. On the client side, set `max_tokens` and a timeout, because a client that retries a 4,000-token generation three times turns one call into three. The metric to watch is `vllm:admission_rejections`: a rising count means the ceiling is working, not that something broke. ### Layer two: the watchdog that lives elsewhere A spend guard cannot run on the instance it guards. Put it on a laptop cron, a GitHub Action, or the cheapest box you already pay for, with the key that has no billing access.
python
!/usr/bin/env python3
budget_kill.py: destroy the instance once it has burned through CAP_USD.
import os, subprocess, time
CAP = float(os.environ.get("CAP_USD", "5.00"))
ID = os.environ["VAST_INSTANCE_ID"]
DPH = float(os.environ["VAST_DPH"]) # dph_total from the offer
START = float(os.environ["VAST_STARTED_AT"]) # epoch seconds, written at launch
hours = (time.time() - START) / 3600
spend = hours * DPH
if spend >= CAP:
subprocess.run(["vastai", "destroy", "instance", ID], check=True)
print(f"destroyed {ID} at ${spend:.2f}")
else:
print(f"{ID}: ${spend:.2f} of ${CAP:.2f}")
The script's second job is a status check, because a paused instance is the quietest way to waste money: it serves nothing, keeps its data, and still bills storage. Compare `actual_status` from `vastai show instances --raw` against what you expect and alert when an interruptible instance stops reporting `running`. ### Layer three: decide what "off" means This is where the arithmetic from section one becomes a policy. The reference box is the H100 SXM interruptible offer at $1.736 an hour with $0.200 storage, running one 65 GB model on a 100 GB disk. | Operating pattern, 30-day month | GPU hours | Compute | Storage and re-downloads | Month total | Decision rule | | --- | --- | --- | --- | --- | --- | | Always on | 730 | $1,267.28 | $20.00 | $1,287.28 | Only if the endpoint has to answer on the first try, all day. | | Weekday business hours, stopped at night and weekends | 220 | $381.92 | $20.00 | $401.92 | The natural fit for an internal tool, and stopping still costs $20. | | Two 40-minute bursts a day, destroyed between | 40 | $69.44 | $11.27 | $80.71 | The default for batch and evaluation work. | | One 3-hour evaluation run a week, destroyed after | 12 | $20.83 | $1.01 | $21.84 | The floor: if you can wait 2 minutes, this is the bill. | One number in that table is worth staring at. A cold start costs two to fifteen cents of compute, so the meter barely notices it; your users do. The 100 seconds to 7 minutes of unavailability is the real price, which is why the decision is about who is waiting. ## What breaks on the second day The failures that show up after the first successful request are predictable, and none are exotic. - A host driver older than R580 silently rules out the current image. Filter `cuda_vers>=13.0` in the search and keep `VLLM_ENABLE_CUDA_COMPATIBILITY=1` in reserve for datacenter cards on R535 or R570. - A cheap card with 179 MB/s of disk read turns every restart into eight minutes. `disk_bw` is a first-class selection filter, not a tiebreaker. - Destroying takes the Hugging Face cache with it: $0.17 to $1.00 per launch, which is why the break-even above is counted in relaunches. - An outbid instance pauses mid-generation. Requests fail, the client retries, and the storage meter keeps ticking on a box that serves nothing. - `--api-key` leaves `/invocations` open and all traffic in plain HTTP. The tunnel is the boundary, and [egress between regions](https://www.vervebrief.com/2026/11/the-hidden-tax-of-multi-region-ai-what.html) is the other line nobody reads until it is large. - KV cache at 1.0 means queueing, not scaling. `vllm:num_requests_waiting` climbing while `kv_cache_usage_perc` sits at 1.0 is the signal to add a second box, not to raise `max_tokens`. - A model that dies on the first long prompt usually met a context length the cache cannot hold. The engine prints the cache size and maximum concurrency it settled on at startup, and that log line beats any planning estimate. That last point is a pattern this blog keeps running into: the failure that never alerts is the expensive one, whether it is a workflow engine with a green checkmark or an instance that is paused and billing. [The n8n production piece](https://www.vervebrief.com/2026/12/n8n-in-production-queue-mode-misfires.html) tells the same story in a different stack. ## The five-minute decision If the endpoint must answer on the first try and traffic is continuous, rent on-demand and keep it warm. If people wait, but only during working hours, run an interruptible instance on a fast-disk, cheap-shelf host and stop it at night. If only a machine waits, or nothing does, destroy it and pay the re-download. The ceiling in one line: a request limit inside, a scoped-key watchdog outside, and a policy that says destroy rather than stop unless you relaunch more than four times a day. Every rate card here is priced at your own volume, with the break-even charts, in the [AI Automation and GPU Cost Playbook](https://www.vervebrief.com/playbook). ## Source notes - Vast.ai, instance types (on-demand, reserved, interruptible, pause behaviour): https://docs.vast.ai/guides/instances/instance-types - Vast.ai, billing (per-second compute, storage in all non-offline states, bandwidth per byte): https://docs.vast.ai/guides/reference/billing - Vast.ai, pricing components and instance-type discounts: https://docs.vast.ai/guides/instances/pricing - Vast.ai, API keys and scoped permissions: https://docs.vast.ai/guides/reference/api-keys - Vast.ai CLI, `search offers` query syntax and fields: https://docs.vast.ai/cli/reference/search-instances - Vast.ai CLI, `create instance` options including `--bid_price`, `--disk`, `--onstart-cmd`: https://docs.vast.ai/cli/reference/create-instance - Vast.ai CLI, `destroy instance`: https://docs.vast.ai/cli/reference/destroy-instance - Vast.ai marketplace snapshot used for every hourly, storage, bandwidth and disk-read figure above: https://console.vast.ai/api/v0/bundles, queried 2026-12-04, 64 verified single-GPU offers with at least 75 GB of VRAM - vLLM 0.34.0 release notes (extensible KV cache default, CUDA 13.0 image, block size 64): https://github.com/vllm-project/vllm/releases/tag/v0.34.0 - vLLM, Docker deployment and CUDA compatibility mode: https://docs.vllm.ai/en/v0.34.0/deployment/docker/ - vLLM, OpenAI-compatible server and the API key limitation on `/invocations`: https://docs.vllm.ai/en/latest/serving/online_serving/openai_compatible_server/ - vLLM, engine arguments (`--max-model-len` suffixes, `--download-dir`, `--enable-prefix-caching`): https://docs.vllm.ai/en/stable/configuration/engine_args/ - vLLM, production metrics (`vllm:kv_cache_usage_perc`, `vllm:num_requests_waiting`, `vllm:admission_rejections`): https://docs.vllm.ai/en/stable/usage/metrics/ - vLLM recipe for gpt-oss-120b (single 80 GB card, MXFP4, TP1 note): https://recipes.vllm.ai/openai/gpt-oss-120b - OpenAI, gpt-oss model sizes and 128K context: https://openai.com/index/introducing-gpt-oss/ - Checkpoint size (65.2 GB) and KV cache per token for gpt-oss-120b: https://deploygpu.ai/models/gpt-oss - Measured Vast.ai cold start (146 s and 198 s) for a 30B FP8 vLLM deployment: https://githubhelp.com/anqorithm/vast-coding-llm Related reading: - [Self-host an LLM or pay per token: the 2026 GPU rent math](https://www.vervebrief.com/2026/11/self-host-llm-or-pay-per-token-2026-gpu.html) - [GPU cloud rental and inference break-even: Vast.ai vs RunPod vs AWS and GCP](https://www.vervebrief.com/2026/12/gpu-cloud-rental-and-inference-break_4.html) - [The sampling rate decides the bill: agent tracing costs](https://www.vervebrief.com/2026/12/the-sampling-rate-decides-bill-agent.html) > Disclosure: this post contains affiliate links. If you rent a GPU through them, Signal & Silicon may earn a commission at no extra cost to you, and it does not change any rate quoted above. Rates were read from the marketplace on 2026-12-04 and will drift. --- **Cross-posted from [Rent a GPU by the Second](https://www.vervebrief.com/2026/12/rent-gpu-by-second-vllm-runbook-with.html).** Signal & Silicon publishes one numbers-first cost breakdown a week: the arithmetic behind GPU rental, managed databases and agent infrastructure, priced at your own volume. - [The 2026 AI Workflow & GPU Cost Playbook](https://www.vervebrief.com/playbook) — the run-cost and break-even models from this site with an editable TCO calculator, $15. - [The newsletter](https://signalsilicon.substack.com) — one email a week with the new breakdown and the numbers behind it. 
