如何在雲端 GPU 上將 LLM 部署至正式環境
How do you deploy an LLM to production on cloud GPUs?
在雲端 GPU 上將 LLM 部署至正式環境,應按自有評測選擇模型,設定 p99 延遲目標,再按符合目標的吞吐量估算副本數,並為版本更新預備回滾。文章以 Llama 3.3 70B 為例,滿載估算每百萬輸出 tokens 成本為 $0.35;按示例流量加入延遲餘量和備用副本後,估算升至 $2.89,而以最大吞吐量的 50% 作估算是示例假設,並非實測。
To deploy an LLM to production, pick the model against your own evals, set p99 latency targets, size replicas from throughput measured at those targets, keep one warm, and ship every change behind a versioned endpoint you can roll back. On Nodus, a catalog model can go live behind an OpenAI-compatible inference endpoint (Beta) with its own API key and dollar cap, so you only run GPUs yourself when you need your own weights. The worked example below shows why a 70B model that costs $0.35 per million output tokens on a benchmark costs about $2.89 once you add headroom and a spare replica.
This post starts where a working server ends. Our guide to hosting your own LLM behind an OpenAI-style API covers vllm serve, API keys and switching base_url; here we cover what changes when real users depend on it.
What changes between a working LLM server and a production deployment?
A demo server answers one request. A production deployment answers every request inside a latency target, survives a replica dying and changes models without an outage.
This is the checklist we use. Every row needs an owner and a number before launch.
| Area | Decision to write down | Done when |
|---|---|---|
| Model and engine | Which model and serving engine pass your evals | Eval scores recorded for the exact weights, precision and engine version you ship |
| Latency targets | TTFT and per-token targets at p99 | Targets written as numbers, per use case |
| Capacity | Replicas needed at peak | Load test at your real prompt and output lengths shows the targets hold |
| Warm floor | Minimum replicas that never scale to zero | Cold-start time measured and the warm cost accepted |
| Rollout | Versioned endpoint names, canary share, rollback step | A rollback has been rehearsed once |
| Alerts | Metrics, thresholds, who gets paged | Alerts fire in a test |
| Failures | Retries, timeouts, health checks, a spare replica | Killing one replica does not breach targets |
| Cost | Monthly fleet cost and cost per 1M tokens at real utilization | Both numbers known before launch |
How do you pick the model and serving engine?
Pick the smallest model that passes your evals, then the engine that serves it fastest on your traffic. Run the evals on the exact artifact you will serve, because an FP8 or INT4 build is a different model from its BF16 original.
vLLM is the usual default engine; our vLLM vs TensorRT-LLM comparison explains when a switch is worth the work. Pin the engine version and container image tag in the deployment. A :latest tag means a redeploy can change your model's behavior without anyone deciding to.
What latency targets should a production LLM meet?
Set two targets: time to first token (TTFT) and time per output token (TPOT), both at the 99th percentile. TTFT is what a user waits before anything appears. TPOT decides how fast the answer streams.
Published benchmarks give sensible starting points. MLCommons set the MLPerf Llama 2 70B server test at a TTFT of 2 seconds or less and a TPOT of 200 ms or less, anchored on human reading speed. For its newer interactive scenario, MLCommons set a stricter p99 TTFT of 450 ms and a p99 TPOT of 40 ms, which is 25 tokens per second per user.
Use the interactive numbers for chat and voice, and the looser ones for internal tools. Agents and batch jobs care about total time and cost more than TTFT. Our post on LLM tokens per second explains how per-user speed and total GPU throughput trade against each other.
How many GPUs do you need for your traffic?
Divide your peak output tokens per second by the throughput one replica sustains at your latency targets, then round up and add a spare. The catch is the second number: published throughput is usually measured at maximum load, not at a latency anyone accepts.
Here is a worked example with one sourced number. NVIDIA's TensorRT-LLM performance overview lists Llama 3.3 70B in FP8 on two NVIDIA H100 GPUs (tensor parallel 2) at 4,181.06 output tokens per second, with 1,000 input and 1,000 output tokens per request. One replica is those two GPUs.
Say your peak is 5 requests per second of that same shape. That is 5 x 1,000 = 5,000 output tokens per second.
- Ceiling: 5,000 / 4,181.06 = 1.20, so at least 2 replicas. No deployment needs fewer.
- Latency headroom: that 4,181 is a maximum-throughput run. An example benchmark output on the same NVIDIA page reports an average TTFT of 52.7 seconds, far past any chat target. As an illustration only, suppose your own load test finds the targets hold at half the published maximum, 2,090.53 tokens per second. Then 5,000 / 2,090.53 = 2.39, so 3 replicas.
- Spare: add one replica so a crash or a deploy does not breach the targets at peak. That makes 4.
On the Nodus pricing page, the H100 SXM is listed at $2.60/hr, so one two-GPU replica costs $5.20/hr. Over an average month of 730 hours that is $5.20 x 730 = $3,796.00 per replica.
| Fleet | Replicas | H100s | Monthly cost |
|---|---|---|---|
| Ceiling only | 2 | 4 | $7,592.00 |
| With latency headroom | 3 | 6 | $11,388.00 |
| With headroom and a spare | 4 | 8 | $15,184.00 |
Prices checked November 24, 2026, on the Nodus pricing page. Throughput from NVIDIA's performance overview; the 50% headroom is our illustrative assumption, not a measurement.

