A Model Running Successfully Does Not Mean It Is Production-Ready
A successful model startup only proves that the basic inference path works. Before deployment, teams must validate real-world task quality, concurrency, long-context memory usage, hardware capacity, scheduling behavior, and reproducible performance data under production-like workloads.
1. A Successful Service Startup Is Only the First Step
When the model has loaded and the API can return text, the driver, runtime, model weights, and basic inference service are working. This answers only one question: can the model run?
A production deployment must also be evaluated across the following dimensions:
- Real task performance: Evaluate the model with business datasets rather than demonstrating it with a few example prompts.
- Concurrent access: Test response times and error rates when multiple users access the service simultaneously.
- Mixed short and long requests: Verify that short requests are not blocked by long-running requests.
- API authorization: Identify callers and control key scope and usage quotas by application or team.
- Logging and auditing: Record the caller, request time, input and output lengths, latency, and error codes for troubleshooting and traceability. Sensitive user input should not be stored in plaintext. Use hashes or redacted summaries where possible.
- Monitoring and alerting: Set thresholds for time to first token, error rate, GPU memory utilization, and queue length, and notify operators when those thresholds are exceeded.
- Restart and rollback: Verify that the service can be restarted without interrupting business operations and that a new release can be rolled back quickly if problems occur.
If any of these capabilities is missing, the service is still effectively in the testing phase. Many teams deploy immediately after the model passes an effectiveness review, only to discover during the first traffic spike that rate limiting is missing, or during the first incident that no rollback path exists.
These capabilities should be included in the pre-release acceptance checklist, not added only after an outage.
2. The Real Cost of Long Context Is the KV Cache
Supporting a certain context-window length does not mean that every request can use the full window. During inference, GPU memory is mainly consumed by two components:
- Model weights: Mostly fixed after startup and generally unrelated to request volume.
- KV cache: Stores the Key and Value tensors for previously processed tokens. Its size grows dynamically with input length, output length, and concurrency.
For a standard attention architecture, KV-cache memory can be estimated as follows:
KV cache memory ≈ 2 × number of layers × number of KV heads × head dimension × bytes per element × total cached tokens
The factor of 2 represents the two tensors, Key and Value. The total number of cached tokens is the sum of the input and output tokens for all in-flight requests. Actual attention designs, such as grouped-query attention or compressed attention, may change the relevant head count and dimensions, so the model configuration must be used for the final calculation.
Consider an example configuration with 60 layers, 8 KV heads, a head dimension of 128, and 2 bytes per element. Each token would consume approximately:
2 × 60 × 8 × 128 × 2 = 245,760 bytes
Caching 1 million tokens would therefore require approximately 246 GB of GPU memory. This estimate does not include model weights or temporary computation buffers, showing why long-context inference can consume far more memory than expected.
Two conclusions follow:
- A single extremely long request can consume a substantial portion of the available cache.
- When multiple long requests arrive at the same time, available memory can disappear quickly, causing queueing, higher time-to-first-token latency, or, in severe cases, an out-of-memory (OOM) failure.
For this reason, long-context requests should not share the same resource pool as ordinary requests. They should be managed in separate length-based tiers.
A recommended structure is:
| Tier | Context range | Resource strategy |
|---|---|---|
| Shared pool | Standard lengths | Prioritize concurrency and low latency |
| Quota pool | 32K to 128K | Set concurrency and token quotas by tenant or application |
| Long-context pool | Above 128K | Use independent scheduling and limit the number of simultaneously running requests |
| Extreme queue | Near 1M | Process requests serially or in small batches with timeout protection |
Routing should be based on the input length plus the reserved maximum output length, rather than on the input alone:
def route_by_length(input_tokens: int, max_output_tokens: int) -> str:total = input_tokens + max_output_tokensif total <= 32_000:return "shared_pool"if total <= 128_000:return "quota_pool"if total <= 900_000:return "long_context_pool"if total <= 1_000_000:return "extreme_queue"return "reject" # Reject requests beyond the model's context limit with a clear error
This routing logic should be combined with two additional controls:
- Set a concurrency limit and queue timeout for each pool.
- Return a clear error when a request exceeds the supported limit instead of allowing it to remain suspended indefinitely.
3. Hardware Selection Must Reflect the Full Workload
Many teams compare only per-GPU memory and purchase price when selecting hardware. This can significantly underestimate operational requirements. GPU memory determines whether the model fits, but stable serving also depends on the following factors:
- Task type: Question answering, summarization, code generation, and multi-step reasoning have different memory and latency requirements.
- Context length: Long contexts place most of their additional pressure on the KV cache and require more memory headroom.
- Concurrency: Higher concurrency means more simultaneous cached sequences and makes peak memory usage harder to predict.
- Output length: Generated tokens continue occupying cache memory until generation ends. Long-document generation should be estimated separately.
- Tool calls: Tool use often involves multiple rounds of interaction. The context accumulates over time, and latency also increases.
- Inference framework: Scheduling, memory management, and quantization support vary across frameworks. The target hardware must be tested directly.
- Intra-node interconnects: For multi-GPU parallelism, inter-GPU bandwidth affects throughput and tail latency. The number of GPUs alone is not sufficient.
- Power and cooling: High-power nodes impose hard requirements on electrical capacity and cooling. Infrastructure teams should be involved during hardware selection.
According to deployment guidance from mainstream inference frameworks, an eight-GPU, high-memory node running at 8-bit floating-point (FP8) precision can serve as a reference configuration for single-node deployment. Fully supporting contexts approaching 1 million tokens generally requires more memory per GPU or greater aggregate memory across the node.
These figures are starting points only. The final decision must be based on load tests using the organization’s own workload.
A practical selection process is:
- Estimate peak memory usage from real traffic samples.
- Run tiered load tests on the target hardware.
- Determine node capacity based on time-to-first-token latency and GPU memory utilization observed during testing.
4. Concurrency Parameters Are Not the Same as Online Users
Inference services typically expose two important configuration parameters:
- Maximum context length: The maximum number of tokens a single request can process.
- Maximum concurrent sequences: The maximum number of active sequences that the inference engine can process during a scheduling cycle.
The second parameter is often misunderstood as the number of users the service can support simultaneously. In reality, it is an internal engine-scheduling parameter.
User-side concurrency is determined by request arrival rate and the processing time of each request. Little’s Law provides a useful estimate:
In-flight requests ≈ request arrival rate × average request processing time
For example, if two requests arrive every second and each takes an average of 30 seconds to process, approximately 60 requests are in flight at any given time. Some may be queued, some may be generating output, and others may be calling tools. Only the requests that are actively generating output consume active-sequence slots in the inference engine.
When tuning concurrency, follow these principles:
- High proportion of long requests: Set the active-sequence limit conservatively to prevent long requests from consuming the cache and degrading the entire service.
- High proportion of short requests: Increase the active-sequence limit gradually, while monitoring time-to-first-token latency and GPU memory utilization after each change.
- Apply rate limiting: Gateway-level limits based on user, application, and request length are more controllable than relying only on inference-engine parameters.
The goal is to balance throughput and latency. Increase concurrency step by step, record time-to-first-token latency, tail latency, error rate, and peak memory usage, and identify the point at which latency begins to fluctuate significantly. The production limit should be set before that point, with sufficient headroom.
5. POC Acceptance Must Produce Reproducible Data
A common problem during proof-of-concept (POC) evaluations is showing only a few screenshots of successful outputs. Screenshots prove that the model can return results, but they do not show whether the service can remain stable under realistic workloads.
A useful POC report should include metrics such as:
| Metric | Meaning | Measurement method |
|---|---|---|
| Task completion rate | The percentage of tasks completed correctly on a business evaluation set | Use a fixed evaluation set and assess results manually or with predefined rules |
| Time to first token (TTFT) | Time from request submission until the first token is returned | Record the value for each request during load testing |
| Time per output token (TPOT) | Average generation time per output token | Divide generation time by the number of output tokens |
| P95 and P99 latency | Tail latency that reflects user experience under extreme conditions | Calculate latency percentiles across all requests |
| Tiered length testing | Performance at 32K, 128K, 512K, and near-1M context lengths | Test each tier separately and record failure rates |
| Mixed short and long workloads | How short-request latency changes when long requests are present | Mix traffic at defined ratios and compare the results |
A model that returns text successfully is not necessarily a model that is ready for production. Production readiness requires measurable behavior under realistic task data, concurrency, context lengths, hardware constraints, and failure conditions.
