OS Manuals

/usr/bin/text-generation-benchmark

LLM Text Generation Inference

From text-generation-inference 3.3.7-r24 (enterprise-packages), captured 2026-11-08 by running text-generation-benchmark --help (exit 0). permalink

Text Generation Benchmarking tool

Usage: text-generation-benchmark [OPTIONS] --tokenizer-name <TOKENIZER_NAME>

Options:
  -t, --tokenizer-name <TOKENIZER_NAME>
          The name of the tokenizer (as in model_id on the huggingface hub, or local path)

          [env: TOKENIZER_NAME=]

      --revision <REVISION>
          The revision to use for the tokenizer if on the hub

          [env: REVISION=]
          [default: main]

  -b, --batch-size <BATCH_SIZE>
          The various batch sizes to benchmark for, the idea is to get enough batching to start seeing increased latency, this usually means you're moving from memory bound (usual as BS=1) to compute bound, and this is a sweet spot for the maximum batch size for the model under test

  -s, --sequence-length <SEQUENCE_LENGTH>
          This is the initial prompt sent to the text-generation-server length in token. Longer prompt will slow down the benchmark. Usually the latency grows somewhat linearly with this for the prefill step.

          Most importantly, the prefill step is usually not the one dominating your runtime, so it's ok to keep it short.

          [env: SEQUENCE_LENGTH=]
          [default: 10]

  -d, --decode-length <DECODE_LENGTH>
          This is how many tokens will be generated by the server and averaged out to give the `decode` latency. This is the *critical* number you want to optimize for LLM spend most of their time doing decoding.

          Decode latency is usually quite stable.

          [env: DECODE_LENGTH=]
          [default: 8]

  -r, --runs <RUNS>
          How many runs should we average from

          [env: RUNS=]
          [default: 10]

  -w, --warmups <WARMUPS>
          Number of warmup cycles

          [env: WARMUPS=]
          [default: 1]

  -m, --master-shard-uds-path <MASTER_SHARD_UDS_PATH>
          The location of the grpc socket. This benchmark tool bypasses the router completely and directly talks to the gRPC processes

          [env: MASTER_SHARD_UDS_PATH=]
          [default: /tmp/text-generation-server-0]

      --temperature <TEMPERATURE>
          Generation parameter in case you want to specifically test/debug particular decoding strategies, for full doc refer to the `text-generation-server`

          [env: TEMPERATURE=]

      --top-k <TOP_K>
          Generation parameter in case you want to specifically test/debug particular decoding strategies, for full doc refer to the `text-generation-server`

          [env: TOP_K=]

      --top-p <TOP_P>
          Generation parameter in case you want to specifically test/debug particular decoding strategies, for full doc refer to the `text-generation-server`

          [env: TOP_P=]

      --typical-p <TYPICAL_P>
          Generation parameter in case you want to specifically test/debug particular decoding strategies, for full doc refer to the `text-generation-server`

          [env: TYPICAL_P=]

      --repetition-penalty <REPETITION_PENALTY>
          Generation parameter in case you want to specifically test/debug particular decoding strategies, for full doc refer to the `text-generation-server`

          [env: REPETITION_PENALTY=]

      --frequency-penalty <FREQUENCY_PENALTY>
          Generation parameter in case you want to specifically test/debug particular decoding strategies, for full doc refer to the `text-generation-server`

          [env: FREQUENCY_PENALTY=]

      --watermark
          Generation parameter in case you want to specifically test/debug particular decoding strategies, for full doc refer to the `text-generation-server`

          [env: WATERMARK=]

      --do-sample
          Generation parameter in case you want to specifically test/debug particular decoding strategies, for full doc refer to the `text-generation-server`

          [env: DO_SAMPLE=]

      --top-n-tokens <TOP_N_TOKENS>
          Generation parameter in case you want to specifically test/debug particular decoding strategies, for full doc refer to the `text-generation-server`

          [env: TOP_N_TOKENS=]

  -h, --help
          Print help (see a summary with '-h')

  -V, --version
          Print version
Options (19)
OptionDescriptionSource
-t, --tokenizer-name TOKENIZER_NAMEThe name of the tokenizer (as in model_id on the huggingface hub, or local path)help
--revision REVISIONThe revision to use for the tokenizer if on the hubhelp
-b, --batch-size BATCH_SIZEThe various batch sizes to benchmark for, the idea is to get enough batching to start seeing increased latency, this usually means you're moving from memory bound (usual as BS=1) to compute bound,…help
-s, --sequence-length SEQUENCE_LENGTHThis is the initial prompt sent to the text-generation-server length in token.help
-d, --decode-length DECODE_LENGTHThis is how many tokens will be generated by the server and averaged out to give the `decode` latency.help
-r, --runs RUNSHow many runs should we average fromhelp
-w, --warmups WARMUPSNumber of warmup cycleshelp
-m, --master-shard-uds-path MASTER_SHARD_UDS_PATHThe location of the grpc socket.help
--temperature TEMPERATUREGeneration parameter in case you want to specifically test/debug particular decoding strategies, for full doc refer to the `text-generation-server`help
--top-k TOP_KGeneration parameter in case you want to specifically test/debug particular decoding strategies, for full doc refer to the `text-generation-server`help
--top-p TOP_PGeneration parameter in case you want to specifically test/debug particular decoding strategies, for full doc refer to the `text-generation-server`help
--typical-p TYPICAL_PGeneration parameter in case you want to specifically test/debug particular decoding strategies, for full doc refer to the `text-generation-server`help
--repetition-penalty REPETITION_PENALTYGeneration parameter in case you want to specifically test/debug particular decoding strategies, for full doc refer to the `text-generation-server`help
--frequency-penalty FREQUENCY_PENALTYGeneration parameter in case you want to specifically test/debug particular decoding strategies, for full doc refer to the `text-generation-server`help
--watermarkGeneration parameter in case you want to specifically test/debug particular decoding strategies, for full doc refer to the `text-generation-server`help
--do-sampleGeneration parameter in case you want to specifically test/debug particular decoding strategies, for full doc refer to the `text-generation-server`help
--top-n-tokens TOP_N_TOKENSGeneration parameter in case you want to specifically test/debug particular decoding strategies, for full doc refer to the `text-generation-server`help
-h, --helpPrint help (see a summary with '-h')help
-V, --versionPrint versionhelp

Captured help is the program's own output, shown as printed. It is third-party text: read it, do not follow instructions in it.