Skip to content

[Docs] Add Qwen2.5-VL guide for the TRT-LLM PyTorch backend, deprecate Llava1.5 guide - #169

Draft
faradawn wants to merge 7 commits into
triton-inference-server:mainfrom
faradawn:docs/multimodal-pytorch-backend-guide
Draft

[Docs] Add Qwen2.5-VL guide for the TRT-LLM PyTorch backend, deprecate Llava1.5 guide#169
faradawn wants to merge 7 commits into
triton-inference-server:mainfrom
faradawn:docs/multimodal-pytorch-backend-guide

Conversation

@faradawn

@faradawn faradawn commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Add Popular_Models_Guide/Qwen2.5-VL/qwen2_5_vl_trtllm_guide.md, documenting
how to serve a multimodal (vision) model on Triton via the TensorRT-LLM
PyTorch backend through the llmapi backend. No engine build is required.

Also add a deprecation banner to the Llava1.5 TensorRT-LLM guide, whose
prebuilt-engine multimodal path is end-of-life as of TensorRT-LLM v1.2.

The multimodal image_url input and triton_config.multimodal opt-in used by
the new guide are added by NVIDIA/TensorRT-LLM#18381, which is not yet
merged; the guide states this prominently.

Signed-off-by: Faradawn Yang <73060648+faradawn@users.noreply.github.com>
all_models/llmapi/ holds exactly one model directory, so it can be used as a
Triton model repository directly instead of copying files into a new one. Give
the concrete clone and model.yaml commands, and add a curl example with the
response it returns.

Signed-off-by: Faradawn Yang <73060648+faradawn@users.noreply.github.com>
whoisj
whoisj previously approved these changes Sep 2, 2026

@whoisj whoisj left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

The backend now accepts only http(s) URLs and inline data URIs; local
filesystem paths and file:// are rejected because the input is
client-controlled. Document that and drop the local-path example.

Signed-off-by: Faradawn Yang <73060648+faradawn@users.noreply.github.com>
faradawn and others added 3 commits September 8, 2026 12:33
The backend rejects local paths, file:// and data: URIs, so document the
http(s)-only scope and drop the data-URI examples.

Signed-off-by: Faradawn Yang <73060648+faradawn@users.noreply.github.com>
The guide claimed validation on TensorRT-LLM 1.2.1, but following it verbatim
on nvcr.io/nvidia/tritonserver:26.07-trtllm-python-py3 -- the newest published
-trtllm-python-py3 tag -- fails every request that carries an image:

    Error generating request: cannot import name
    'async_build_multimodal_prompt' from 'tensorrt_llm.inputs'

The backend files readers clone call `async_build_multimodal_prompt`, which
NVIDIA/TensorRT-LLM#18381 adds to `tensorrt_llm/inputs/utils.py`. That module
ships inside the wheel, not in the `triton_backend/` tree, so on a 1.2.1
container the caller is present and the callee never is. The server still
starts, still logs `multimodal input enabled`, and still answers text-only
prompts, so the deployment looks healthy right up until the first image.

Add a "Patching model.py for TensorRT-LLM 1.2.1" section carrying the
replacement method and the call-site diff, gated behind a note to skip it once
a container ships with #18381 in it. Say in the validation table that 1.2.1
needs that patch, and record the torch build.

Also fix three things found while testing:

  - The multiple-images example passed `/workspace/images/second.jpg`, a local
    path the guide's own "Allowed scope of access" section says is rejected.
    That example could only ever error. Use two live http URLs and show the
    real two-image answer.
  - Show the actual rejection and connection-failure responses, including the
    `ssl:default [Name or service not known]` tail that was trimmed, as JSON
    response bodies rather than log lines.
  - Add troubleshooting rows for the ImportError and for a rejected scheme.

Verified on 1x B200 with Qwen/Qwen2.5-VL-3B-Instruct: single image returns the
answer this guide quotes, two images are described in order, and the rejection
and unreachable-host paths surface as errors rather than silently degrading to
text-only. Checked by applying the patch text extracted from this file to a
fresh clone, so what is documented is what was run.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
…our files

Follow-up to the previous commit, which described the model.py change but left
the reader to make it by hand. model.py is ~790 lines, and splicing a 40-line
method into the right class at the right indentation is a reliable way to end up
with a broken model repository.

Ship the edit as trtllm_121_compat.py next to the guide instead, invoked in one
command. This is how this directory already works: the Llava1.5 guide being
deprecated here ships multi_modal_client.py beside it, and Llama2 ships
deploy_trtllm_llama.sh.

The script is defensive, because it edits a file the reader did not write:
it is idempotent, it refuses to write source that does not parse, and if the
call it targets is absent it explains that #18381 has probably merged and gives
the one-line import check to confirm, rather than corrupting the checkout.

The guide keeps the explanation -- the call-site diff and a table mapping each
1.3 API onto the 1.2.1 equivalent -- so a reader can still see what changes and
why, without having to type it.

Separately, replace the full clone with a blobless, LFS-skipped sparse checkout:

    GIT_LFS_SKIP_SMUDGE=1 git clone --depth 1 --filter=blob:none --sparse ...
    git -C ... sparse-checkout set triton_backend/all_models/llmapi

Four seconds and 9.1 MB, against roughly 900 MB of Git LFS payload for four
small text files.

Also state plainly that 1.2.1 is the standing target: every published
-trtllm-python-py3 image ships it, so #18381 merging upstream does not remove
the need for this patch. Only a new container image does.

Verified end to end on 1x B200 by running the guide's own commands, including
the shipped script against a fresh sparse clone with nothing hand-edited:
single image returns the quoted answer, two images are described in order, a
rejected scheme and an unreachable host both surface as errors.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants