A coding agent can start streaming promptly and still slow to a crawl once several other requests reach the same replica. If you operate an isolated NVIDIA NIM deployment, you can use NVIDIA NIM benchmarking with AIPerf to find a per-replica concurrency limit that protects the slow tail of streaming while making good use of the replica. This tutorial tests 1, 4, 8 and 16 concurrent requests against one pinned profile. You’ll finish with an evidence-backed candidate for your admission limit and a repeatable benchmark for the previous setting.
The example uses a 75 ms p95 inter-token latency (ITL) budget. Apply the budget after checking that a run completed the intended workload. Then choose the highest aggregate output-token throughput among the passing runs. The worked result is illustrative. Your replica, trace slice and client exports determine your own result.
NVIDIA’s December 4, 2026 tuning study held model weights, precision, GPU topology and context length fixed while comparing runtime configurations. It used mean ITL and mean time to first token as constraints. Here the runtime configuration stays fixed and client concurrency changes. The 75 ms p95 constraint belongs to this exercise. NVIDIA Technical Blog

NVIDIA Technical Blog’s headline for its December 4, 2026 NIM tuning study. The worked concurrency results below are illustrative.
Pin the replica you intend to measure
- Use one isolated, ready vLLM-backed NIM replica serving Nemotron 3 Ultra for the documented trace path. The commands assume one served model at
http://localhost:8000and the matching tokenizer available to AIPerf. NVIDIA documents the trace sweep for AIPerf 0.10.0. If you use a later release, confirm that it accepts the flags below and keep its version fixed throughout. Have Bash, Python 3, curl,sha256sumand OpenSSL available on the benchmark host. Keep the client on the same host as NIM so that the network path stays comparable. NIM trace benchmarking guide · NIM benchmarking quickstart - In the existing launch configuration, set
NIM_MODEL_PROFILEto the full compatible profile ID for that image andNIM_LOG_LEVEL=INFO. Use the ID fromlist-model-profilesfor the exact image you’re running. Preserve the existing GPU allocation and backend arguments. Once the replica is ready, compare theprofile_idfrom/v1/metadatawith the ID you set. Save the startupResolved configuration:entry next to the benchmark results. NIM model profiles and selection · NIM trace benchmarking guide - Confirm the resolved context limit before sending the trace. This example assumes the running profile supports at least 100,000 total tokens per request, including output. Record the image identifier, checkpoint, GPU type and count, engine, resolved context limit and current per-replica admission limit. The illustrative previous limit is four in-flight inference requests. Keep the current ingress configuration or its exact revision available for recovery. NIM model profiles and selection
A profile ID identifies the selected manifest entry. The resolved arguments show what the backend was actually launched with. Direct container arguments and other configuration layers can override profile settings, so you need both records. A context cap or cache setting changed out of band can shift the curve even if the served model ID looks identical. Capture the metadata again if the replica restarts. If its image, profile or resolved arguments changed, start a separate series.
Use the same serving endpoint, client host and replica for every run. A limit of eight in this guide refers to eight outstanding inference requests to that one replica. Eight coding sessions can generate a different number of simultaneous requests, and a load-balanced service can distribute requests unevenly. The sweep sets offered concurrency from the client. Applying a cap to shared traffic is a separate change at the admission point you operate. For a sweep that includes eight and sixteen, reach the isolated replica directly so the old ingress cap of four cannot throttle the benchmark. Keep the existing admission configuration available as the recovery target.
The Amazon Ergo vLLM benchmark varies speculative-decoding verification mode. If you later want to compare engine settings, give each setting its own sweep so changes in the serving configuration and offered load remain attributable. If your test URL routes through a model router, verify the actual destination before treating it as a single-replica test. Debug a vLLM Semantic Router decision
Build one bounded replay file
- Fetch the published Dynamo agentic trace using the GitHub media host in NVIDIA’s guide. Verify the original bytes before deriving the replay file. A Git LFS pointer has the same name as the trace, and NVIDIA documents a failure mode where AIPerf can produce a convincing export from the pointer. The checksum in the command identifies the documented 3,541-row object. NIM trace benchmarking guide
- Take the first 256 eligible rows in file order with positive input length, at least two requested output tokens and a combined recorded length of at most 96,000. Keep each selected row intact, including its
hash_ids. The Mooncake JSONL format usesinput_length,output_lengthandhash_ids. The filtering logic here is tutorial code applied to that format. Run a published trace - Save the resulting slice digest and expected input and output means. Those means become the targets for the replay checks. The source file’s mean lengths describe all 3,541 rows and its largest recorded input exceeds 1.35 million tokens. The smaller slice makes this exercise practical and removes requests outside the chosen length bound. Its measured outcome applies to the selected rows and the prefix reuse they retain. NIM trace benchmarking guide
Copy the following into prepare-trace.sh and run bash prepare-trace.sh in a fresh benchmark directory. The recorded length ceiling leaves 4,000 tokens between the filter and the minimum resolved limit used here. Actual formatted length depends on the tokenizer and chat template. Treat that allowance as a starting margin and inspect any context errors even when the source arithmetic fits. Keep the derived file after the run so an upstream path change cannot alter your recovery test.
set -euo pipefail
mkdir -p traces
source_name=nim_turbo_64k_400_90kv_agent_new_noschedule_short_15perc.jsonl
source_file="traces/$source_name"
curl -fsSL -o "$source_file" \
"https://media.githubusercontent.com/media/ai-dynamo/dynamo/main/recipes/nemotron-3-ultra/perf/traces/$source_name"
# Expected: OK for the documented source object.
printf '%s %s\n' \
f20d3f2bc83dd1306cda659fbe34e7c4d85ca5497626c98bc0b1c4d2211379d0 \
"$source_file" | sha256sum -c -
python3 - "$source_file" <<'PY'
import json
import sys
from pathlib import Path
from statistics import mean
rows = [json.loads(line) for line in Path(sys.argv[1]).read_text().splitlines()]
if len(rows) != 3541:
raise SystemExit(f'Expected 3541 original rows, got {len(rows)}')
chosen = [row for row in rows if row['input_length'] > 0
and row['output_length'] >= 2
and row['input_length'] + row['output_length'] <= 96000][:256]
if len(chosen) != 256:
raise SystemExit(f'Expected 256 eligible rows, got {len(chosen)}')
Path('traces/coding-256.jsonl').write_text(''.join(json.dumps(row) + '\n' for row in chosen))
expected = {
'requests': len(chosen),
'input_mean': mean(row['input_length'] for row in chosen),
'output_mean': mean(row['output_length'] for row in chosen),
}
Path('traces/coding-256-expected.json').write_text(json.dumps(expected, indent=2) + '\n')
print(json.dumps(expected, indent=2))
PY
sha256sum traces/coding-256.jsonl > traces/coding-256.sha256
Expect the Python step to print requests equal to 256 plus two token means. If the checksum fails, inspect the start of the downloaded file as text. A first line of version https://git-lfs.github.com/spec/v1 identifies a pointer. Verify the media.githubusercontent.com/media/ URL and repeat the download. If the host returned HTML or a partial response, discard that local download and fetch again. If the upstream object changed, use a retained copy matching the documented digest. A different trace needs its own digest and expected means and cannot fill a missing point in this series. NIM trace benchmarking guide · Git LFS checkout and fixture recovery
This fixture preserves recorded lengths and hash relationships from a coding-agent workload. AIPerf constructs prompts from those records. The file used here has no timestamps, so concurrency drives the replay. AIPerf also documents TraceLab, which groups rounds into sessions and can follow recorded timestamps. Its dataset-entry and delay controls belong to that session-based path. Keep the Mooncake loader for the file prepared above. AIPerf TraceLab replay tutorial · NIM trace benchmarking guide
Profile four concurrency levels with AIPerf
- Save the script below as
sweep.sh. It checks the slice digest, captures readiness, metadata and the served model list, and creates a separate directory for the series. Put the savedResolved configuration:entry in that series directory after the run. Use a fresh series directory for each attempt, including retries. - Run
bash sweep.sh artifacts/sweep-01to collect all four points. For each concurrency, expect a separateprofile_export_aiperf.jsoninc1,c4,c8orc16. A command failure is reported for the affected point and the loop proceeds, so the other runs retain their own results. The comparison later requires reviewing every attempted point, including any failure. - At each point verify the same trace path, tokenizer, streaming chat endpoint and 256-request limit. Sequential sampling walks the local file in order. With the request count equal to the number of selected rows, a completed run is intended to consume the slice once. Concurrent requests can finish in a different order. NIM trace benchmarking guide
set -euo pipefail
series=${1:?Supply a new artifact directory}
shift
if [ "$#" -eq 0 ]; then
set -- 1 4 8 16
fi
mkdir -p artifacts
mkdir "$series"
sha256sum -c traces/coding-256.sha256
cp traces/coding-256.sha256 traces/coding-256-expected.json "$series/"
endpoint=http://localhost:8000
# Expected: readiness succeeds and the model list contains one model.
curl -fsS "$endpoint/v1/health/ready" > "$series/ready.txt"
curl -fsS "$endpoint/v1/metadata" > "$series/nim-metadata.json"
curl -fsS "$endpoint/v1/models" > "$series/served-models.json"
model=$(python3 - "$series/served-models.json" <<'PY'
import json
import sys
from pathlib import Path
models = json.loads(Path(sys.argv[1]).read_text())['data']
if len(models) != 1:
raise SystemExit('Expected exactly one served model')
print(models[0]['id'])
PY
)
tokenizer=nvidia/NVIDIA-Nemotron-3-Ultra-550B-A55B-BF16
trace=traces/coding-256.jsonl
for concurrency in "$@"; do
salt=$(openssl rand -hex 6)
if aiperf profile \
--ui none \
-m "$model" \
--tokenizer "$tokenizer" \
--tokenizer-trust-remote-code \
--url "$endpoint" \
--endpoint-type chat \
--streaming \
--concurrency "$concurrency" \
--workers-max "$concurrency" \
--input-file "$trace" \
--custom-dataset-type mooncake_trace \
--no-fixed-schedule \
--dataset-sampling-strategy sequential \
--use-server-token-count \
--extra-inputs ignore_eos:true \
--extra-inputs "cache_salt:salt_$salt" \
--num-requests 256 \
--artifact-dir "$series/c$concurrency"; then
printf 'Completed client run at concurrency %s\n' "$concurrency"
else
printf 'AIPerf failed at concurrency %s\n' "$concurrency" >&2
fi
done
Use --tokenizer-trust-remote-code only with the documented tokenizer and code your environment already trusts. The tokenizer reconstructs prompts from the trace. Server-reported counts help check what the model actually processed, including chat wrapping. The chat endpoint retains the shared system prefix used by the workload. Test the chat endpoint whenever you investigate a routing or model-name failure, since a successful text-completions response leaves the system role untested. NIM trace benchmarking guide · AIPerf input sequence length tokenization
--workers-max follows --concurrency as in NVIDIA’s trace sweep. You are scaling the offered work and the client worker ceiling together. ignore_eos:true asks the backend to continue generating past an end-of-sequence token so it can reach the trace’s requested output length. The fresh salt is intentionally different for each point. It isolates cached prefixes across runs when the backend honors the salt. Requests within a point share a salt, so the replay can still exercise prefix reuse among those requests. NIM trace benchmarking guide
Keep the run directories next to the retained slice. The script’s completion line means the client command exited successfully. Open the export before treating that line as a valid data point. If the expected file is absent, keep the logs from that attempt and retry that point in a new directory once you understand the failure. For example, bash sweep.sh artifacts/retry-c16 16 exercises only the last point. Keep the trace and server fixed when filling that gap.
Check the client export before ranking throughput
- Start with
input_configin eachprofile_export_aiperf.json. Confirm the served model, URL, chat streaming, tokenizer, trace path,mooncake_traceloader, sequential sampling, concurrency timing and 256-request limit. The worker maximum should follow the intended concurrency. Expect the artifact directory and cache salt to differ across points. Compare the server metadata with the pinned profile and keep the resolved server configuration alongside the four client exports. NIM trace benchmarking guide · AIPerf JSON export schema - Require 256 successful requests, zero failures and no cancellation for this bounded example. Check
request_count.avg, the error count and the error summary. If a count is unclear, inspect the per-requestprofile_export.jsonlwhere available. A failed record carries an error object with code, type and message. Count profiling records when the export identifies benchmark phases. Treat missing completion evidence as unresolved. Working with AIPerf profile export files · AIPerf metrics reference - Compare
input_sequence_length.avgwithinput_meanfrom the local slice andoutput_sequence_length.avgwithoutput_mean. Use roughly ±10% as a first check for the input, following NVIDIA’s replay guidance. For this exercise also flag an output mean outside ±10% and investigate any reportedosl_mismatch_count. Inspect the lengths and per-request discrepancies before ranking a flagged run. A close mean can hide individual early stops or an incomplete long tail. NIM trace benchmarking guide · AIPerf metrics reference - Read
inter_token_latency.p95in milliseconds andoutput_token_throughput.avgin output tokens per second. Confirm the metric units in the export. Check the number of ITL observations if the export carries the record count and investigate unexpectedly thin coverage before deciding. If ITL is missing, check that requests streamed qualifying content and produced enough tokens for AIPerf to calculate it. AIPerf JSON export schema · AIPerf metrics reference
ITL summarizes each qualifying stream’s decode interval per token after the first qualifying response. The p95 is a percentile across those per-request values. Individual chunk gaps can be longer than the per-request average. Aggregate output-token throughput counts generated tokens across requests over the benchmark window, including reasoning tokens where they contribute to output sequence length. Record time to first token alongside your decision if first-response wait matters to your application. The example’s selection rule uses the specified ITL budget and aggregate throughput after workload validation. AIPerf metrics reference
Use the error record to decide what to change. A model error at concurrency one sends you back to /v1/models and the target endpoint in input_config. A context error sends you to the offending request length and resolved context cap, including room for generated tokens. If you reduce the length ceiling, create and record a new slice and replay it at every concurrency. For timeouts concentrated at 16, preserve the failed point and check the replica logs for matching times or request IDs. A point with incomplete traffic is ineligible even when the surviving requests show low p95. Working with AIPerf profile export files
When input averages are implausibly small, use the checksum to rule out a bad fixture, then inspect the endpoint type and matching tokenizer. A large drop can indicate loss of the shared system prefix. When output is short, check that the backend accepted ignore_eos:true and look for mismatches between requested and actual generation lengths. If you spot an apparent gain at one point, compare its output length distribution with its neighbors before counting the gain. Shorter completions on the longest requests can reduce the amount of time the replica spends decoding and alter the shape of the curve. Keep the source bytes with the client and server records so another engineer can reconstruct the discrepancy. NIM trace benchmarking guide · Preserve enough evidence to replay an agent run
Pick the fastest passing point and keep four recoverable
The following numbers are illustrative expected observations, with one pinned profile, a prior cap of four and a 75 ms p95 ITL budget. Suppose each row has 256 successful requests, zero failures, a matching configuration and token lengths consistent with the local slice. Apply the same decision to the values in your own exports.
| Input | Action | Expected result |
|---|---|---|
task:nim-concurrency-01, coding-256.jsonl, concurrency 1 |
Run bash sweep.sh artifacts/sweep-01 and inspect c1/profile_export_aiperf.json under that series. |
Illustrative 34 ms p95 ITL and 80 output tokens/s. Eligible and useful as the lightest-load point. |
task:nim-concurrency-01, same slice, concurrency 4 and previous limit |
Inspect c4/profile_export_aiperf.json and retain it as the previous-cap benchmark for recovery. |
Illustrative 54 ms p95 ITL and 210 output tokens/s. Eligible and the comparison point for a rollback. |
task:nim-concurrency-01, same slice, concurrency 8 |
Compare c8/profile_export_aiperf.json against the 75 ms budget and compare aggregate output throughput with the eligible points. |
Illustrative 72 ms p95 ITL and 340 output tokens/s. Select eight because it has the highest eligible throughput. |
task:nim-concurrency-01, same slice, concurrency 16 |
Read c16/profile_export_aiperf.json and apply the same p95 rule before comparing throughput. |
Illustrative 96 ms p95 ITL and 420 output tokens/s. The point exceeds the budget and is ineligible. |
The move from four to eight buys 130 output tokens per second in the illustration and leaves 3 ms of headroom. Repeat eight and four with fresh series directories if you see that small a margin. A valid repeat at eight above 75 ms would make four the stronger choice until you can explain the spread. Keep the individual p95 values when you repeat a point. Averaging run percentiles can conceal a repeat that independently breached the budget. If the highest passing point is repeatable and the next tested point fails, you can use the passing point as your candidate. A finer sweep between eight and sixteen would be a new measurement of the intervening values.
If every valid measured point exceeds 75 ms, record no qualifying point. Concurrency one shows whether the lightest offered load in this sweep already misses the budget. Compare prompt and output lengths, the request’s first-token wait and the decode metric before changing anything. If another profile or a different request class is warranted, make that a separately identified experiment. If all four points are invalid, repair the benchmark first. A failed workload check leaves the latency decision open. NIM benchmarking quickstart
To apply eight, use the existing per-replica admission control that owns the previous value of four. Keep excess requests subject to that layer’s existing queue or rejection policy. The AIPerf command sets offered load during the test. Apply and verify the actual setting separately using the controls for your ingress or request scheduler. In your rollout record, attach the four artifacts and note which route and replica the new cap governs. Keep the earlier configuration revision so there is a concrete change to undo if real traffic shows error or latency regression. AgentOps and fleet operations
For recovery, restore four in the same admission layer and confirm its effective setting there. With the original replica configuration and retained trace, run bash sweep.sh artifacts/recovery-01 4. Expect one fresh export at artifacts/recovery-01/c4/profile_export_aiperf.json. Verify profile identity, accepted client settings, request accounting, token lengths and the 75 ms budget again. Compare throughput and p95 with the original valid four-request export and investigate meaningful drift. A healthy endpoint shows that the replica is available. The recovery replay shows whether the previous operating point still meets the measured latency requirement on the replica. Keep both checks in the recovery record because the direct benchmark and admission setting describe different parts of the deployment.
Sources
- NVIDIA Technical Blog, How NVIDIA NIM Tuning Delivers 2x Throughput for Open Models
- NVIDIA AIPerf, Profile with TraceLab Agentic Coding Traces
- NVIDIA NIM, Benchmarking
- NVIDIA NIM, Model Profiles and Selection
- NVIDIA NIM, Using AIPerf to Benchmark
- NVIDIA AIPerf, Working with Profile Export Files
- NVIDIA AIPerf, Input Sequence Length Tokenization
- NVIDIA AIPerf, Metrics Reference
- NVIDIA AIPerf, Run a Published Trace
- NVIDIA AIPerf, JSON Export Schema

