Views
No views yet
trtllm-build to produce an engine for inference.| Item | Value |
|---|---|
| Base model | Mistral-7B-Instruct-v0.3 |
| Framework | TensorRT-LLM (checkpoint format) |
| Weight quantization | NVFP4 (W4A4) |
| KV cache | FP8 |
| Producer | TensorRT-Model-Optimizer llm_ptq + TensorRT-LLM convert_checkpoint (--use_nvfp4, --fp8_kv_cache) |
| Architecture | MistralForCausalLM (decoder-only) |
1sudo apt install git-lfs
2git lfs install
3
4pip install tensorrt_llm --extra-index-url https://pypi.nvidia.com
5# Install TensorRT-Model-Optimizer (required for NVFP4 quantization)
6# See https://github.com/NVIDIA/TensorRT-Model-Optimizer1# Example: after llm_ptq has produced PTQ output (NVFP4 weights),
2# run convert_checkpoint with that directory as --model_dir:
3python TensorRT-LLM/examples/mistral/convert_checkpoint.py \
4 --model_dir ./path/to/ptq_output \
5 --output_dir ./mistral-7b-instruct-v0.3-trtllm-ckpt-wq_nvfp4-kv_fp8 \
6 --dtype float16 \
7 --use_nvfp4 \
8 --fp8_kv_cache--output_dir contains config.json and rank0.safetensors; that is the checkpoint in this repo.1cd ./mistral-7b-instruct-v0.3-trtllm-ckpt-wq_nvfp4-kv_fp8
2
3huggingface-cli repo create rungalileo/mistral-7b-instruct-v0.3-trtllm-ckpt-wq_nvfp4-kv_fp8 --repo-type model
4huggingface-cli upload rungalileo/mistral-7b-instruct-v0.3-trtllm-ckpt-wq_nvfp4-kv_fp8 . --repo-type modeltensorrt_llm installed:1git clone https://huggingface.co/rungalileo/mistral-7b-instruct-v0.3-trtllm-ckpt-wq_nvfp4-kv_fp8
2cd mistral-7b-instruct-v0.3-trtllm-ckpt-wq_nvfp4-kv_fp8
3
4trtllm-build --checkpoint_dir . --output_dir ./engine \
5 --max_batch_size 1 --max_input_len 512 --max_seq_len 1024mistralai/Mistral-7B-Instruct-v0.3):1trtllm-serve ./engine --tokenizer mistralai/Mistral-7B-Instruct-v0.3 --port 8000
2# OpenAI-compatible API: http://localhost:8000/v1/completionsconfig.json – TensorRT-LLM model configrank0.safetensors – Rank 0 weights (single-GPU)