For the complete documentation index, see llms.txt. Markdown versions of all pages are available by appending .md to any URL (e.g. /max/get-started.md).
Python module
max.pipelines.architectures.mistral3
Mistral 3 vision-language architecture for multimodal text generation.
Mistral3Configβ
class max.pipelines.architectures.mistral3.Mistral3Config(*, hidden_size, num_attention_heads, num_key_value_heads, num_hidden_layers, head_dim, vocab_size, rope_theta, max_seq_len, rms_norm_eps, feed_forward_length, dtype, kv_params, attention_multiplier, devices, return_logits=ReturnLogits.LAST_TOKEN)
Bases: MistralConfig
Configuration for Mistral3 models.
-
Parameters:
-
- hidden_size (int)
- num_attention_heads (int)
- num_key_value_heads (int)
- num_hidden_layers (int)
- head_dim (int)
- vocab_size (int)
- rope_theta (float)
- max_seq_len (int)
- rms_norm_eps (float)
- feed_forward_length (int)
- dtype (DType)
- kv_params (KVCacheParams)
- attention_multiplier (float)
- devices (list[DeviceRef])
- return_logits (ReturnLogits)
initialize()β
classmethod initialize(pipeline_config, model_config=None)
Initializes a MistralConfig instance from pipeline configuration.
This method creates a config instance with all fields that can be determined from the pipeline configuration.
-
Parameters:
-
- pipeline_config (PipelineConfig) β The MAX Engine pipeline configuration.
- model_config (MAXModelConfig | None)
-
Returns:
-
An initialized MistralConfig instance.
-
Return type:
Mistral3Modelβ
class max.pipelines.architectures.mistral3.Mistral3Model(pipeline_config, session, devices, kv_cache_config, weights, adapter=None, return_logits=ReturnLogits.LAST_TOKEN)
Bases: MistralModel
Text-only Mistral3 pipeline model implementation.
-
Parameters:
-
- pipeline_config (PipelineConfig)
- session (InferenceSession)
- devices (list[Device])
- kv_cache_config (KVCacheConfig)
- weights (Weights)
- adapter (WeightsAdapter | None)
- return_logits (ReturnLogits)
calculate_max_seq_len()β
classmethod calculate_max_seq_len(pipeline_config, huggingface_config)
Bounds max_length by max_position_embeddings (config is permissive).
-
Parameters:
-
- pipeline_config (PipelineConfig)
- huggingface_config (AutoConfig)
-
Return type:
get_kv_params()β
classmethod get_kv_params(huggingface_config, pipeline_config, devices, kv_cache_config, cache_dtype)
Returns the KV cache params for the pipeline model.
Delegates to model_config_cls.construct_kv_params(...).
Subclasses with custom KV behavior should override this method.
-
Parameters:
-
- huggingface_config (AutoConfig)
- pipeline_config (PipelineConfig)
- devices (list[DeviceRef])
- kv_cache_config (KVCacheConfig)
- cache_dtype (DType)
-
Return type:
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!