Text Generation
Transformers
Safetensors
minimax_m2
auto-round
int4
w4a16
quantization
Mixture of Experts
conversational
custom_code
4-bit precision
Instructions to use Lasimeri/MiniMax-M2.7-int4-AutoRound with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Lasimeri/MiniMax-M2.7-int4-AutoRound with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Lasimeri/MiniMax-M2.7-int4-AutoRound", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForMultimodalLM tokenizer = AutoTokenizer.from_pretrained("Lasimeri/MiniMax-M2.7-int4-AutoRound", trust_remote_code=True) model = AutoModelForMultimodalLM.from_pretrained("Lasimeri/MiniMax-M2.7-int4-AutoRound", 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 Settings
- vLLM
How to use Lasimeri/MiniMax-M2.7-int4-AutoRound with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Lasimeri/MiniMax-M2.7-int4-AutoRound" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Lasimeri/MiniMax-M2.7-int4-AutoRound", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Lasimeri/MiniMax-M2.7-int4-AutoRound
- SGLang
How to use Lasimeri/MiniMax-M2.7-int4-AutoRound 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 "Lasimeri/MiniMax-M2.7-int4-AutoRound" \ --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": "Lasimeri/MiniMax-M2.7-int4-AutoRound", "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 "Lasimeri/MiniMax-M2.7-int4-AutoRound" \ --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": "Lasimeri/MiniMax-M2.7-int4-AutoRound", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use Lasimeri/MiniMax-M2.7-int4-AutoRound with Docker Model Runner:
docker model run hf.co/Lasimeri/MiniMax-M2.7-int4-AutoRound
| { | |
| "bits": 4, | |
| "data_type": "int", | |
| "group_size": 128, | |
| "sym": true, | |
| "iters": 0, | |
| "autoround_version": "0.10.2", | |
| "quant_method": "auto-round", | |
| "packing_format": "auto_round:auto_gptq", | |
| "extra_config": { | |
| "model.layers.0.block_sparse_moe.gate": { | |
| "bits": 16, | |
| "data_type": "float" | |
| }, | |
| "model.layers.1.block_sparse_moe.gate": { | |
| "bits": 16, | |
| "data_type": "float" | |
| }, | |
| "model.layers.2.block_sparse_moe.gate": { | |
| "bits": 16, | |
| "data_type": "float" | |
| }, | |
| "model.layers.3.block_sparse_moe.gate": { | |
| "bits": 16, | |
| "data_type": "float" | |
| }, | |
| "model.layers.4.block_sparse_moe.gate": { | |
| "bits": 16, | |
| "data_type": "float" | |
| }, | |
| "model.layers.5.block_sparse_moe.gate": { | |
| "bits": 16, | |
| "data_type": "float" | |
| }, | |
| "model.layers.6.block_sparse_moe.gate": { | |
| "bits": 16, | |
| "data_type": "float" | |
| }, | |
| "model.layers.7.block_sparse_moe.gate": { | |
| "bits": 16, | |
| "data_type": "float" | |
| }, | |
| "model.layers.8.block_sparse_moe.gate": { | |
| "bits": 16, | |
| "data_type": "float" | |
| }, | |
| "model.layers.9.block_sparse_moe.gate": { | |
| "bits": 16, | |
| "data_type": "float" | |
| }, | |
| "model.layers.10.block_sparse_moe.gate": { | |
| "bits": 16, | |
| "data_type": "float" | |
| }, | |
| "model.layers.11.block_sparse_moe.gate": { | |
| "bits": 16, | |
| "data_type": "float" | |
| }, | |
| "model.layers.12.block_sparse_moe.gate": { | |
| "bits": 16, | |
| "data_type": "float" | |
| }, | |
| "model.layers.13.block_sparse_moe.gate": { | |
| "bits": 16, | |
| "data_type": "float" | |
| }, | |
| "model.layers.14.block_sparse_moe.gate": { | |
| "bits": 16, | |
| "data_type": "float" | |
| }, | |
| "model.layers.15.block_sparse_moe.gate": { | |
| "bits": 16, | |
| "data_type": "float" | |
| }, | |
| "model.layers.16.block_sparse_moe.gate": { | |
| "bits": 16, | |
| "data_type": "float" | |
| }, | |
| "model.layers.17.block_sparse_moe.gate": { | |
| "bits": 16, | |
| "data_type": "float" | |
| }, | |
| "model.layers.18.block_sparse_moe.gate": { | |
| "bits": 16, | |
| "data_type": "float" | |
| }, | |
| "model.layers.19.block_sparse_moe.gate": { | |
| "bits": 16, | |
| "data_type": "float" | |
| }, | |
| "model.layers.20.block_sparse_moe.gate": { | |
| "bits": 16, | |
| "data_type": "float" | |
| }, | |
| "model.layers.21.block_sparse_moe.gate": { | |
| "bits": 16, | |
| "data_type": "float" | |
| }, | |
| "model.layers.22.block_sparse_moe.gate": { | |
| "bits": 16, | |
| "data_type": "float" | |
| }, | |
| "model.layers.23.block_sparse_moe.gate": { | |
| "bits": 16, | |
| "data_type": "float" | |
| }, | |
| "model.layers.24.block_sparse_moe.gate": { | |
| "bits": 16, | |
| "data_type": "float" | |
| }, | |
| "model.layers.25.block_sparse_moe.gate": { | |
| "bits": 16, | |
| "data_type": "float" | |
| }, | |
| "model.layers.26.block_sparse_moe.gate": { | |
| "bits": 16, | |
| "data_type": "float" | |
| }, | |
| "model.layers.27.block_sparse_moe.gate": { | |
| "bits": 16, | |
| "data_type": "float" | |
| }, | |
| "model.layers.28.block_sparse_moe.gate": { | |
| "bits": 16, | |
| "data_type": "float" | |
| }, | |
| "model.layers.29.block_sparse_moe.gate": { | |
| "bits": 16, | |
| "data_type": "float" | |
| }, | |
| "model.layers.30.block_sparse_moe.gate": { | |
| "bits": 16, | |
| "data_type": "float" | |
| }, | |
| "model.layers.31.block_sparse_moe.gate": { | |
| "bits": 16, | |
| "data_type": "float" | |
| }, | |
| "model.layers.32.block_sparse_moe.gate": { | |
| "bits": 16, | |
| "data_type": "float" | |
| }, | |
| "model.layers.33.block_sparse_moe.gate": { | |
| "bits": 16, | |
| "data_type": "float" | |
| }, | |
| "model.layers.34.block_sparse_moe.gate": { | |
| "bits": 16, | |
| "data_type": "float" | |
| }, | |
| "model.layers.35.block_sparse_moe.gate": { | |
| "bits": 16, | |
| "data_type": "float" | |
| }, | |
| "model.layers.36.block_sparse_moe.gate": { | |
| "bits": 16, | |
| "data_type": "float" | |
| }, | |
| "model.layers.37.block_sparse_moe.gate": { | |
| "bits": 16, | |
| "data_type": "float" | |
| }, | |
| "model.layers.38.block_sparse_moe.gate": { | |
| "bits": 16, | |
| "data_type": "float" | |
| }, | |
| "model.layers.39.block_sparse_moe.gate": { | |
| "bits": 16, | |
| "data_type": "float" | |
| }, | |
| "model.layers.40.block_sparse_moe.gate": { | |
| "bits": 16, | |
| "data_type": "float" | |
| }, | |
| "model.layers.41.block_sparse_moe.gate": { | |
| "bits": 16, | |
| "data_type": "float" | |
| }, | |
| "model.layers.42.block_sparse_moe.gate": { | |
| "bits": 16, | |
| "data_type": "float" | |
| }, | |
| "model.layers.43.block_sparse_moe.gate": { | |
| "bits": 16, | |
| "data_type": "float" | |
| }, | |
| "model.layers.44.block_sparse_moe.gate": { | |
| "bits": 16, | |
| "data_type": "float" | |
| }, | |
| "model.layers.45.block_sparse_moe.gate": { | |
| "bits": 16, | |
| "data_type": "float" | |
| }, | |
| "model.layers.46.block_sparse_moe.gate": { | |
| "bits": 16, | |
| "data_type": "float" | |
| }, | |
| "model.layers.47.block_sparse_moe.gate": { | |
| "bits": 16, | |
| "data_type": "float" | |
| }, | |
| "model.layers.48.block_sparse_moe.gate": { | |
| "bits": 16, | |
| "data_type": "float" | |
| }, | |
| "model.layers.49.block_sparse_moe.gate": { | |
| "bits": 16, | |
| "data_type": "float" | |
| }, | |
| "model.layers.50.block_sparse_moe.gate": { | |
| "bits": 16, | |
| "data_type": "float" | |
| }, | |
| "model.layers.51.block_sparse_moe.gate": { | |
| "bits": 16, | |
| "data_type": "float" | |
| }, | |
| "model.layers.52.block_sparse_moe.gate": { | |
| "bits": 16, | |
| "data_type": "float" | |
| }, | |
| "model.layers.53.block_sparse_moe.gate": { | |
| "bits": 16, | |
| "data_type": "float" | |
| }, | |
| "model.layers.54.block_sparse_moe.gate": { | |
| "bits": 16, | |
| "data_type": "float" | |
| }, | |
| "model.layers.55.block_sparse_moe.gate": { | |
| "bits": 16, | |
| "data_type": "float" | |
| }, | |
| "model.layers.56.block_sparse_moe.gate": { | |
| "bits": 16, | |
| "data_type": "float" | |
| }, | |
| "model.layers.57.block_sparse_moe.gate": { | |
| "bits": 16, | |
| "data_type": "float" | |
| }, | |
| "model.layers.58.block_sparse_moe.gate": { | |
| "bits": 16, | |
| "data_type": "float" | |
| }, | |
| "model.layers.59.block_sparse_moe.gate": { | |
| "bits": 16, | |
| "data_type": "float" | |
| }, | |
| "model.layers.60.block_sparse_moe.gate": { | |
| "bits": 16, | |
| "data_type": "float" | |
| }, | |
| "model.layers.61.block_sparse_moe.gate": { | |
| "bits": 16, | |
| "data_type": "float" | |
| } | |
| } | |
| } |