Instructions to use QuantTrio/MiniMax-M2.1-AWQ with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use QuantTrio/MiniMax-M2.1-AWQ with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="QuantTrio/MiniMax-M2.1-AWQ", 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("QuantTrio/MiniMax-M2.1-AWQ", trust_remote_code=True) model = AutoModelForCausalLM.from_pretrained("QuantTrio/MiniMax-M2.1-AWQ", 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 QuantTrio/MiniMax-M2.1-AWQ with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "QuantTrio/MiniMax-M2.1-AWQ" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "QuantTrio/MiniMax-M2.1-AWQ", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/QuantTrio/MiniMax-M2.1-AWQ
- SGLang
How to use QuantTrio/MiniMax-M2.1-AWQ 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 "QuantTrio/MiniMax-M2.1-AWQ" \ --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": "QuantTrio/MiniMax-M2.1-AWQ", "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 "QuantTrio/MiniMax-M2.1-AWQ" \ --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": "QuantTrio/MiniMax-M2.1-AWQ", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use QuantTrio/MiniMax-M2.1-AWQ with Docker Model Runner:
docker model run hf.co/QuantTrio/MiniMax-M2.1-AWQ
Errors
Hi, with the latest version of vLLM (you specified), cuda 12.8 and 2x h100s I get the following error:
WorkerProc failed to start.
Traceback (most recent call last):
File "/root/.venv/lib/python3.12/site-packages/vllm/v1/executor/multiproc_executor.py", line 722, in worker_main
worker = WorkerProc(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/.venv/lib/python3.12/site-packages/vllm/v1/executor/multiproc_executor.py", line 562, in init
self.worker.load_model()
File "/root/.venv/lib/python3.12/site-packages/vllm/v1/worker/gpu_worker.py", line 289, in load_model
self.model_runner.load_model(eep_scale_up=eep_scale_up)
File "/root/.venv/lib/python3.12/site-packages/vllm/v1/worker/gpu_model_runner.py", line 3581, in load_model
self.model = model_loader.load_model(
^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/.venv/lib/python3.12/site-packages/vllm/model_executor/model_loader/base_loader.py", line 56, in load_model
process_weights_after_loading(model, model_config, target_device)
File "/root/.venv/lib/python3.12/site-packages/vllm/model_executor/model_loader/utils.py", line 108, in process_weights_after_loading
quant_method.process_weights_after_loading(module)
File "/root/.venv/lib/python3.12/site-packages/vllm/model_executor/layers/quantization/awq_marlin.py", line 585, in process_weights_after_loading
marlin_w13_qweight = ops.awq_marlin_moe_repack(
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/.venv/lib/python3.12/site-packages/vllm/_custom_ops.py", line 1327, in awq_marlin_moe_repack
output[e] = torch.ops._C.awq_marlin_repack(
~~~~~~^^^
torch.AcceleratorError: CUDA error: the provided PTX was compiled with an unsupported toolchain.
Search for cudaErrorUnsupportedPtxVersion' in https://docs.nvidia.com/cuda/cuda-runtime-api/group__CUDART__TYPES.html for more information. CUDA kernel errors might be asynchronously reported at some other API call, so the stacktrace below might be incorrect. For debugging consider passing CUDA_LAUNCH_BLOCKING=1 Compile with TORCH_USE_CUDA_DSA` to enable device-side assertions.
From nvidia-smi:
Driver: 570.195.03 ✅
CUDA: 12.8 ✅
GPUs: 2× H100 PCIe (sm_90a) ✅
I was about to say. It works perfectly in my side. Better than cyankiwi quants!