Instructions to use MiniMaxAI/MiniMax-M2.1 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use MiniMaxAI/MiniMax-M2.1 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="MiniMaxAI/MiniMax-M2.1", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("MiniMaxAI/MiniMax-M2.1", trust_remote_code=True) model = AutoModelForCausalLM.from_pretrained("MiniMaxAI/MiniMax-M2.1", trust_remote_code=True, device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.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=256) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Inference
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use MiniMaxAI/MiniMax-M2.1 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "MiniMaxAI/MiniMax-M2.1" # 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-M2.1", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/MiniMaxAI/MiniMax-M2.1
- SGLang
How to use MiniMaxAI/MiniMax-M2.1 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-M2.1" \ --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-M2.1", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'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-M2.1" \ --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-M2.1", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use MiniMaxAI/MiniMax-M2.1 with Docker Model Runner:
docker model run hf.co/MiniMaxAI/MiniMax-M2.1
Commit History
-
Update EvalEval source links to flat datastore
Verified signatureUpdates existing EvalEval Community Evals YAML entries to link to flat datastore aggregate objects pinned to an immutable EEE datastore commit, and normalizes source.name to EvalEval. No score, dataset, task, or date changes are intended. This updates existing open PR refs only. Contributor: evaleval8ebe9b2
-
Add EvalEval community eval results
Verified signatureAdds EvalEval Community Evals YAML entries with source backlinks to EEE aggregate records. Contributor: evalevalc254b07
-
Add EvalEval community eval results
Verified signatureAdds EvalEval Community Evals YAML entries with source backlinks to EEE aggregate records. Contributor: evaleval5866fa9 -
Add EvalEval community eval results
Verified signatureAdds EvalEval Community Evals YAML entries with source backlinks to EEE aggregate records. Contributor: evaleval7c8d1c7
-
Update README.md (#28)
he +1: UnicornChan - Update README.md (8c843dd7298d252b3c38faaacc70c8a2fc95a0a8) Co-authored-by: unicorn chan <UnicornChan@users.noreply.huggingface.co>cd97f59
-
Clarify supported context length in docs (#21)
Verified signature- update: clearify supported context length in docs (7d718af0cb9fc1c12440bc9912e5abcb42067873) - update (67e71adcb7d24eadc6f88a02c6665ef3634fe197)69af314
-
add mlx (#8)
Verified signature- add mlx (a5c26e6e6a4a72bab63f60046e820cdee8e1e7a3)927ea2b
-
update bench.png (#7)
Verified signature- update (de7333e2f9716372270b449f945c3c1a1a77ade2)17f852d
-
update
xuebi2713e50 -
update
xuebi1ccbe32
-
Update README.md
Verified signature8d70a8a -
Update README.md
Verified signature2bdeb8c -
Update chat_template.jinja
Verified signaturec6b717a -
Upload bench.png
Verified signature20f0649 -
update: README
xuebi1aeff0e
-
update: use nightly sglang
xuebi0469488 -
update: add toolcall docs
xuebi5b50d0e -
udpate: guide use nightly vllm
xuebia423be8 -
Create generation_config.json
Verified signature2e162cb -
update: update model_identity in chat_template.jinja
Verified signature7aef555
-
update: support transformers
xuebie551b49 -
update: add config.json
xuebi500a52e -
update: vllm & sglang deploy guide
xuebi4d0619f -
Add files using upload-large-folder tool
Verified signature3cc80b6 -
Add files using upload-large-folder tool
Verified signaturedbc7874 -
Add files using upload-large-folder tool
Verified signature551920a -
Add files using upload-large-folder tool
Verified signature6b3b637 -
Add files using upload-large-folder tool
Verified signaturec0be2d6 -
Add files using upload-large-folder tool
Verified signature7c3ece6 -
Add files using upload-large-folder tool
Verified signature8fdad3a -
Add files using upload-large-folder tool
Verified signature13a477f -
Add files using upload-large-folder tool
Verified signatureb91c862 -
Add files using upload-large-folder tool
Verified signature3f481ea -
Add files using upload-large-folder tool
Verified signaturede64fb3 -
Add files using upload-large-folder tool
Verified signature7cbf48c -
Add files using upload-large-folder tool
Verified signatureef4d19c -
Add files using upload-large-folder tool
Verified signaturec561087 -
Add files using upload-large-folder tool
Verified signature11dfe75 -
Add files using upload-large-folder tool
Verified signatureef9e352 -
Add files using upload-large-folder tool
Verified signature7b95628 -
Add files using upload-large-folder tool
Verified signature38ef89d -
Add files using upload-large-folder tool
Verified signature2b872d3 -
Add files using upload-large-folder tool
Verified signaturec7ed724 -
Add files using upload-large-folder tool
Verified signature440bfa8 -
Add files using upload-large-folder tool
Verified signature75a31ee -
Add files using upload-large-folder tool
Verified signatured162bc9 -
Add files using upload-large-folder tool
Verified signature36ab1dd -
Add files using upload-large-folder tool
Verified signature83fc27a -
Add files using upload-large-folder tool
Verified signaturec65e33c -
Add files using upload-large-folder tool
Verified signature8cff707