Latency headroom and one spare double the fleet a throughput benchmark suggests.
Replace step 2 with your own number before you buy anything. Run a load test at your real prompt and output lengths, raise concurrency until p99 TTFT or TPOT breaks, and use the throughput just below that point.
How many replicas should you keep warm?
Keep at least one replica warm for any user-facing endpoint, and two when a single cold start would breach your targets. A cold replica has to get a GPU, pull its image and load weights before it serves anything.
Nodus documents one measurement of that cost. In the GPU snapshots guide (Beta), a vLLM 0.30 engine serving Qwen3-0.6B on an NVIDIA A10 took about 90 seconds to cold start and about 6 seconds to restore from a snapshot. A 70B model loads far more weights than that small model, so expect longer. Our explainer on serverless GPUs covers when scale to zero pays.
The warm floor is a fixed monthly cost. In the example above, one warm replica costs $3,796.00 a month even at 3 a.m.; two cost $7,592.00.
The second $3,796.00 buys continuity: when one replica crashes or rolls to a new version, traffic still lands on a loaded model. If your quiet hours have real users, pay it. If nobody calls at night, one warm replica plus a measured cold start is the cheaper choice.
How do you roll out a new model version without breaking users?
Treat every change to weights, quantization, engine version, flags or prompt template as a new version with its own endpoint name. Then move traffic to it in steps:
- Deploy
support-bot-v2besidesupport-bot-v1and run your eval set against v2 before any user sees it. - Send a small share of live traffic to v2 from your gateway, for example 5%, and compare its TTFT, TPOT, errors and quality checks with v1 over the same window.
- Raise the share in steps. Roll back by sending 100% to v1, which is still warm.
- Retire v1 only after v2 has handled a full peak, because rollback is only fast while the old version is loaded.
Which metrics should you alert on?
Alert on what users feel first, then on what predicts it. vLLM exposes Prometheus metrics, and its metrics reference lists the ones that matter:
- p99 TTFT from
vllm:time_to_first_token_seconds, against your TTFT target. - p99 inter-token latency from
vllm:inter_token_latency_seconds, against your TPOT target. - Queue depth from
vllm:num_requests_waiting. A queue that keeps growing means you need another replica. - KV cache use from
vllm:kv_cache_usage_perc. Near 1 means requests will start to wait or be preempted. - Preemptions from
vllm:num_preemptions, which should stay near zero in steady state. - Error rate and spend at your gateway, per endpoint version.
Page on the first two and on errors. Treat queue depth and KV cache use as warnings that give you time to add capacity. On Nodus, GPU utilization and memory for Jobs and Functions are queryable with PromQL, for example nodus_container_gpu_utilization_percent, as the logs and metrics guide shows, so a Grafana dashboard can put GPU use beside vLLM's latency.
How do you handle failures?
Assume any replica can die and any request can be retried, and build for both before launch.
Health checks come first. vLLM's Kubernetes guide points both liveness and readiness probes at /health on port 8000, with a 60-second initial delay to allow for model loading. A replica should receive traffic only after it reports ready.
Retries need limits and identity. Retry only on throttling and unavailable errors, with backoff, and honour Retry-After when the server sends it. On the Nodus inference API, an Idempotency-Key header makes a retry within 24 hours return the same answer with no second charge, according to the inference guide. The same guide says 502 and 503 responses are not charged.
Set a client timeout a little above your worst acceptable response time, so a stuck request fails fast. The spare replica from the capacity math covers the rest.
What does a production LLM cost per month and per 1M tokens?
Monthly cost is replicas times hourly rate times hours. Cost per million tokens is that bill divided by the tokens you actually serve, so it depends on utilization more than on the GPU price.
One replica from the example produces at most 4,181.06 x 3,600 = 15,051,816 output tokens an hour. At $5.20/hr that is $5.20 x 1,000,000 / 15,051,816 = $0.35 per million output tokens, if it runs flat out. The same hour serves fewer tokens at lower utilization: $0.69 per million at 50%, $1.38 at 25% and $3.45 at 10%.

