Qwen3-VL-8B on Jetson AGX Thor with TensorRT-Edge-LLM
Deployment guide: NVFP4 quantization, ONNX export and native TensorRT engine build, with EAGLE-3 speculative decoding
Overview
This repository is a reproducible recipe for running Qwen3-VL-8B-Instruct as native TensorRT engines on Jetson AGX
Thor. The work is split across two machines:
- The x86 workstation does everything that needs Python and PyTorch: model download, calibration, NVFP4
quantization with the TensorRT-Edge-LLM ModelOpt tooling, and ONNX export.
- The Thor receives only ONNX graphs and compiles them into TensorRT engines for its own GPU. Inference runs
through the TensorRT-Edge-LLM C++ runtime.
Each step is a numbered script with a verification check. The failures met along the way are documented with
root cause and fix in docs/CHALLENGES.md.
Key capabilities
- NVFP4 weights for the language model and LM head. The base engine is 4.0 GB.
- EAGLE-3 speculative decoding with tree verification. The draft accepted 3.76 tokens per verify pass on average
on the reference workload.
- Multimodal input (image and video) through a BF16 vision engine, up to 1,280 image tokens per request.
- Two engine profiles from one set of ONNX exports: long context (128K-token KV cache) and low latency
(8K-token KV cache).
- A reference HTTP front end. Two single-file Bun/TypeScript servers expose a browser chat UI and an
OpenAI-style
/v1/chat/completions route.
Measured on a Jetson AGX Thor at batch size 1. The reference prompt asked for portfolio-metrics bug finding, a code
fix and JSON output: about 20–30 input tokens and about 512 output tokens.
| Profile |
Decode throughput |
TTFT |
Wall time per request |
KV capacity |
Max input |
Peak unified memory |
| Long context |
67–78 tok/s |
56–68 ms |
15–17 s |
131,072 tokens |
8,192 |
~35 GB |
| Low latency |
88–92 tok/s |
68 ms |
16–17 s |
8,192 tokens |
4,096 |
~16 GB |
| Engine artifact |
Size |
eagle_base.engine (NVFP4 language model, tree attention) |
4.0 GB |
eagle_draft.engine (EAGLE-3 draft) |
763 MB |
visual.engine (BF16 vision encoder) |
1.1 GB |
How to read these numbers
- Throughput is decode-only. Wall time per request adds a 6–8 s cold start, because the runtime loads all three
engines, the embeddings and the tokenizer on every request (see Known limitations).
- All figures come from one prompt type. They are not a benchmark suite. Throughput with speculative decoding
depends on draft acceptance, which varies with content.
- No autoregressive baseline was measured on this build. The speedup from EAGLE-3 is therefore not stated here;
only the measured acceptance (3.76 tokens per verify pass) is.
Measurement detail, memory breakdown and tuning analysis are in docs/BENCHMARKS.md.
Support matrix
Validated configuration. Other versions may work but have not been tested.
| Component |
Export host (x86-64) |
Target (Jetson AGX Thor) |
| OS |
Ubuntu 24.10 |
Jetson Linux (L4T) R38.4 |
| Python |
3.12 (in a venv) |
Not required at runtime |
| CUDA |
12.x with cuDNN |
13.0 |
| TensorRT |
Not required |
10.13.3 |
| TensorRT-Edge-LLM |
tensorrt-edgellm Python package, from pypi.nvidia.com |
C++ build from source, commit 8fe7fe1 (2026-02-20), -DEMBEDDED_TARGET=jetson-thor |
| GPU / memory |
NVIDIA GPU with enough memory for calibration of an 8B model |
Blackwell GPU (sm_110), 128 GB unified memory |
| Disk |
≥ 50 GB free (checkpoints and exports) |
≥ 20 GB free (ONNX and engines) |
| Other |
huggingface-cli, rsync, SSH |
cmake ≥ 3.22, build-essential, Bun |
Note: TensorRT engines are specific to the GPU and TensorRT version that built them. Build engines on the
Thor itself. Only the ONNX exports move between machines.
Architecture
x86-64 export host Jetson AGX Thor
───────────────────────────────── ───────────────────────────────────────────
Hugging Face checkpoints TensorRT-Edge-LLM (C++, built from source)
├─ Qwen3-VL-8B-Instruct │
└─ Qwen3-VL-8B-Instruct-Eagle3 ├─ visual_build ─► visual.engine (BF16)
│ ├─ llm_build --eagleBase
Calibration set (configs/) │ ─► eagle_base.engine (NVFP4)
│ └─ llm_build --eagleDraft
tensorrt-edgellm-quantize-llm (NVFP4) ─► eagle_draft.engine
│ │
tensorrt-edgellm-export-visual ─► visual_enc_onnx/ Assembled engine directory (base + draft + ViT)
tensorrt-edgellm-export-llm ─► llm-eagle/ │
tensorrt-edgellm-export-draft ─► eagle3-draft/ llm_inference (one process per request)
│ │
└──────────── rsync over SSH (~10–12 GB) ──────► Bun servers :8080 long context
:8081 low latency
The design rationale is in docs/ARCHITECTURE.md. It covers the choice of NVFP4, the EAGLE-3
tree parameters, the two-profile split, and the process-per-request execution model.
Deployment procedure
Run the steps in order. Every script uses set -euo pipefail and ends by listing what it produced; check that
output before moving on.
Step 1 — Prepare the export host (x86)
bash scripts/x86/00_install_deps.sh # venv + tensorrt-edgellm from https://pypi.nvidia.com
bash scripts/x86/01_download_models.sh # base model + EAGLE-3 draft into ~/trt-edge-export/models
Verify: both model directories contain config.json and safetensors shards.
Step 2 — Quantize and export to ONNX (x86)
bash scripts/x86/02_build_calib_data.sh # builds the calibration set from configs/calib_dataset_config.py
bash scripts/x86/03_quantize_llm.sh # NVFP4 weights and NVFP4 LM head
bash scripts/x86/04_export_vit.sh # vision encoder, BF16
bash scripts/x86/05_export_llm.sh # language model with --is_eagle_base
bash scripts/x86/06_export_eagle_draft.sh
Verify: 05_export_llm.sh inspects the exported graph and prints enable_tree_attention: 1 [OK]. A value of 0
means the model was exported without --is_eagle_base, and the draft will not attach at build time.
Important: each ONNX directory holds both model.onnx and an external-weights file, onnx_model.data. Copy the
directories whole. Copying model.onnx alone fails later at engine build.
Step 3 — Transfer the exports to the target
THOR_IP=<thor-host> THOR_USER=<user> bash scripts/x86/07_rsync_to_thor.sh
THOR_IP is required. THOR_USER defaults to the local user. The script creates the destination, transfers about
10–12 GB, and lists the received files on the Thor.
Step 4 — Build the runtime and engines (Thor)
bash scripts/thor/00_build_trt_edge.sh # clone and build TensorRT-Edge-LLM; sets EDGELLM_PLUGIN_PATH
bash scripts/thor/01_build_visual_engine.sh # visual.engine
bash scripts/thor/02_build_llm_base_engine.sh # long-context base engine
bash scripts/thor/03_build_llm_fast_engine.sh # low-latency base engine
bash scripts/thor/04_build_draft_engine.sh # long-context draft engine
bash scripts/thor/05_build_draft_fast_engine.sh # low-latency draft engine
bash scripts/thor/06_assemble_engine_dirs.sh # copies the draft and ViT artifacts into each base directory
Verify:
echo $EDGELLM_PLUGIN_PATH points at libNvInfer_edgellm_plugin.so.
~/engines/qwen3-vl-8b/base/ and ~/engines/qwen3-vl-8b-fast/base/ each contain eagle_base.engine,
eagle_draft.engine, draft_config.json and visual.engine.
Step 5 — Start the service (Thor)
bash scripts/thor/07_start_servers.sh # starts the long-context server on :8080
curl -s http://localhost:8080/health
The script starts the long-context server and prints the command for the low-latency server
(bun run trt-chat-fast.ts, port 8081).
Important: run one profile at a time. Each server launches a full inference process per request, and the two
profiles together would contend for the same GPU.
Configuration reference
Engine profiles
| Parameter |
Long context |
Low latency |
Set in |
--maxInputLen |
8,192 |
4,096 |
scripts/thor/02–05 |
--maxKVCacheCapacity |
131,072 |
8,192 |
scripts/thor/02–05 |
--maxBatchSize |
1 |
1 |
scripts/thor/02–05 |
--maxDraftTreeSize / --maxVerifyTreeSize |
60 / 60 |
30 / 30 |
scripts/thor/04, 05 |
--maxImageTokens (vision engine, shared) |
1,280 |
1,280 |
scripts/thor/01 |
Runtime parameters (servers)
| Setting |
trt-chat.ts |
trt-chat-fast.ts |
| Port |
8080 |
8081 |
| Engine directory |
~/engines/qwen3-vl-8b/base |
~/engines/qwen3-vl-8b-fast/base |
| EAGLE draft top-K |
10 |
5 |
| EAGLE draft steps |
6 |
6 |
| EAGLE verify tree size |
60 |
30 |
Important: the runtime verify-tree size must equal the --maxVerifyTreeSize the engine was built with.
A mismatch (for example 61 against an engine built for 60) fails at load. See
docs/CHALLENGES.md.
HTTP interface
| Route |
Method |
Purpose |
/ |
GET |
Browser chat UI |
/health |
GET |
Binary, plugin and engine presence check |
/upload |
POST |
Image or video upload for multimodal prompts |
/v1/chat/completions |
POST |
OpenAI-style chat completion (non-streaming) |
/v1/sessions/{id} |
DELETE |
Clear a server-side chat session |
Troubleshooting
docs/CHALLENGES.md records each failure met during bring-up, with the exact error, the root
cause and the fix. The most common ones:
| Symptom |
Cause |
Resolution |
| Draft engine fails to attach; tree attention is disabled |
Base model exported without --is_eagle_base |
Re-run 05_export_llm.sh; confirm enable_tree_attention: 1 |
Failed to open file: onnx_model.data at engine build |
External-weights file not transferred |
Copy the whole ONNX directory (07_rsync_to_thor.sh) |
| Plugin or custom-op not found at build or run time |
EDGELLM_PLUGIN_PATH not set |
Export the path to libNvInfer_edgellm_plugin.so |
| Engine load fails on verify-tree size |
Runtime value differs from build value |
Match the server’s eagleVerify to --maxVerifyTreeSize |
| Multimodal request fails |
Vision engine directory not passed |
Pass --multimodalEngineDir (the servers do this) |
UI shows [No output] despite generated tokens |
Reading the wrong field of output.json |
Parse responses[n].output_text |
rsync: mkdir ... failed |
Destination missing on the target |
Create ~/onnx/qwen3-vl-8b on the Thor first |
Known limitations
- Cold start on every request (6–8 s). The TensorRT-Edge-LLM example runtime loads its engines, runs one
request and exits. The servers spawn it per request. A warm process pool is described in
docs/ARCHITECTURE.md but not implemented.
- Single stream. Engines are built with
--maxBatchSize 1, and the server runs one inference at a time.
- No streaming responses.
/v1/chat/completions returns the full completion.
- Narrow measurement. Throughput was measured on one prompt type with short inputs. Long-input prefill and
accuracy against the BF16 model were not evaluated in this repository.
- Harmless load-time warnings. The draft model logs a vocabulary-size warning (32K draft vocabulary against
151K) and an
mrope_interleaved config warning. Neither affects output.
Security considerations
The reference servers are development tools. They are not hardened for production.
- They bind to
0.0.0.0 with no authentication and permissive CORS. Expose them only on a trusted private
network, such as a VPN or overlay network like Tailscale, or behind an authenticating reverse proxy.
/upload writes client-supplied files to a temporary directory on the device.
- The scripts contain no credentials or hostnames. The target address is supplied at run time (
THOR_IP).
Repository layout
| Path |
Contents |
scripts/x86/ |
Export-host steps 00–07: environment, download, calibration, quantization, ONNX export, transfer |
scripts/thor/ |
Target steps 00–07: runtime build, engine builds, directory assembly, service start |
configs/calib_dataset_config.py |
Calibration-set definition used for NVFP4 quantization |
servers/ |
Bun/TypeScript HTTP servers for the two profiles |
docs/ARCHITECTURE.md |
Design rationale: NVFP4, EAGLE-3, profiles, execution model |
docs/BENCHMARKS.md |
Measurements, memory budget and tuning analysis |
docs/CHALLENGES.md |
Every bring-up failure with root cause and fix |
License and third-party notices
- This repository (scripts, configuration, servers, documentation): MIT. See
LICENSE.
- NVIDIA TensorRT-Edge-LLM: Apache-2.0. It is not redistributed here; the scripts clone it from GitHub.
- NVIDIA TensorRT and CUDA are governed by their respective NVIDIA license agreements.
- Qwen3-VL-8B-Instruct: Apache-2.0 (Qwen team).
- EAGLE-3 draft: see the
taobao-mnn/Qwen3-VL-8B-Instruct-Eagle3
model card for its terms.
No model weights, ONNX files or engines are distributed in this repository.
This is an independent community project. It is not affiliated with, endorsed by, or supported by NVIDIA or the Qwen
team.
Citation
@misc{devaney2026qwen3vltrtedge,
title = {Qwen3-VL-8B on Jetson AGX Thor with TensorRT-Edge-LLM: NVFP4, ONNX export and EAGLE-3 engine build},
author = {Devaney, Patrick},
year = {2026},
url = {https://github.com/patrickbdevaney/qwen3-vl-tensorrt-edge-llm}
}
评论