Image-Text-to-Text
Transformers
Safetensors
minimax_m3_vl
multimodal
Mixture of Experts
agent
coding
video
conversational
custom_code
Instructions to use MiniMaxAI/MiniMax-M3 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use MiniMaxAI/MiniMax-M3 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="MiniMaxAI/MiniMax-M3", trust_remote_code=True) messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] pipe(text=messages)# Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("MiniMaxAI/MiniMax-M3", trust_remote_code=True) model = AutoModelForMultimodalLM.from_pretrained("MiniMaxAI/MiniMax-M3", trust_remote_code=True) messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] inputs = processor.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Inference
- HuggingChat
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use MiniMaxAI/MiniMax-M3 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "MiniMaxAI/MiniMax-M3" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "MiniMaxAI/MiniMax-M3", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker
docker model run hf.co/MiniMaxAI/MiniMax-M3
- SGLang
How to use MiniMaxAI/MiniMax-M3 with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "MiniMaxAI/MiniMax-M3" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "MiniMaxAI/MiniMax-M3", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "MiniMaxAI/MiniMax-M3" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "MiniMaxAI/MiniMax-M3", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }' - Docker Model Runner
How to use MiniMaxAI/MiniMax-M3 with Docker Model Runner:
docker model run hf.co/MiniMaxAI/MiniMax-M3
| { | |
| "]!p~[": 200000, | |
| "<fim_prefix>": 200001, | |
| "<fim_middle>": 200002, | |
| "<fim_suffix>": 200003, | |
| "<fim_pad>": 200004, | |
| "<reponame>": 200005, | |
| "<filename>": 200006, | |
| "<gh_stars>": 200007, | |
| "<issue_start>": 200008, | |
| "<issue_comment>": 200009, | |
| "<issue_closed>": 200010, | |
| "<jupyter_start>": 200011, | |
| "<jupyter_text>": 200012, | |
| "<jupyter_code>": 200013, | |
| "<jupyter_output>": 200014, | |
| "<empty_output>": 200015, | |
| "<commit_before>": 200016, | |
| "<commit_msg>": 200017, | |
| "<commit_after>": 200018, | |
| "]~b]": 200019, | |
| "[e~[": 200020, | |
| "]!d~[": 200021, | |
| "<function_call>": 200022, | |
| "<code_interpreter>": 200023, | |
| "]<]speech[>[": 200024, | |
| "]<]image[>[": 200025, | |
| "]<]video[>[": 200026, | |
| "]<]start of speech[>[": 200027, | |
| "]<]end of speech[>[": 200028, | |
| "]<]start of image[>[": 200029, | |
| "]<]end of image[>[": 200030, | |
| "]<]start of video[>[": 200031, | |
| "]<]end of video[>[": 200032, | |
| "]<]vision pad[>[": 200033, | |
| "]~!b[": 200034, | |
| "<jupyter_error>": 200035, | |
| "<add_file>": 200036, | |
| "<delete_file>": 200037, | |
| "<rename_file>": 200038, | |
| "<edit_file>": 200039, | |
| "<commit_message>": 200040, | |
| "<empty_source_file>": 200041, | |
| "<repo_struct>": 200042, | |
| "<code_context>": 200043, | |
| "<file_content>": 200044, | |
| "<source_files>": 200045, | |
| "<pr_start>": 200046, | |
| "<review_comment>": 200047, | |
| "<filepath>": 200048, | |
| "<file_sep>": 200049, | |
| "<think>": 200050, | |
| "</think>": 200051, | |
| "<tool_call>": 200052, | |
| "</tool_call>": 200053, | |
| "]<]frame[>[": 200054, | |
| "]<]start of frame[>[": 200055, | |
| "]<]end of frame[>[": 200056, | |
| "<|content_altered_placeholder|>": 200057, | |
| "]<]minimax[>[": 200058, | |
| "<mm:think>": 200059, | |
| "</mm:think>": 200060 | |
| } | |