Mistral with TensorRT-LLM
Build an optimized inference engine for Mistral
This configuration builds an inference engine to serve Mistral 7B on an H100 GPU. It is very similar to the configuration for any other Mistral model, including fine-tuned variants.
Setup
See the end-to-end engine builder tutorial prerequisites for full setup instructions.
Make sure you have accessed the gated model on Hugging Face and set your hf_access_token
in your Baseten workspace secrets.
Please upgrade to the latest version of Truss with pip install --upgrade truss
before following this example.
Configuration
This configuration is optimized for low latency, with a batch size of 8. It applies post-training quantization to fp8
for further speed gains.
Deployment
Usage
The input text prompt to guide the language modelβs generation.
One of prompt
XOR messages
is required.
A list of dictionaries representing the message history, typically used in conversational contexts.
One of prompt
XOR messages
is required.
The maximum number of tokens to generate in the output. Controls the length of the generated text.
The number of beams used in beam search. Maximum of 1
.
A penalty applied to repeated tokens to discourage the model from repeating the same words or phrases.
A penalty applied to tokens already present in the prompt to encourage the generation of new topics.
Controls the randomness of the output. Lower values make the output more deterministic, while higher values increase randomness.
A penalty applied to the length of the generated sequence to control verbosity. Higher values make the model favor shorter outputs.
The token ID that indicates the end of the generated sequence.
The token ID used for padding sequences to a uniform length.
Limits the sampling pool to the top k
tokens, ensuring the model only considers the most likely tokens at each step.
Applies nucleus sampling to limit the sampling pool to a cumulative probability p
, ensuring only the most likely tokens are considered.