Text Generation
Transformers
Safetensors
minimax_m2
minimax
mixture-of-experts
Mixture of Experts
pruning
expert-pruning
fp8
conversational
custom_code
Instructions to use morriszjm/MiniMax-M2.5-tiny-24e with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use morriszjm/MiniMax-M2.5-tiny-24e with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="morriszjm/MiniMax-M2.5-tiny-24e", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("morriszjm/MiniMax-M2.5-tiny-24e", trust_remote_code=True) model = AutoModelForCausalLM.from_pretrained("morriszjm/MiniMax-M2.5-tiny-24e", trust_remote_code=True) 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=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use morriszjm/MiniMax-M2.5-tiny-24e with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "morriszjm/MiniMax-M2.5-tiny-24e" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "morriszjm/MiniMax-M2.5-tiny-24e", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/morriszjm/MiniMax-M2.5-tiny-24e
- SGLang
How to use morriszjm/MiniMax-M2.5-tiny-24e 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 "morriszjm/MiniMax-M2.5-tiny-24e" \ --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": "morriszjm/MiniMax-M2.5-tiny-24e", "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 "morriszjm/MiniMax-M2.5-tiny-24e" \ --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": "morriszjm/MiniMax-M2.5-tiny-24e", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use morriszjm/MiniMax-M2.5-tiny-24e with Docker Model Runner:
docker model run hf.co/morriszjm/MiniMax-M2.5-tiny-24e
| { | |
| "src_model": "morriszjm/MiniMax-M2.5-tiny", | |
| "src_inventory": "artifacts/tiny_inventory.json", | |
| "src_importance": "artifacts/tiny_importance.json", | |
| "method": "routing_softmax_topk_mass + per-layer uniform top-K, drop-the-rest", | |
| "K": 24, | |
| "L": 8, | |
| "E_orig": 32, | |
| "n_dropped": 8, | |
| "pruning_rate": 0.25, | |
| "ep_size_check": 8, | |
| "top_k": 8, | |
| "kept_per_layer_old_indices": [ | |
| [ | |
| 0, | |
| 1, | |
| 2, | |
| 4, | |
| 5, | |
| 6, | |
| 7, | |
| 10, | |
| 12, | |
| 13, | |
| 14, | |
| 15, | |
| 17, | |
| 18, | |
| 19, | |
| 20, | |
| 21, | |
| 22, | |
| 23, | |
| 25, | |
| 26, | |
| 27, | |
| 30, | |
| 31 | |
| ], | |
| [ | |
| 0, | |
| 1, | |
| 2, | |
| 3, | |
| 4, | |
| 6, | |
| 7, | |
| 8, | |
| 9, | |
| 11, | |
| 12, | |
| 13, | |
| 14, | |
| 16, | |
| 17, | |
| 18, | |
| 19, | |
| 23, | |
| 24, | |
| 27, | |
| 28, | |
| 29, | |
| 30, | |
| 31 | |
| ], | |
| [ | |
| 0, | |
| 1, | |
| 2, | |
| 3, | |
| 4, | |
| 6, | |
| 7, | |
| 8, | |
| 9, | |
| 10, | |
| 12, | |
| 14, | |
| 16, | |
| 17, | |
| 19, | |
| 20, | |
| 22, | |
| 23, | |
| 24, | |
| 26, | |
| 27, | |
| 28, | |
| 29, | |
| 30 | |
| ], | |
| [ | |
| 0, | |
| 2, | |
| 3, | |
| 5, | |
| 6, | |
| 7, | |
| 8, | |
| 9, | |
| 11, | |
| 15, | |
| 17, | |
| 18, | |
| 19, | |
| 20, | |
| 21, | |
| 22, | |
| 23, | |
| 24, | |
| 25, | |
| 26, | |
| 27, | |
| 28, | |
| 29, | |
| 30 | |
| ], | |
| [ | |
| 0, | |
| 1, | |
| 2, | |
| 3, | |
| 4, | |
| 5, | |
| 7, | |
| 8, | |
| 9, | |
| 10, | |
| 12, | |
| 14, | |
| 16, | |
| 17, | |
| 18, | |
| 21, | |
| 22, | |
| 23, | |
| 24, | |
| 25, | |
| 26, | |
| 27, | |
| 28, | |
| 30 | |
| ], | |
| [ | |
| 1, | |
| 2, | |
| 3, | |
| 7, | |
| 8, | |
| 10, | |
| 11, | |
| 12, | |
| 14, | |
| 15, | |
| 16, | |
| 17, | |
| 18, | |
| 19, | |
| 20, | |
| 21, | |
| 22, | |
| 23, | |
| 24, | |
| 26, | |
| 28, | |
| 29, | |
| 30, | |
| 31 | |
| ], | |
| [ | |
| 0, | |
| 1, | |
| 2, | |
| 4, | |
| 5, | |
| 6, | |
| 7, | |
| 8, | |
| 9, | |
| 10, | |
| 12, | |
| 16, | |
| 17, | |
| 19, | |
| 21, | |
| 22, | |
| 23, | |
| 25, | |
| 26, | |
| 27, | |
| 28, | |
| 29, | |
| 30, | |
| 31 | |
| ], | |
| [ | |
| 0, | |
| 1, | |
| 3, | |
| 6, | |
| 7, | |
| 9, | |
| 10, | |
| 11, | |
| 12, | |
| 13, | |
| 14, | |
| 15, | |
| 16, | |
| 17, | |
| 19, | |
| 22, | |
| 24, | |
| 25, | |
| 26, | |
| 27, | |
| 28, | |
| 29, | |
| 30, | |
| 31 | |
| ] | |
| ], | |
| "kept_score_min_per_layer": [ | |
| 5.091672860085964, | |
| 14.596360385417938, | |
| 33.47318064421415, | |
| 8.822094783186913, | |
| 12.742229215800762, | |
| 19.971908435225487, | |
| 0.0, | |
| 5.011361248791218 | |
| ], | |
| "drop_score_max_per_layer": [ | |
| 4.3719402849674225, | |
| 14.47503225505352, | |
| 30.457208454608917, | |
| 8.272616788744926, | |
| 11.775540083646774, | |
| 15.646341614425182, | |
| 0.0, | |
| 4.902323044836521 | |
| ], | |
| "kept_dropped_score_gap_per_layer": [ | |
| 0.7197325751185417, | |
| 0.12132813036441803, | |
| 3.015972189605236, | |
| 0.5494779944419861, | |
| 0.9666891321539879, | |
| 4.325566820800304, | |
| 0.0, | |
| 0.10903820395469666 | |
| ], | |
| "calibration_meta": { | |
| "n_prompts_used": 64, | |
| "tokens_per_layer": 1851, | |
| "tokens_per_bucket": { | |
| "ai4code": 1008, | |
| "general_en": 416, | |
| "reasoning": 257, | |
| "multilingual": 170 | |
| } | |
| } | |
| } |