[Feature]: Expose variable beam width through the Triton LLM API backend
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 14.7k
- Forks
- 2.8k
- Avg merge
- 2d 23h
- Merged PRs (30d)
- 489
Description
🚀 The feature, motivation and pitch
TensorRT-LLM already exposes variable-beam-width search through SamplingParams.beam_width_array and the executor's SamplingConfig::beamWidthArray. However, the Triton LLM API Python backend cannot pass this setting in a request. It also does not currently expose the LLM API beam-search controls n and use_beam_search.
As a result, users serving through Triton must maintain a custom backend wrapper or binary interposition layer even though the underlying public TensorRT-LLM API supports the feature.
I propose adding these optional Triton request inputs:
sampling_param_n(INT32, scalar)sampling_param_use_beam_search(BOOL, scalar)sampling_param_beam_width_array(INT32, one-dimensional array)
The backend would map them directly to the existing SamplingParams fields. For example, a request could use n=3, best_of=80, use_beam_search=true, and beam_width_array=[10, 50, 80].
All inputs are optional, so requests that do not use them retain the current behavior.
Alternatives
- Call the TensorRT-LLM LLM API directly instead of serving through Triton.
- Maintain a custom Triton model/backend wrapper.
- Interpose the backend's sampling-config parser at runtime.
The latter two approaches are version-sensitive and duplicate an API that TensorRT-LLM already provides.
Additional context
The proposed adapter change includes unit coverage for:
- mapping all beam-search controls;
- preserving behavior when
beam_width_arrayis absent; - selecting the correct schedule for each item in a batched request.
Beam schedules affect search quality and should be evaluated for each workload; this proposal only exposes the existing TensorRT-LLM mechanism through Triton.
Before submitting a new issue...
- I searched existing issues and the documentation for
beam_width_arrayand variable beam width support.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the Triton LLM API Python backend and its existing mapping from request inputs to SamplingParams. Trace how batched requests select sampling schedules, then add coverage for all three optional inputs, absent beam_width_array behavior, and per-item batch selection. Done means Triton requests can pass n, use_beam_search, and beam_width_array without changing existing requests.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- api, backend
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100