For the complete documentation index, see llms.txt. Markdown versions of all pages are available by appending .md to any URL (e.g. /get-started.md).
Python module
max.pipelines.architectures.minimax_music3
Generates music from a text description and lyrics.
MiniMaxMusic3ArchConfig
class max.pipelines.architectures.minimax_music3.MiniMaxMusic3ArchConfig(*, pipeline_config, quantization_encoding=None)
Bases: ArchConfig
Configures the MiniMax Music 3 pipeline without a KV cache.
Unlike text models, this pipeline does not cache the request’s tokens. The autoregressive stage caches generated audio frames instead, so it allocates that cache itself and this config has no KV cache parameters to set.
-
Parameters:
-
- pipeline_config (PipelineConfig)
- quantization_encoding (SupportedEncoding | None)
DEFAULT_ENCODING
DEFAULT_ENCODING: ClassVar[SupportedEncoding] = 'bfloat16'
SUPPORTED_ENCODINGS
SUPPORTED_ENCODINGS: ClassVar[set[SupportedEncoding]] = {'bfloat16'}
calculate_max_seq_len()
classmethod calculate_max_seq_len(huggingface_config, model_config)
Returns the tokenizer’s fixed prompt limit of MAX_PROMPT_TOKENS.
Other architectures bound the user’s requested max_length here.
This model has one prompt limit, so a requested length has no effect.
-
Parameters:
-
- huggingface_config (AutoConfig)
- model_config (MAXModelConfig)
-
Return type:
get_max_seq_len()
get_max_seq_len()
Returns the tokenizer’s maximum prompt length in tokens.
-
Return type:
initialize()
classmethod initialize(pipeline_config, model_config=None, *, max_seq_len)
Validates that the checkpoint can run.
-
Parameters:
-
- pipeline_config (PipelineConfig) – The pipeline configuration.
- model_config (MAXModelConfig | None) – The model configuration to read from.
- max_seq_len (int) – Ignored. The
ArchConfigprotocol requires this argument, but this model’s sequence length is fixed by the tokenizer.
-
Raises:
-
ValueError – If the manifest has no
transformercomponent, or if more than one device was requested. -
Return type:
pipeline_config
pipeline_config: PipelineConfig
quantization_encoding
quantization_encoding: SupportedEncoding | None = None
MiniMaxMusic3Config
class max.pipelines.architectures.minimax_music3.MiniMaxMusic3Config(vocoder=<factory>, condition_encoder=<factory>, transformer=<factory>, depth_decoder=<factory>, language_model=<factory>, sampling=<factory>)
Bases: object
The five component configurations plus the pipeline-level constants.
-
Parameters:
-
- vocoder (VocoderConfig)
- condition_encoder (ConditionEncoderConfig)
- transformer (TransformerConfig)
- depth_decoder (DepthDecoderConfig)
- language_model (LanguageModelConfig)
- sampling (SamplingConfig)
condition_encoder
condition_encoder: ConditionEncoderConfig
depth_decoder
depth_decoder: DepthDecoderConfig
frame_rate
property frame_rate: float
The autoregressive frame rate, in frames per second.
from_dicts()
static from_dicts(configs)
Builds a configuration from each component’s parsed config.json.
from_pretrained()
static from_pretrained(root)
Loads every component configuration from a checkpoint directory.
-
Parameters:
-
root (Path | str)
-
Return type:
language_model
language_model: LanguageModelConfig
latent_hop_length
property latent_hop_length: int
The latent hop length, in samples.
sampling
sampling: SamplingConfig
sampling_rate
property sampling_rate: int
The output audio sample rate, in Hz.
transformer
transformer: TransformerConfig
vocoder
vocoder: VocoderConfig
MiniMaxMusic3Executor
class max.pipelines.architectures.minimax_music3.MiniMaxMusic3Executor(manifest, session, runtime_config)
Bases: PipelineExecutor[AudioContext, MiniMaxMusic3Inputs, AudioExecutorOutputs]
Turns a text prompt and lyrics into music, one request at a time.
-
Parameters:
-
- manifest (ModelManifest)
- session (InferenceSession)
- runtime_config (PipelineRuntimeConfig)
execute()
execute(inputs)
Runs the language model, diffusion, and vocoder stages, returning the finished stereo waveform.
-
Parameters:
-
inputs (MiniMaxMusic3Inputs)
-
Return type:
prepare_inputs()
prepare_inputs(contexts)
Embeds the prompt pair and settles the generation’s size.
-
Raises:
-
ValueError – If the batch is not exactly one request, or if the context carries no guidance prompt.
-
Parameters:
-
contexts (list[AudioContext])
-
Return type:
sample_rate
property sample_rate: int
The vocoder’s sample rate of 44100 Hz.
MiniMaxMusic3Inputs
class max.pipelines.architectures.minimax_music3.MiniMaxMusic3Inputs(prompt, prompt_length, max_frames, num_inference_steps, guidance_scale, seed)
Bases: TensorStruct
One request, stored as tensors.
The prompt arrives already embedded rather than as token ids, which keeps
the model’s 200000-row embedding table off the device. See
embed_text().
-
Parameters:
guidance_scale
guidance_scale: Tensor
Classifier-free guidance scale for the denoiser, 1-element float32.
max_frames
max_frames: Tensor
Upper bound on generated frames, 1-element int64. The model may stop earlier, and usually does.
num_inference_steps
num_inference_steps: Tensor
Euler steps per denoising window, 1-element int64.
prompt
prompt: Tensor
The conditional prompt embeddings and the classifier-free guidance
prompt embeddings, laid end to end. Shape is
(2 * prompt_length, hidden_size).
prompt_length
prompt_length: Tensor
The number of tokens in each prompt. A 1-element int64 tensor. Both rows share one length.
seed
seed: Tensor
RNG seed for both the code sampling and the denoising noise, 1-element int64.
MiniMaxMusic3Tokenizer
class max.pipelines.architectures.minimax_music3.MiniMaxMusic3Tokenizer(*args, **kwargs)
Bases: AudioGenerationTokenizer
Builds the conditional and unconditional prompts for MiniMax Music 3.
-
Parameters:
-
- args – Forwarded to
AudioGenerationTokenizer. - kwargs – Forwarded to
AudioGenerationTokenizer, withmax_lengthdefaulting to the checkpoint’s prompt limit and the duration and step count to this checkpoint’s own.
- args – Forwarded to
assemble_prompt()
assemble_prompt(description, lyrics)
Returns the assembled prompt.
-
Parameters:
-
Returns:
-
The assembled prompt.
-
Raises:
-
ValueError – If the request carried no lyrics. This model always sings, and an empty lyric field makes it hum through a prompt the checkpoint never saw in training.
-
Return type:
unconditional_ids()
unconditional_ids(token_ids)
Returns the prompt with its content replaced by the CFG token.
Everything between the opening <|im_start|> and the closing
<|im_end|><|audio_start|> becomes one repeated token, so the
unconditional prompt is the same length as the conditional prompt.
The two prompts are batched together.