Text Generation
Transformers
Safetensors
minimax_m2
mxfp4_16
Mixture of Experts
mixture-of-experts
custom_code
8-bit precision
fp8
quantization
compressed-tensors
iq4_nl
sparse-moe
256-experts
top-8
rdna4
amd
rocm
rx9700
gfx12xx
vllm22
tclaviger
r9700
minimax
200k-context
long-context
function-calling
tool-use
agent
llm
large-language-model
open-source
chat
conversational
reasoning
8-bit precision
Instructions to use djdeniro/MiniMax-M2.7-MXFP416 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use djdeniro/MiniMax-M2.7-MXFP416 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="djdeniro/MiniMax-M2.7-MXFP416", 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("djdeniro/MiniMax-M2.7-MXFP416", trust_remote_code=True) model = AutoModelForCausalLM.from_pretrained("djdeniro/MiniMax-M2.7-MXFP416", 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=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use djdeniro/MiniMax-M2.7-MXFP416 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "djdeniro/MiniMax-M2.7-MXFP416" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "djdeniro/MiniMax-M2.7-MXFP416", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/djdeniro/MiniMax-M2.7-MXFP416
- SGLang
How to use djdeniro/MiniMax-M2.7-MXFP416 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 "djdeniro/MiniMax-M2.7-MXFP416" \ --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": "djdeniro/MiniMax-M2.7-MXFP416", "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 "djdeniro/MiniMax-M2.7-MXFP416" \ --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": "djdeniro/MiniMax-M2.7-MXFP416", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use djdeniro/MiniMax-M2.7-MXFP416 with Docker Model Runner:
docker model run hf.co/djdeniro/MiniMax-M2.7-MXFP416
Upload config.json
Browse files- config.json +159 -0
config.json
ADDED
|
@@ -0,0 +1,159 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
+
1,
|
| 32 |
+
1,
|
| 33 |
+
1,
|
| 34 |
+
1,
|
| 35 |
+
1,
|
| 36 |
+
1,
|
| 37 |
+
1,
|
| 38 |
+
1,
|
| 39 |
+
1,
|
| 40 |
+
1,
|
| 41 |
+
1,
|
| 42 |
+
1,
|
| 43 |
+
1,
|
| 44 |
+
1,
|
| 45 |
+
1,
|
| 46 |
+
1,
|
| 47 |
+
1,
|
| 48 |
+
1,
|
| 49 |
+
1,
|
| 50 |
+
1,
|
| 51 |
+
1,
|
| 52 |
+
1,
|
| 53 |
+
1,
|
| 54 |
+
1,
|
| 55 |
+
1,
|
| 56 |
+
1,
|
| 57 |
+
1,
|
| 58 |
+
1,
|
| 59 |
+
1,
|
| 60 |
+
1,
|
| 61 |
+
1,
|
| 62 |
+
1,
|
| 63 |
+
1,
|
| 64 |
+
1,
|
| 65 |
+
1,
|
| 66 |
+
1,
|
| 67 |
+
1
|
| 68 |
+
],
|
| 69 |
+
"auto_map": {
|
| 70 |
+
"AutoConfig": "configuration_minimax_m2.MiniMaxM2Config",
|
| 71 |
+
"AutoModelForCausalLM": "modeling_minimax_m2.MiniMaxM2ForCausalLM"
|
| 72 |
+
},
|
| 73 |
+
"dtype": "bfloat16",
|
| 74 |
+
"head_dim": 128,
|
| 75 |
+
"hidden_act": "silu",
|
| 76 |
+
"hidden_size": 3072,
|
| 77 |
+
"intermediate_size": 1536,
|
| 78 |
+
"max_position_embeddings": 204800,
|
| 79 |
+
"model_type": "minimax_m2",
|
| 80 |
+
"mtp_transformer_layers": 1,
|
| 81 |
+
"num_attention_heads": 48,
|
| 82 |
+
"num_experts_per_tok": 8,
|
| 83 |
+
"num_hidden_layers": 62,
|
| 84 |
+
"num_key_value_heads": 8,
|
| 85 |
+
"num_local_experts": 256,
|
| 86 |
+
"num_mtp_modules": 3,
|
| 87 |
+
"qk_norm_type": "per_layer",
|
| 88 |
+
"quantization_config": {
|
| 89 |
+
"quant_method": "mxfp4_16",
|
| 90 |
+
"format": "mxfp4-16-pack-quantized",
|
| 91 |
+
"quantization_status": "compressed",
|
| 92 |
+
"config_groups": {
|
| 93 |
+
"group_0": {
|
| 94 |
+
"format": "mxfp4-16-pack-quantized",
|
| 95 |
+
"weights": {
|
| 96 |
+
"num_bits": 4,
|
| 97 |
+
"type": "float",
|
| 98 |
+
"strategy": "group",
|
| 99 |
+
"group_size": 16,
|
| 100 |
+
"grid": "iq4_nl",
|
| 101 |
+
"codebook": [
|
| 102 |
+
-127,
|
| 103 |
+
-104,
|
| 104 |
+
-83,
|
| 105 |
+
-65,
|
| 106 |
+
-49,
|
| 107 |
+
-35,
|
| 108 |
+
-22,
|
| 109 |
+
-10,
|
| 110 |
+
1,
|
| 111 |
+
13,
|
| 112 |
+
25,
|
| 113 |
+
38,
|
| 114 |
+
53,
|
| 115 |
+
69,
|
| 116 |
+
89,
|
| 117 |
+
113
|
| 118 |
+
],
|
| 119 |
+
"symmetric": false,
|
| 120 |
+
"scale_dtype": "torch.float16",
|
| 121 |
+
"dynamic": false,
|
| 122 |
+
"actorder": null,
|
| 123 |
+
"block_structure": null,
|
| 124 |
+
"observer": "minmax",
|
| 125 |
+
"observer_kwargs": {},
|
| 126 |
+
"zp_dtype": null
|
| 127 |
+
},
|
| 128 |
+
"targets": [
|
| 129 |
+
"Linear"
|
| 130 |
+
],
|
| 131 |
+
"input_activations": null,
|
| 132 |
+
"output_activations": null
|
| 133 |
+
}
|
| 134 |
+
},
|
| 135 |
+
"ignore": [
|
| 136 |
+
"re:.*self_attn.*",
|
| 137 |
+
"re:.*block_sparse_moe.gate.*",
|
| 138 |
+
"re:.*e_score_correction_bias.*",
|
| 139 |
+
"re:.*lm_head.*",
|
| 140 |
+
"re:.*embed_tokens.*",
|
| 141 |
+
"re:.*mtp.*"
|
| 142 |
+
],
|
| 143 |
+
"kv_cache_scheme": null,
|
| 144 |
+
"sparsity_config": {},
|
| 145 |
+
"transform_config": {}
|
| 146 |
+
},
|
| 147 |
+
"rms_norm_eps": 1e-06,
|
| 148 |
+
"rope_theta": 5000000,
|
| 149 |
+
"rotary_dim": 64,
|
| 150 |
+
"scoring_func": "sigmoid",
|
| 151 |
+
"shared_intermediate_size": 0,
|
| 152 |
+
"tie_word_embeddings": false,
|
| 153 |
+
"transformers_version": "4.46.1",
|
| 154 |
+
"use_cache": true,
|
| 155 |
+
"use_mtp": true,
|
| 156 |
+
"use_qk_norm": true,
|
| 157 |
+
"use_routing_bias": true,
|
| 158 |
+
"vocab_size": 200064
|
| 159 |
+
}
|