Every halving of utilization doubles the price of a token on the same GPUs.
Now apply it to the fleet. Suppose your traffic averages 2 requests per second, 2,000 output tokens per second, across the month. That is 2,000 x 3,600 x 730 = 5,256 million output tokens.
The three-replica fleet at $11,388.00 comes to $2.17 per million, and the four-replica fleet at $15,184.00 comes to $2.89. That is about 8 times the $0.35 benchmark figure, because the fleet runs at roughly 12% to 16% of its maximum throughput to meet peaks and latency targets.
These figures count output tokens only and leave out engineering time. If a per-token API serves the same model for less than your fleet's real cost per million, use the API until traffic grows; our post on LLM inference cost per million tokens compares those prices.
How do you deploy an LLM to production on Nodus?
Start with the Nodus inference API if a catalog model passes your evals. It is OpenAI-compatible, marked Beta in the inference guide, and needs no endpoint deployment or GPU reservation for shared models. The guide also says Nodus adds no request-rate, token-rate or concurrency caps of its own, though model capacity and balance checks still apply.
For a production app, give it a named endpoint so it gets its own URL, key and spend cap. The command, exactly as the docs show it:
$ nodus create inferenceendpoint support-bot --model nodus/gpt-oss-120b --max-cost 50
Once requests through the endpoint have spent its --max-cost, the next one gets 402 BudgetExceeded, which turns a runaway client into a capped bill. The endpoint key can call only that endpoint. The guide does not describe splitting traffic between endpoints, so run the canary steps above in your own gateway, with one endpoint name per version. Creating a standard endpoint does not reserve dedicated capacity; for that, the console's Contact us option sets up a dedicated plan for your models and traffic.
If you need your own weights or engine flags, run vllm serve as a Nodus Job for evals and load tests, as our self-hosting guide shows. That route reaches your laptop through nodus port-forward, which suits testing rather than public traffic. Nodus Functions do not expose public web endpoints, so for a public API on your own weights, talk to Nodus about a dedicated plan.
FAQ
Should I use Kubernetes to deploy an LLM?
Use it if your team already runs Kubernetes, since vLLM publishes Deployment manifests with GPU requests and health probes. If you do not, a managed endpoint such as a named Nodus inference endpoint avoids learning GPU scheduling, drivers and autoscaling just to serve one model.
What is a reasonable p99 TTFT for a chatbot?
MLPerf's interactive scenario uses 450 ms at p99, and its older server scenario uses 2 seconds. Long prompts make both harder, because prefill time grows with input length, so set the target per use case and test it with your real prompts.
Can I autoscale on GPU utilization?
It is a weak signal for LLM serving, because a batched engine can show high GPU use while still meeting latency, or low use while requests queue. Scale on queue depth or on TTFT approaching its target, and use GPU utilization to spot waste.
Originally published on the Nodus blog.
來源:DEV Community · dev.to