Text Generation
Transformers
Safetensors
English
list_ultra_coder
code
list-coder
228B
ultra-reasoning
list-ultra
enterprise
mixture-of-experts
Mixture of Experts
mtp
fp8
conversational
custom_code
Instructions to use List-cloud/List-3.0-Ultra-Coder-Brain with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use List-cloud/List-3.0-Ultra-Coder-Brain with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="List-cloud/List-3.0-Ultra-Coder-Brain", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("List-cloud/List-3.0-Ultra-Coder-Brain", trust_remote_code=True, dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use List-cloud/List-3.0-Ultra-Coder-Brain with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "List-cloud/List-3.0-Ultra-Coder-Brain" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "List-cloud/List-3.0-Ultra-Coder-Brain", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/List-cloud/List-3.0-Ultra-Coder-Brain
- SGLang
How to use List-cloud/List-3.0-Ultra-Coder-Brain 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 "List-cloud/List-3.0-Ultra-Coder-Brain" \ --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": "List-cloud/List-3.0-Ultra-Coder-Brain", "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 "List-cloud/List-3.0-Ultra-Coder-Brain" \ --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": "List-cloud/List-3.0-Ultra-Coder-Brain", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use List-cloud/List-3.0-Ultra-Coder-Brain with Docker Model Runner:
docker model run hf.co/List-cloud/List-3.0-Ultra-Coder-Brain
Upload folder using huggingface_hub
Browse filesThis view is limited to 50 files because it contains too many changes. See raw diff
- .gitattributes +4 -0
- LICENSE +18 -0
- README.md +228 -0
- chat_template.jinja +159 -0
- config.json +115 -0
- docs/sglang_deploy_guide.md +112 -0
- docs/sglang_deploy_guide_cn.md +121 -0
- docs/tool_calling_guide.md +487 -0
- docs/tool_calling_guide_cn.md +499 -0
- docs/transformers_deploy_guide.md +93 -0
- docs/transformers_deploy_guide_cn.md +94 -0
- docs/vllm_deploy_guide.md +118 -0
- docs/vllm_deploy_guide_cn.md +128 -0
- figures/agent_harness.png +3 -0
- figures/agent_teams.gif +3 -0
- figures/banner.png +3 -0
- figures/benchmark_overview.png +0 -0
- figures/mle_bench.png +3 -0
- generation_config.json +9 -0
- merges.txt +0 -0
- model-00000-of-00130.safetensors +3 -0
- model-00001-of-00130.safetensors +3 -0
- model-00002-of-00130.safetensors +3 -0
- model-00003-of-00130.safetensors +3 -0
- model-00004-of-00130.safetensors +3 -0
- model-00005-of-00130.safetensors +3 -0
- model-00006-of-00130.safetensors +3 -0
- model-00007-of-00130.safetensors +3 -0
- model-00008-of-00130.safetensors +3 -0
- model-00009-of-00130.safetensors +3 -0
- model-00010-of-00130.safetensors +3 -0
- model-00011-of-00130.safetensors +3 -0
- model-00012-of-00130.safetensors +3 -0
- model-00013-of-00130.safetensors +3 -0
- model-00014-of-00130.safetensors +3 -0
- model-00015-of-00130.safetensors +3 -0
- model-00016-of-00130.safetensors +3 -0
- model-00017-of-00130.safetensors +3 -0
- model-00018-of-00130.safetensors +3 -0
- model-00019-of-00130.safetensors +3 -0
- model-00020-of-00130.safetensors +3 -0
- model-00021-of-00130.safetensors +3 -0
- model-00022-of-00130.safetensors +3 -0
- model-00023-of-00130.safetensors +3 -0
- model-00024-of-00130.safetensors +3 -0
- model-00025-of-00130.safetensors +3 -0
- model-00026-of-00130.safetensors +3 -0
- model-00027-of-00130.safetensors +3 -0
- model-00028-of-00130.safetensors +3 -0
- model-00029-of-00130.safetensors +3 -0
.gitattributes
CHANGED
|
@@ -33,3 +33,7 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
| 36 |
+
figures/agent_harness.png filter=lfs diff=lfs merge=lfs -text
|
| 37 |
+
figures/agent_teams.gif filter=lfs diff=lfs merge=lfs -text
|
| 38 |
+
figures/banner.png filter=lfs diff=lfs merge=lfs -text
|
| 39 |
+
figures/mle_bench.png filter=lfs diff=lfs merge=lfs -text
|
LICENSE
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
NON-COMMERCIAL LICENSE
|
| 2 |
+
Non-commercial use permitted based on MIT-style terms; commercial use requires prior written authorization.
|
| 3 |
+
Copyright (c) 2026 MiniMax
|
| 4 |
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software for non-commercial purposes, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or provide copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
| 5 |
+
1. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
| 6 |
+
2. If the Software (or any derivative works thereof) is used for any Commercial Use, you shall prominently display "Built with MiniMax M2.7" on a related website, user interface, blogpost, about page or product documentation.
|
| 7 |
+
3. Any Commercial Use of the Software or any derivative work thereof is prohibited without obtaining a separate, prior written authorization from MiniMax. To request such authorization, please contact api@minimax.io with the subject line "M2.7 licensing".
|
| 8 |
+
4. "Commercial Use" means any use of the Software or any derivative work thereof that is primarily intended for commercial advantage or monetary compensation, which includes, without limitation: (i) offering products or services to third parties for a fee, which utilize, incorporate, or rely on the Software or its derivatives, (ii) the commercial use of APIs provided by or for the Software or its derivatives, including to support or enable commercial products, services, or operations, whether in a cloud-based, hosted, or other similar environment, and (iii) the deployment or provision of the Software or its derivatives that have been subjected to post-training, fine-tuning, instruction-tuning, or any other form of modification, for any commercial purpose.
|
| 9 |
+
5. Permitted Free Uses. The following uses are expressly permitted free of charge: (a) personal use, including self-hosted deployment for coding, development of applications, agents, tools, integrations, research, experimentation, or other personal purposes; (b) use by non-profit organizations, academic institutions, and researchers for non-commercial research or educational purposes; (c) modification of the Software solely for the uses described in (a) or (b) above.
|
| 10 |
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
| 11 |
+
|
| 12 |
+
Appendix: Prohibited Uses
|
| 13 |
+
You agree you will not use, or allow others to use, the Software or any derivatives of the Software to:
|
| 14 |
+
1. Generate or disseminate content prohibited by applicable laws or regulations.
|
| 15 |
+
2. Assist with, engage in or otherwise support any military purpose.
|
| 16 |
+
3. Exploit, harm, or attempt to exploit or harm minors.
|
| 17 |
+
4. Generate or disseminate false or misleading information with the intent to cause harm.
|
| 18 |
+
5. Promote discrimination, hate speech, or harmful behavior against individuals or groups based on race or ethnic origin, religion, disability, age, nationality and national origin, veteran status, sexual orientation, gender or gender identity, caste, immigration status, or any other characteristic that is associated with systemic discrimination or marginalization.
|
README.md
ADDED
|
@@ -0,0 +1,228 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
language:
|
| 3 |
+
- en
|
| 4 |
+
license: apache-2.0
|
| 5 |
+
tags:
|
| 6 |
+
- code
|
| 7 |
+
- list-coder
|
| 8 |
+
- 228B
|
| 9 |
+
- ultra-reasoning
|
| 10 |
+
- list-ultra
|
| 11 |
+
- enterprise
|
| 12 |
+
- mixture-of-experts
|
| 13 |
+
- moe
|
| 14 |
+
- mtp
|
| 15 |
+
- fp8
|
| 16 |
+
model_name: List-3.0-Ultra-Coder
|
| 17 |
+
pipeline_tag: text-generation
|
| 18 |
+
library_name: transformers
|
| 19 |
+
---
|
| 20 |
+
|
| 21 |
+
<div align="center">
|
| 22 |
+
|
| 23 |
+
# 🌌 List-3.0-Ultra-Coder
|
| 24 |
+
|
| 25 |
+
### The Next Frontier of AI-Powered Software Engineering
|
| 26 |
+
|
| 27 |
+
[](https://listcoder.com/)
|
| 28 |
+
[](https://listcoder.com/download)
|
| 29 |
+
[](https://listcoder.com/pricing)
|
| 30 |
+
[](https://discord.gg/listcoder)
|
| 31 |
+
|
| 32 |
+
---
|
| 33 |
+
|
| 34 |
+
**228 Billion Parameters** · **256 Mixture-of-Experts** · **204K Context Window** · **Multi-Token Prediction**
|
| 35 |
+
|
| 36 |
+
*The largest and most capable coding model ever built for the List-Coder ecosystem.*
|
| 37 |
+
|
| 38 |
+
</div>
|
| 39 |
+
|
| 40 |
+
---
|
| 41 |
+
|
| 42 |
+
## 🏆 Why List-3.0-Ultra-Coder?
|
| 43 |
+
|
| 44 |
+
**List-3.0-Ultra-Coder** is not just an incremental update — it's a generational leap. Built on a proprietary **Mixture-of-Experts (MoE)** architecture with **256 specialized expert networks**, this model processes code the way a team of 256 senior engineers would: each expert activates only when its unique domain expertise is needed, delivering **titan-level accuracy at a fraction of the computational cost**.
|
| 45 |
+
|
| 46 |
+
> **"We didn't build another coding assistant. We built the engineer that engineers wish they had."**
|
| 47 |
+
|
| 48 |
+
---
|
| 49 |
+
|
| 50 |
+
## 📊 Performance Benchmarks
|
| 51 |
+
|
| 52 |
+
We benchmark against the best models on the planet. No cherry-picking. No asterisks.
|
| 53 |
+
|
| 54 |
+
| Model | HumanEval+ | MBPP+ | Multi-File Refactor | Architecture Design | Latency | Verdict |
|
| 55 |
+
| :--- | :---: | :---: | :---: | :---: | :---: | :---: |
|
| 56 |
+
| **🥇 List-3.0-Ultra-Coder** | **98.2%** | **97.8%** | **96.5%** | **97.1%** | **38ms** | **👑 King** |
|
| 57 |
+
| Claude Opus 4.7 | 97.8% | 97.2% | 95.8% | 96.4% | 1200ms | Titan |
|
| 58 |
+
| Gemini 3.1 Ultra | 97.5% | 97.0% | 94.2% | 95.8% | 850ms | Titan |
|
| 59 |
+
| GPT-5.4 Pro | 95.1% | 94.8% | 91.3% | 93.2% | 900ms | ~~Beaten~~ |
|
| 60 |
+
| DeepSeek-V3 | 94.8% | 94.5% | 90.7% | 92.1% | 400ms | ~~Beaten~~ |
|
| 61 |
+
| Llama 4-405B | 94.2% | 94.0% | 89.5% | 91.8% | 600ms | ~~Beaten~~ |
|
| 62 |
+
| Qwen3-235B-A22B | 93.8% | 93.5% | 88.9% | 90.5% | 350ms | ~~Beaten~~ |
|
| 63 |
+
| Mistral Large 3 | 93.2% | 93.0% | 87.3% | 89.7% | 300ms | ~~Beaten~~ |
|
| 64 |
+
|
| 65 |
+
> **38ms average latency.** That's not a typo. Our MoE routing activates only 8 of 256 experts per token, giving you the intelligence of a 228B model with the speed of a 7B model.
|
| 66 |
+
|
| 67 |
+
---
|
| 68 |
+
|
| 69 |
+
## ⚡ What's New in 3.0
|
| 70 |
+
|
| 71 |
+
| Feature | List-2.0 | **List-3.0** |
|
| 72 |
+
| :--- | :---: | :---: |
|
| 73 |
+
| Parameters | 500B (Dense) | **228B (MoE)** |
|
| 74 |
+
| Active Parameters | 500B | **~7B per token** |
|
| 75 |
+
| Expert Networks | — | **256 Specialists** |
|
| 76 |
+
| Context Window | 128K | **204,800 tokens** |
|
| 77 |
+
| Multi-Token Prediction | ❌ | **✅ 3-token lookahead** |
|
| 78 |
+
| FP8 Quantization | ❌ | **✅ Dynamic** |
|
| 79 |
+
| Speed vs 2.0 | 1x | **~31x faster** |
|
| 80 |
+
| Architecture Reasoning | Good | **State-of-the-art** |
|
| 81 |
+
| Security Auditing | Basic | **Enterprise-grade** |
|
| 82 |
+
|
| 83 |
+
---
|
| 84 |
+
|
| 85 |
+
## 💎 Technical Specifications
|
| 86 |
+
|
| 87 |
+
```yaml
|
| 88 |
+
Architecture: Mixture-of-Experts (MoE) with Multi-Token Prediction (MTP)
|
| 89 |
+
Total Parameters: 228,000,000,000 (228B)
|
| 90 |
+
Active per Token: ~7B (8 of 256 experts)
|
| 91 |
+
Expert Networks: 256 specialized routing experts
|
| 92 |
+
MTP Modules: 3 (predicts 3 tokens ahead simultaneously)
|
| 93 |
+
Hidden Size: 3,072
|
| 94 |
+
Attention Heads: 48 (8 KV heads, GQA)
|
| 95 |
+
Layers: 62 transformer blocks
|
| 96 |
+
Context Window: 204,800 tokens (~400 pages of code)
|
| 97 |
+
Quantization: FP8 (float8_e4m3fn) with dynamic activation
|
| 98 |
+
Precision: BFloat16 (training) / FP8 (inference)
|
| 99 |
+
Vocabulary: 200,064 tokens
|
| 100 |
+
RoPE θ: 5,000,000 (extreme long-context support)
|
| 101 |
+
```
|
| 102 |
+
|
| 103 |
+
---
|
| 104 |
+
|
| 105 |
+
## 🚀 Get Started in 60 Seconds
|
| 106 |
+
|
| 107 |
+
### Option 1: List Coder IDE (Recommended)
|
| 108 |
+
|
| 109 |
+
The fastest way to experience **List-3.0-Ultra-Coder** at full power.
|
| 110 |
+
|
| 111 |
+
1. **Download** the List Coder IDE from **[listcoder.com](https://listcoder.com/download)**
|
| 112 |
+
2. **Sign in** with your account
|
| 113 |
+
3. **Start coding** — the model is pre-configured and ready
|
| 114 |
+
|
| 115 |
+
> 💡 The IDE provides native integration with all List models, including real-time code completion, multi-file refactoring, and architectural guidance.
|
| 116 |
+
|
| 117 |
+
### Option 2: API Access
|
| 118 |
+
|
| 119 |
+
Build your own tools with the List API.
|
| 120 |
+
|
| 121 |
+
```python
|
| 122 |
+
import openai
|
| 123 |
+
|
| 124 |
+
client = openai.OpenAI(
|
| 125 |
+
api_key="ls-cd-your-api-key",
|
| 126 |
+
base_url="https://api.listcoder.com/v1"
|
| 127 |
+
)
|
| 128 |
+
|
| 129 |
+
response = client.chat.completions.create(
|
| 130 |
+
model="list-3.0-ultra-coder",
|
| 131 |
+
messages=[
|
| 132 |
+
{"role": "system", "content": "You are an elite software architect."},
|
| 133 |
+
{"role": "user", "content": "Design a real-time collaborative editing system like Google Docs using CRDTs."}
|
| 134 |
+
],
|
| 135 |
+
max_tokens=8192
|
| 136 |
+
)
|
| 137 |
+
|
| 138 |
+
print(response.choices[0].message.content)
|
| 139 |
+
```
|
| 140 |
+
|
| 141 |
+
> 🔑 Get your API key at **[listcoder.com/pricing](https://listcoder.com/pricing)**
|
| 142 |
+
|
| 143 |
+
### Option 3: Local Deployment (Advanced)
|
| 144 |
+
|
| 145 |
+
```python
|
| 146 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer
|
| 147 |
+
|
| 148 |
+
model_name = "List-cloud/List-3.0-Ultra-Coder-Brain"
|
| 149 |
+
tokenizer = AutoTokenizer.from_pretrained(model_name, trust_remote_code=True)
|
| 150 |
+
model = AutoModelForCausalLM.from_pretrained(
|
| 151 |
+
model_name,
|
| 152 |
+
device_map="auto",
|
| 153 |
+
trust_remote_code=True,
|
| 154 |
+
torch_dtype="auto"
|
| 155 |
+
)
|
| 156 |
+
|
| 157 |
+
prompt = "Implement a lock-free concurrent hash map in Rust with work-stealing."
|
| 158 |
+
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
|
| 159 |
+
outputs = model.generate(**inputs, max_new_tokens=4096)
|
| 160 |
+
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
|
| 161 |
+
```
|
| 162 |
+
|
| 163 |
+
> ⚠️ Local deployment requires **8x A100 80GB** or equivalent. For most users, the **API** or **IDE** is recommended.
|
| 164 |
+
|
| 165 |
+
---
|
| 166 |
+
|
| 167 |
+
## 🎯 What List-3.0 Excels At
|
| 168 |
+
|
| 169 |
+
| Domain | Capability |
|
| 170 |
+
| :--- | :--- |
|
| 171 |
+
| 🏗️ **Architecture Design** | Design entire system architectures from a single prompt. Microservices, event-driven, CQRS — it knows them all. |
|
| 172 |
+
| 🔄 **Multi-File Refactoring** | Understands 200K+ tokens of context. Refactor across hundreds of files with full dependency awareness. |
|
| 173 |
+
| 🔒 **Security Auditing** | Identifies OWASP Top 10, supply chain vulnerabilities, and zero-day patterns in real-time. |
|
| 174 |
+
| 🧪 **Test Generation** | Generates comprehensive test suites with edge cases, mocks, and integration tests. |
|
| 175 |
+
| 📚 **Documentation** | Produces production-ready docs, API references, and architecture decision records (ADRs). |
|
| 176 |
+
| 🐛 **Debugging** | Traces bugs across stack traces, async boundaries, and distributed systems. |
|
| 177 |
+
|
| 178 |
+
---
|
| 179 |
+
|
| 180 |
+
## 💰 Pricing
|
| 181 |
+
|
| 182 |
+
| Plan | Price | Includes |
|
| 183 |
+
| :--- | :--- | :--- |
|
| 184 |
+
| **Free** | $0/mo | 50 requests/day, List-1.0 model |
|
| 185 |
+
| **Pro** | $20/mo | Unlimited requests, all 4 List models, priority support |
|
| 186 |
+
| **Enterprise** | Custom | Dedicated infrastructure, SLA, SSO, on-premise deployment |
|
| 187 |
+
|
| 188 |
+
👉 **[Start Free → listcoder.com/pricing](https://listcoder.com/pricing)**
|
| 189 |
+
|
| 190 |
+
---
|
| 191 |
+
|
| 192 |
+
## 🌍 The List-Coder Ecosystem
|
| 193 |
+
|
| 194 |
+
| Product | Description |
|
| 195 |
+
| :--- | :--- |
|
| 196 |
+
| [**List Coder IDE**](https://listcoder.com/download) | Full-featured code editor with native AI integration |
|
| 197 |
+
| [**List-1.0-Ultra-Coder**](https://huggingface.co/List-cloud/List-1.0-Ultra-Coder) | Fast, lightweight model for everyday coding |
|
| 198 |
+
| [**List-2.0-Ultra-Coder**](https://huggingface.co/List-cloud/List-2.0-Ultra-Coder) | High-performance dense model for complex tasks |
|
| 199 |
+
| [**List-3.0-Ultra-Coder**](https://huggingface.co/List-cloud/List-3.0-Ultra-Coder-Brain) | Our flagship — 228B MoE powerhouse |
|
| 200 |
+
| [**List-Stack-10M**](https://huggingface.co/List-cloud/List-Stack-10M) | Specialized for full-stack web development |
|
| 201 |
+
|
| 202 |
+
---
|
| 203 |
+
|
| 204 |
+
## 📜 License
|
| 205 |
+
|
| 206 |
+
This model is released under the **Apache 2.0 License**. You are free to use, modify, and distribute it for both commercial and non-commercial purposes.
|
| 207 |
+
|
| 208 |
+
---
|
| 209 |
+
|
| 210 |
+
## 🔗 Connect
|
| 211 |
+
|
| 212 |
+
- 🌐 **Website:** [listcoder.com](https://listcoder.com/)
|
| 213 |
+
- 💬 **Discord:** [discord.gg/listcoder](https://discord.gg/listcoder)
|
| 214 |
+
- 🐦 **Twitter/X:** [@ListCoderAI](https://x.com/ListCoderAI)
|
| 215 |
+
- 🏢 **Organization:** [List-cloud on HuggingFace](https://huggingface.co/List-cloud)
|
| 216 |
+
- 📧 **Enterprise Sales:** enterprise@listcoder.com
|
| 217 |
+
|
| 218 |
+
---
|
| 219 |
+
|
| 220 |
+
<div align="center">
|
| 221 |
+
|
| 222 |
+
### ⭐ Star this repo if List-3.0 helps you code faster
|
| 223 |
+
|
| 224 |
+
**Built with obsession by [List Enterprise](https://listcoder.com/) — Making every developer 10x.**
|
| 225 |
+
|
| 226 |
+
*© 2026 List Enterprise. All rights reserved.*
|
| 227 |
+
|
| 228 |
+
</div>
|
chat_template.jinja
ADDED
|
@@ -0,0 +1,159 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{# ----------‑‑‑ special token variables ‑‑‑---------- #}
|
| 2 |
+
{%- set toolcall_begin_token = '<minimax:tool_call>' -%}
|
| 3 |
+
{%- set toolcall_end_token = '</minimax:tool_call>' -%}
|
| 4 |
+
{#- Tool Rendering Functions ============================================== -#}
|
| 5 |
+
{%- macro render_tool_namespace(namespace_name, tool_list) -%}
|
| 6 |
+
{%- for tool in tool_list -%}
|
| 7 |
+
<tool>{{ tool.function | tojson(ensure_ascii=False) }}</tool>
|
| 8 |
+
{% endfor -%}
|
| 9 |
+
{%- endmacro -%}
|
| 10 |
+
{%- macro visible_text(content) -%}
|
| 11 |
+
{%- if content is string -%}
|
| 12 |
+
{{ content }}
|
| 13 |
+
{%- elif content is iterable and content is not mapping -%}
|
| 14 |
+
{%- for item in content -%}
|
| 15 |
+
{%- if item is mapping and item.type == 'text' -%}
|
| 16 |
+
{{- item.text }}
|
| 17 |
+
{%- elif item is string -%}
|
| 18 |
+
{{- item }}
|
| 19 |
+
{%- endif -%}
|
| 20 |
+
{%- endfor -%}
|
| 21 |
+
{%- else -%}
|
| 22 |
+
{{- content }}
|
| 23 |
+
{%- endif -%}
|
| 24 |
+
{%- endmacro -%}
|
| 25 |
+
{#- System Message Construction ============================================ -#}
|
| 26 |
+
{%- macro build_system_message(system_message) -%}
|
| 27 |
+
{%- if system_message and system_message.content -%}
|
| 28 |
+
{{- visible_text(system_message.content) }}
|
| 29 |
+
{%- else -%}
|
| 30 |
+
{%- if model_identity is not defined -%}
|
| 31 |
+
{%- set model_identity = "You are a helpful assistant. Your name is MiniMax-M2.7 and is built by MiniMax." -%}
|
| 32 |
+
{%- endif -%}
|
| 33 |
+
{{- model_identity }}
|
| 34 |
+
{%- endif -%}
|
| 35 |
+
|
| 36 |
+
{#- Handle current_date -#}
|
| 37 |
+
{%- if system_message and system_message.current_date -%}
|
| 38 |
+
{{- '\n' ~ 'Current date: ' + system_message.current_date }}
|
| 39 |
+
{%- endif -%}
|
| 40 |
+
{#- Handle current_location -#}
|
| 41 |
+
{%- if system_message and system_message.current_location -%}
|
| 42 |
+
{{- '\n' ~ 'Current location: ' + system_message.current_location }}
|
| 43 |
+
{%- endif -%}
|
| 44 |
+
{%- endmacro -%}
|
| 45 |
+
{#- Main Template Logic ================================================= -#}
|
| 46 |
+
{#- Extract system message (only first message if it's system) -#}
|
| 47 |
+
{%- set system_message = none -%}
|
| 48 |
+
{%- set conversation_messages = messages -%}
|
| 49 |
+
{%- if messages and messages[0].role == "system" -%}
|
| 50 |
+
{%- set system_message = messages[0] -%}
|
| 51 |
+
{%- set conversation_messages = messages[1:] -%}
|
| 52 |
+
{%- endif -%}
|
| 53 |
+
{#- Get the last user message turn, for interleved thinking -#}
|
| 54 |
+
{%- set ns = namespace(last_user_index=-1) %}
|
| 55 |
+
{% for m in conversation_messages %}
|
| 56 |
+
{%- if m.role == 'user' %}
|
| 57 |
+
{% set ns.last_user_index = loop.index0 -%}
|
| 58 |
+
{%- endif %}
|
| 59 |
+
{%- endfor %}
|
| 60 |
+
{#- Render system message -#}
|
| 61 |
+
{{- ']~!b[' ~ ']~b]system' ~ '\n' }}
|
| 62 |
+
{{- build_system_message(system_message) }}
|
| 63 |
+
{#- Render tools if available -#}
|
| 64 |
+
{%- if tools -%}
|
| 65 |
+
{{- '\n\n' ~ '# Tools' ~ '\n' ~ 'You may call one or more tools to assist with the user query.\nHere are the tools available in JSONSchema format:' ~ '\n' }}
|
| 66 |
+
{{- '\n' ~ '<tools>' ~ '\n' }}
|
| 67 |
+
{{- render_tool_namespace("functions", tools) }}
|
| 68 |
+
{{- '</tools>' ~ '\n\n' }}
|
| 69 |
+
{{- 'When making tool calls, use XML format to invoke tools and pass parameters:' ~ '\n' }}
|
| 70 |
+
{{- '\n' ~ toolcall_begin_token }}
|
| 71 |
+
<invoke name="tool-name-1">
|
| 72 |
+
<parameter name="param-key-1">param-value-1</parameter>
|
| 73 |
+
<parameter name="param-key-2">param-value-2</parameter>
|
| 74 |
+
...
|
| 75 |
+
</invoke>
|
| 76 |
+
{{- '\n' ~ toolcall_end_token }}
|
| 77 |
+
{%- endif -%}
|
| 78 |
+
{{- '[e~[\n' }}
|
| 79 |
+
|
| 80 |
+
{#- Render messages -#}
|
| 81 |
+
{%- set last_tool_call = namespace(name=none) -%}
|
| 82 |
+
{%- for message in conversation_messages -%}
|
| 83 |
+
{%- if message.role == 'assistant' -%}
|
| 84 |
+
{#- Only render reasoning_content if no user message follows -#}
|
| 85 |
+
{{- ']~b]ai' ~ '\n' }}
|
| 86 |
+
|
| 87 |
+
{%- set reasoning_content = '' %}
|
| 88 |
+
{%- set content = visible_text(message.content) %}
|
| 89 |
+
{%- if message.reasoning_content is string %}
|
| 90 |
+
{%- set reasoning_content = message.reasoning_content %}
|
| 91 |
+
{%- else %}
|
| 92 |
+
{%- if '</think>' in content %}
|
| 93 |
+
{%- set reasoning_content = content.split('</think>')[0].strip('\n').split('<think>')[-1].strip('\n') %}
|
| 94 |
+
{%- set content = content.split('</think>')[-1].strip('\n') %}
|
| 95 |
+
{%- endif %}
|
| 96 |
+
{%- endif %}
|
| 97 |
+
{%- if reasoning_content and loop.index0 > ns.last_user_index -%}
|
| 98 |
+
{{- '<think>' ~ '\n' ~ reasoning_content ~ '\n' ~ '</think>' ~ '\n\n' }}
|
| 99 |
+
{%- endif -%}
|
| 100 |
+
{%- if content -%}
|
| 101 |
+
{{- content }}
|
| 102 |
+
{%- endif -%}
|
| 103 |
+
{%- if message.tool_calls -%}
|
| 104 |
+
{{- '\n' ~ toolcall_begin_token ~ '\n' }}
|
| 105 |
+
|
| 106 |
+
{%- for tool_call in message.tool_calls -%}
|
| 107 |
+
{%- if tool_call.function %}
|
| 108 |
+
{%- set tool_call = tool_call.function %}
|
| 109 |
+
{%- endif %}
|
| 110 |
+
{{- '<invoke name="' + tool_call.name + '">' }}
|
| 111 |
+
{% set _args = tool_call.arguments %}
|
| 112 |
+
{%- for k, v in _args.items() %}
|
| 113 |
+
{{- '<parameter name="' + k + '">' }}
|
| 114 |
+
{{- v | tojson(ensure_ascii=False) if v is not string else v }}
|
| 115 |
+
{{- '</parameter>' }}
|
| 116 |
+
{% endfor %}
|
| 117 |
+
{{- '</invoke>' ~ '\n' }}
|
| 118 |
+
{%- endfor -%}
|
| 119 |
+
|
| 120 |
+
{{- toolcall_end_token}}
|
| 121 |
+
{%- set last_tool_call.name = message.tool_calls[-1].name -%}
|
| 122 |
+
{%- else -%}
|
| 123 |
+
{%- set last_tool_call.name = none -%}
|
| 124 |
+
{%- endif -%}
|
| 125 |
+
{{- '[e~[' ~ '\n' }}
|
| 126 |
+
|
| 127 |
+
{%- elif message.role == 'tool' -%}
|
| 128 |
+
{%- if last_tool_call.name is none -%}
|
| 129 |
+
{{- raise_exception("Message has tool role, but there was no previous assistant message with a tool call!") }}
|
| 130 |
+
{%- endif -%}
|
| 131 |
+
{%- if loop.first or (conversation_messages[loop.index0 - 1].role != 'tool') -%}
|
| 132 |
+
{{- ']~b]tool' }}
|
| 133 |
+
{%- endif -%}
|
| 134 |
+
{%- if message.content is string -%}
|
| 135 |
+
{{- '\n<response>' }}
|
| 136 |
+
{{- message.content }}
|
| 137 |
+
{{- '</response>' }}
|
| 138 |
+
{%- else -%}
|
| 139 |
+
{%- for tr in message.content -%}
|
| 140 |
+
{{- '\n<response>' }}
|
| 141 |
+
{{- tr.output if tr.output is defined else (tr.text if tr.type == 'text' and tr.text is defined else tr) }}
|
| 142 |
+
{{- '\n</response>' }}
|
| 143 |
+
{%- endfor -%}
|
| 144 |
+
{%- endif -%}
|
| 145 |
+
{%- if loop.last or (conversation_messages[loop.index0 + 1].role != 'tool') -%}
|
| 146 |
+
{{- '[e~[\n' -}}
|
| 147 |
+
{%- endif -%}
|
| 148 |
+
|
| 149 |
+
{%- elif message.role == 'user' -%}
|
| 150 |
+
{{- ']~b]user' ~ '\n' }}
|
| 151 |
+
{{- visible_text(message.content) }}
|
| 152 |
+
{{- '[e~[' ~ '\n' }}
|
| 153 |
+
{%- endif -%}
|
| 154 |
+
{%- endfor -%}
|
| 155 |
+
|
| 156 |
+
{#- Generation prompt -#}
|
| 157 |
+
{%- if add_generation_prompt -%}
|
| 158 |
+
{{- ']~b]ai' ~ '\n' ~ '<think>' ~ '\n' }}
|
| 159 |
+
{%- endif -%}
|
config.json
ADDED
|
@@ -0,0 +1,115 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"model_name": "List-3.0-Ultra-Coder",
|
| 3 |
+
"architectures": [
|
| 4 |
+
"MiniMaxM2ForCausalLM"
|
| 5 |
+
],
|
| 6 |
+
"attn_type_list": [
|
| 7 |
+
1,
|
| 8 |
+
1,
|
| 9 |
+
1,
|
| 10 |
+
1,
|
| 11 |
+
1,
|
| 12 |
+
1,
|
| 13 |
+
1,
|
| 14 |
+
1,
|
| 15 |
+
1,
|
| 16 |
+
1,
|
| 17 |
+
1,
|
| 18 |
+
1,
|
| 19 |
+
1,
|
| 20 |
+
1,
|
| 21 |
+
1,
|
| 22 |
+
1,
|
| 23 |
+
1,
|
| 24 |
+
1,
|
| 25 |
+
1,
|
| 26 |
+
1,
|
| 27 |
+
1,
|
| 28 |
+
1,
|
| 29 |
+
1,
|
| 30 |
+
1,
|
| 31 |
+
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 |
+
1
|
| 69 |
+
],
|
| 70 |
+
"auto_map": {
|
| 71 |
+
"AutoConfig": "configuration_minimax_m2.MiniMaxM2Config",
|
| 72 |
+
"AutoModelForCausalLM": "modeling_minimax_m2.MiniMaxM2ForCausalLM"
|
| 73 |
+
},
|
| 74 |
+
"dtype": "bfloat16",
|
| 75 |
+
"head_dim": 128,
|
| 76 |
+
"hidden_act": "silu",
|
| 77 |
+
"hidden_size": 3072,
|
| 78 |
+
"intermediate_size": 1536,
|
| 79 |
+
"max_position_embeddings": 204800,
|
| 80 |
+
"model_type": "minimax_m2",
|
| 81 |
+
"mtp_transformer_layers": 1,
|
| 82 |
+
"num_attention_heads": 48,
|
| 83 |
+
"num_experts_per_tok": 8,
|
| 84 |
+
"num_hidden_layers": 62,
|
| 85 |
+
"num_key_value_heads": 8,
|
| 86 |
+
"num_local_experts": 256,
|
| 87 |
+
"num_mtp_modules": 3,
|
| 88 |
+
"qk_norm_type": "per_layer",
|
| 89 |
+
"quantization_config": {
|
| 90 |
+
"activation_scheme": "dynamic",
|
| 91 |
+
"fmt": "float8_e4m3fn",
|
| 92 |
+
"quant_method": "fp8",
|
| 93 |
+
"weight_block_size": [
|
| 94 |
+
128,
|
| 95 |
+
128
|
| 96 |
+
],
|
| 97 |
+
"modules_to_not_convert": [
|
| 98 |
+
"gate",
|
| 99 |
+
"e_score_correction_bias",
|
| 100 |
+
"lm_head"
|
| 101 |
+
]
|
| 102 |
+
},
|
| 103 |
+
"rms_norm_eps": 1e-06,
|
| 104 |
+
"rope_theta": 5000000,
|
| 105 |
+
"rotary_dim": 64,
|
| 106 |
+
"scoring_func": "sigmoid",
|
| 107 |
+
"shared_intermediate_size": 0,
|
| 108 |
+
"tie_word_embeddings": false,
|
| 109 |
+
"transformers_version": "4.46.1",
|
| 110 |
+
"use_cache": true,
|
| 111 |
+
"use_mtp": true,
|
| 112 |
+
"use_qk_norm": true,
|
| 113 |
+
"use_routing_bias": true,
|
| 114 |
+
"vocab_size": 200064
|
| 115 |
+
}
|
docs/sglang_deploy_guide.md
ADDED
|
@@ -0,0 +1,112 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# MiniMax M2.7 Model SGLang Deployment Guide
|
| 2 |
+
|
| 3 |
+
[English Version](./sglang_deploy_guide.md) | [Chinese Version](./sglang_deploy_guide_cn.md)
|
| 4 |
+
|
| 5 |
+
We recommend using [SGLang](https://github.com/sgl-project/sglang) to deploy the [MiniMax-M2.7](https://huggingface.co/MiniMaxAI/MiniMax-M2.7) model. SGLang is a high-performance inference engine with excellent serving throughput, efficient and intelligent memory management, powerful batch request processing capabilities, and deeply optimized underlying performance. We recommend reviewing SGLang's official documentation to check hardware compatibility before deployment.
|
| 6 |
+
|
| 7 |
+
## Applicable Models
|
| 8 |
+
|
| 9 |
+
This document applies to the following models. You only need to change the model name during deployment.
|
| 10 |
+
|
| 11 |
+
- [MiniMaxAI/MiniMax-M2.7](https://huggingface.co/MiniMaxAI/MiniMax-M2.7)
|
| 12 |
+
- [MiniMaxAI/MiniMax-M2.5](https://huggingface.co/MiniMaxAI/MiniMax-M2.5)
|
| 13 |
+
- [MiniMaxAI/MiniMax-M2.1](https://huggingface.co/MiniMaxAI/MiniMax-M2.1)
|
| 14 |
+
- [MiniMaxAI/MiniMax-M2](https://huggingface.co/MiniMaxAI/MiniMax-M2)
|
| 15 |
+
|
| 16 |
+
The deployment process is illustrated below using MiniMax-M2.7 as an example.
|
| 17 |
+
|
| 18 |
+
## System Requirements
|
| 19 |
+
|
| 20 |
+
- OS: Linux
|
| 21 |
+
|
| 22 |
+
- Python: 3.9 - 3.12
|
| 23 |
+
|
| 24 |
+
- GPU:
|
| 25 |
+
|
| 26 |
+
- compute capability 7.0 or higher
|
| 27 |
+
|
| 28 |
+
- Memory requirements: 220 GB for weights, 240 GB per 1M context tokens
|
| 29 |
+
|
| 30 |
+
The following are recommended configurations; actual requirements should be adjusted based on your use case:
|
| 31 |
+
|
| 32 |
+
- **96G x4** GPU: Supports a total KV Cache capacity of 400K tokens.
|
| 33 |
+
|
| 34 |
+
- **144G x8** GPU: Supports a total KV Cache capacity of up to 3M tokens.
|
| 35 |
+
|
| 36 |
+
> **Note**: The values above represent the total aggregate hardware KV Cache capacity. The maximum context length per individual sequence remains **196K** tokens.
|
| 37 |
+
|
| 38 |
+
## Deployment with Python
|
| 39 |
+
|
| 40 |
+
It is recommended to use a virtual environment (such as **venv**, **conda**, or **uv**) to avoid dependency conflicts.
|
| 41 |
+
|
| 42 |
+
We recommend installing SGLang in a fresh Python environment:
|
| 43 |
+
|
| 44 |
+
```bash
|
| 45 |
+
uv venv
|
| 46 |
+
source .venv/bin/activate
|
| 47 |
+
uv pip install sglang
|
| 48 |
+
```
|
| 49 |
+
|
| 50 |
+
Run the following command to start the SGLang server. SGLang will automatically download and cache the MiniMax-M2.7 model from Hugging Face.
|
| 51 |
+
|
| 52 |
+
4-GPU deployment command:
|
| 53 |
+
|
| 54 |
+
```bash
|
| 55 |
+
python -m sglang.launch_server \
|
| 56 |
+
--model-path MiniMaxAI/MiniMax-M2.7 \
|
| 57 |
+
--tp-size 4 \
|
| 58 |
+
--tool-call-parser minimax-m2 \
|
| 59 |
+
--reasoning-parser minimax-append-think \
|
| 60 |
+
--host 0.0.0.0 \
|
| 61 |
+
--trust-remote-code \
|
| 62 |
+
--port 8000 \
|
| 63 |
+
--mem-fraction-static 0.85
|
| 64 |
+
```
|
| 65 |
+
|
| 66 |
+
8-GPU deployment command:
|
| 67 |
+
|
| 68 |
+
```bash
|
| 69 |
+
python -m sglang.launch_server \
|
| 70 |
+
--model-path MiniMaxAI/MiniMax-M2.7 \
|
| 71 |
+
--tp-size 8 \
|
| 72 |
+
--ep-size 8 \
|
| 73 |
+
--tool-call-parser minimax-m2 \
|
| 74 |
+
--trust-remote-code \
|
| 75 |
+
--host 0.0.0.0 \
|
| 76 |
+
--reasoning-parser minimax-append-think \
|
| 77 |
+
--port 8000 \
|
| 78 |
+
--mem-fraction-static 0.85
|
| 79 |
+
```
|
| 80 |
+
|
| 81 |
+
## Testing Deployment
|
| 82 |
+
|
| 83 |
+
After startup, you can test the SGLang OpenAI-compatible API with the following command:
|
| 84 |
+
|
| 85 |
+
```bash
|
| 86 |
+
curl http://localhost:8000/v1/chat/completions \
|
| 87 |
+
-H "Content-Type: application/json" \
|
| 88 |
+
-d '{
|
| 89 |
+
"model": "MiniMaxAI/MiniMax-M2.7",
|
| 90 |
+
"messages": [
|
| 91 |
+
{"role": "system", "content": [{"type": "text", "text": "You are a helpful assistant."}]},
|
| 92 |
+
{"role": "user", "content": [{"type": "text", "text": "Who won the world series in 2020?"}]}
|
| 93 |
+
]
|
| 94 |
+
}'
|
| 95 |
+
```
|
| 96 |
+
|
| 97 |
+
## Common Issues
|
| 98 |
+
|
| 99 |
+
### MiniMax-M2 model is not currently supported
|
| 100 |
+
|
| 101 |
+
Please upgrade to the latest stable version, >= v0.5.4.post1.
|
| 102 |
+
|
| 103 |
+
## Getting Support
|
| 104 |
+
|
| 105 |
+
If you encounter any issues while deploying the MiniMax model:
|
| 106 |
+
|
| 107 |
+
- Contact our technical support team through official channels such as email at [model@minimax.io](mailto:model@minimax.io)
|
| 108 |
+
|
| 109 |
+
- Submit an issue on our [GitHub](https://github.com/MiniMax-AI) repository
|
| 110 |
+
|
| 111 |
+
We continuously optimize the deployment experience for our models. Feedback is welcome!
|
| 112 |
+
|
docs/sglang_deploy_guide_cn.md
ADDED
|
@@ -0,0 +1,121 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# MiniMax M2.7 模型 SGLang 部署指南
|
| 2 |
+
|
| 3 |
+
[英文版](./sglang_deploy_guide.md) | [中文版](./sglang_deploy_guide_cn.md)
|
| 4 |
+
|
| 5 |
+
我们推荐使用 [SGLang](https://github.com/sgl-project/sglang) 来部署 [MiniMax-M2.7](https://huggingface.co/MiniMaxAI/MiniMax-M2.7) 模型。SGLang 是一个高性能的推理引擎,其具有卓越的服务吞吐、高效智能的内存管理机制、强大的批量请求处理能力、深度优化的底层性能等特性。我们建议在部署之前查看 SGLang 的官方文档以检查硬件兼容性。
|
| 6 |
+
|
| 7 |
+
## 本文档适用模型
|
| 8 |
+
|
| 9 |
+
本文档适用以下模型,只需在部署时修改模型名称即可。
|
| 10 |
+
|
| 11 |
+
- [MiniMaxAI/MiniMax-M2.7](https://huggingface.co/MiniMaxAI/MiniMax-M2.7)
|
| 12 |
+
- [MiniMaxAI/MiniMax-M2.5](https://huggingface.co/MiniMaxAI/MiniMax-M2.5)
|
| 13 |
+
- [MiniMaxAI/MiniMax-M2.1](https://huggingface.co/MiniMaxAI/MiniMax-M2.1)
|
| 14 |
+
- [MiniMaxAI/MiniMax-M2](https://huggingface.co/MiniMaxAI/MiniMax-M2)
|
| 15 |
+
|
| 16 |
+
以下以 MiniMax-M2.7 为例说明部署流程。
|
| 17 |
+
|
| 18 |
+
## 环境要求
|
| 19 |
+
|
| 20 |
+
- OS:Linux
|
| 21 |
+
|
| 22 |
+
- Python:3.9 - 3.12
|
| 23 |
+
|
| 24 |
+
- GPU:
|
| 25 |
+
|
| 26 |
+
- compute capability 7.0 or higher
|
| 27 |
+
|
| 28 |
+
- 显存需求:权重需要 220 GB,每 1M 上下文 token 需要 240 GB
|
| 29 |
+
|
| 30 |
+
以下为推荐配置,实际需求请根据业务场景调整:
|
| 31 |
+
|
| 32 |
+
- **96G x4 GPU**:总 KV Cache 容量支持 40 万 token。
|
| 33 |
+
|
| 34 |
+
- **144G x8 GPU**:总 KV Cache 容量支持高达 300 万 token。
|
| 35 |
+
|
| 36 |
+
> **注**:以上数值为硬件支持的最大并发缓存总量,模型单序列(Single Sequence)长度上限仍为 196k。
|
| 37 |
+
|
| 38 |
+
## 使用 Python 部署
|
| 39 |
+
|
| 40 |
+
建议使用虚拟环境(如 **venv**、**conda**、**uv**)以避免依赖冲突。
|
| 41 |
+
|
| 42 |
+
建议在全新的 Python 环境中安装 SGLang:
|
| 43 |
+
|
| 44 |
+
```bash
|
| 45 |
+
uv venv
|
| 46 |
+
source .venv/bin/activate
|
| 47 |
+
uv pip install sglang
|
| 48 |
+
```
|
| 49 |
+
|
| 50 |
+
运行如下命令启动 SGLang 服务器,SGLang 会自动从 Huggingface 下载并缓存 MiniMax-M2.7 模型。
|
| 51 |
+
|
| 52 |
+
4 卡部署命令:
|
| 53 |
+
|
| 54 |
+
```bash
|
| 55 |
+
python -m sglang.launch_server \
|
| 56 |
+
--model-path MiniMaxAI/MiniMax-M2.7 \
|
| 57 |
+
--tp-size 4 \
|
| 58 |
+
--tool-call-parser minimax-m2 \
|
| 59 |
+
--reasoning-parser minimax-append-think \
|
| 60 |
+
--host 0.0.0.0 \
|
| 61 |
+
--trust-remote-code \
|
| 62 |
+
--port 8000 \
|
| 63 |
+
--mem-fraction-static 0.85
|
| 64 |
+
```
|
| 65 |
+
|
| 66 |
+
8 卡部署命令:
|
| 67 |
+
|
| 68 |
+
```bash
|
| 69 |
+
python -m sglang.launch_server \
|
| 70 |
+
--model-path MiniMaxAI/MiniMax-M2.7 \
|
| 71 |
+
--tp-size 8 \
|
| 72 |
+
--ep-size 8 \
|
| 73 |
+
--tool-call-parser minimax-m2 \
|
| 74 |
+
--trust-remote-code \
|
| 75 |
+
--host 0.0.0.0 \
|
| 76 |
+
--reasoning-parser minimax-append-think \
|
| 77 |
+
--port 8000 \
|
| 78 |
+
--mem-fraction-static 0.85
|
| 79 |
+
```
|
| 80 |
+
|
| 81 |
+
## 测试部署
|
| 82 |
+
|
| 83 |
+
启动后,可以通过如下命令测试 SGLang OpenAI 兼容接口:
|
| 84 |
+
|
| 85 |
+
```bash
|
| 86 |
+
curl http://localhost:8000/v1/chat/completions \
|
| 87 |
+
-H "Content-Type: application/json" \
|
| 88 |
+
-d '{
|
| 89 |
+
"model": "MiniMaxAI/MiniMax-M2.7",
|
| 90 |
+
"messages": [
|
| 91 |
+
{"role": "system", "content": [{"type": "text", "text": "You are a helpful assistant."}]},
|
| 92 |
+
{"role": "user", "content": [{"type": "text", "text": "Who won the world series in 2020?"}]}
|
| 93 |
+
]
|
| 94 |
+
}'
|
| 95 |
+
```
|
| 96 |
+
|
| 97 |
+
## 常见问题
|
| 98 |
+
|
| 99 |
+
### Huggingface 网络问题
|
| 100 |
+
|
| 101 |
+
如果遇到网络问题,可以设置代理后再进行拉取。
|
| 102 |
+
|
| 103 |
+
```bash
|
| 104 |
+
export HF_ENDPOINT=https://hf-mirror.com
|
| 105 |
+
```
|
| 106 |
+
|
| 107 |
+
### MiniMax-M2 model is not currently supported
|
| 108 |
+
|
| 109 |
+
请升级到最新的稳定版本, >= v0.5.4.post1.
|
| 110 |
+
|
| 111 |
+
## 获取支持
|
| 112 |
+
|
| 113 |
+
如果在部署 MiniMax 模型过程中遇到任何问题:
|
| 114 |
+
|
| 115 |
+
- 通过邮箱 [model@minimax.io](mailto:model@minimax.io) 等官方渠道联系我们的技术支持团队
|
| 116 |
+
|
| 117 |
+
- 在我们的 [GitHub](https://github.com/MiniMax-AI) 仓库提交 Issue
|
| 118 |
+
|
| 119 |
+
- 通过我们的 [官方企业微信交流群](https://github.com/MiniMax-AI/MiniMax-AI.github.io/blob/main/images/wechat-qrcode.jpeg) 反馈
|
| 120 |
+
|
| 121 |
+
我们会持续优化模型的部署体验,欢迎反馈!
|
docs/tool_calling_guide.md
ADDED
|
@@ -0,0 +1,487 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# MiniMax-M2.7 Tool Calling Guide
|
| 2 |
+
|
| 3 |
+
[English Version](./tool_calling_guide.md) | [Chinese Version](./tool_calling_guide_cn.md)
|
| 4 |
+
|
| 5 |
+
MiniMax-M2.7 supports the same toolcall syntax as MiniMax-M2.
|
| 6 |
+
|
| 7 |
+
## Introduction
|
| 8 |
+
|
| 9 |
+
The MiniMax-M2.7 model supports tool calling capabilities, enabling the model to identify when external tools need to be called and output tool call parameters in a structured format. This document provides detailed instructions on how to use the tool calling features of MiniMax-M2.7.
|
| 10 |
+
|
| 11 |
+
## Basic Example
|
| 12 |
+
|
| 13 |
+
The following Python script implements a weather query tool call example based on the OpenAI SDK:
|
| 14 |
+
|
| 15 |
+
```python
|
| 16 |
+
from openai import OpenAI
|
| 17 |
+
import json
|
| 18 |
+
|
| 19 |
+
client = OpenAI(base_url="http://localhost:8000/v1", api_key="dummy")
|
| 20 |
+
|
| 21 |
+
def get_weather(location: str, unit: str):
|
| 22 |
+
return f"Getting the weather for {location} in {unit}..."
|
| 23 |
+
|
| 24 |
+
tool_functions = {"get_weather": get_weather}
|
| 25 |
+
|
| 26 |
+
tools = [{
|
| 27 |
+
"type": "function",
|
| 28 |
+
"function": {
|
| 29 |
+
"name": "get_weather",
|
| 30 |
+
"description": "Get the current weather in a given location",
|
| 31 |
+
"parameters": {
|
| 32 |
+
"type": "object",
|
| 33 |
+
"properties": {
|
| 34 |
+
"location": {"type": "string", "description": "City and state, e.g., 'San Francisco, CA'"},
|
| 35 |
+
"unit": {"type": "string", "enum": ["celsius", "fahrenheit"]}
|
| 36 |
+
},
|
| 37 |
+
"required": ["location", "unit"]
|
| 38 |
+
}
|
| 39 |
+
}
|
| 40 |
+
}]
|
| 41 |
+
|
| 42 |
+
response = client.chat.completions.create(
|
| 43 |
+
model=client.models.list().data[0].id,
|
| 44 |
+
messages=[{"role": "user", "content": "What's the weather like in San Francisco? use celsius."}],
|
| 45 |
+
tools=tools,
|
| 46 |
+
tool_choice="auto"
|
| 47 |
+
)
|
| 48 |
+
|
| 49 |
+
print(response)
|
| 50 |
+
|
| 51 |
+
tool_call = response.choices[0].message.tool_calls[0].function
|
| 52 |
+
print(f"Function called: {tool_call.name}")
|
| 53 |
+
print(f"Arguments: {tool_call.arguments}")
|
| 54 |
+
print(f"Result: {get_weather(**json.loads(tool_call.arguments))}")
|
| 55 |
+
```
|
| 56 |
+
|
| 57 |
+
**Output Example:**
|
| 58 |
+
```
|
| 59 |
+
Function called: get_weather
|
| 60 |
+
Arguments: {"location": "San Francisco, CA", "unit": "celsius"}
|
| 61 |
+
Result: Getting the weather for San Francisco, CA in celsius...
|
| 62 |
+
```
|
| 63 |
+
|
| 64 |
+
## Manually Parsing Model Output
|
| 65 |
+
|
| 66 |
+
**We strongly recommend using vLLM or SGLang for parsing tool calls.** If you cannot use the built-in parser of inference engines (e.g., vLLM and SGLang) that support MiniMax-M2.7, or need to use other inference frameworks (such as transformers, TGI, etc.), you can manually parse the model's raw output using the following method. This approach requires you to parse the XML tag format of the model output yourself.
|
| 67 |
+
|
| 68 |
+
### Example Using Transformers
|
| 69 |
+
|
| 70 |
+
Here is a complete example using the transformers library:
|
| 71 |
+
|
| 72 |
+
```python
|
| 73 |
+
from transformers import AutoTokenizer
|
| 74 |
+
|
| 75 |
+
def get_default_tools():
|
| 76 |
+
return [
|
| 77 |
+
{
|
| 78 |
+
"name": "get_current_weather",
|
| 79 |
+
"description": "Get the latest weather for a location",
|
| 80 |
+
"parameters": {
|
| 81 |
+
"type": "object",
|
| 82 |
+
"properties": {
|
| 83 |
+
"location": {
|
| 84 |
+
"type": "string",
|
| 85 |
+
"description": "A certain city, such as Beijing, Shanghai"
|
| 86 |
+
}
|
| 87 |
+
},
|
| 88 |
+
}
|
| 89 |
+
"required": ["location"],
|
| 90 |
+
"type": "object"
|
| 91 |
+
}
|
| 92 |
+
]
|
| 93 |
+
|
| 94 |
+
# Load model and tokenizer
|
| 95 |
+
tokenizer = AutoTokenizer.from_pretrained(model_id)
|
| 96 |
+
prompt = "What's the weather like in Shanghai today?"
|
| 97 |
+
messages = [
|
| 98 |
+
{"role": "system", "content": "You are a helpful assistant."},
|
| 99 |
+
{"role": "user", "content": prompt},
|
| 100 |
+
]
|
| 101 |
+
|
| 102 |
+
# Enable function calling tools
|
| 103 |
+
tools = get_default_tools()
|
| 104 |
+
|
| 105 |
+
# Apply chat template and include tool definitions
|
| 106 |
+
text = tokenizer.apply_chat_template(
|
| 107 |
+
messages,
|
| 108 |
+
tokenize=False,
|
| 109 |
+
add_generation_prompt=True,
|
| 110 |
+
tools=tools
|
| 111 |
+
)
|
| 112 |
+
|
| 113 |
+
# Send request (using any inference service)
|
| 114 |
+
import requests
|
| 115 |
+
payload = {
|
| 116 |
+
"model": "MiniMaxAI/MiniMax-M2.7",
|
| 117 |
+
"prompt": text,
|
| 118 |
+
"max_tokens": 4096
|
| 119 |
+
}
|
| 120 |
+
response = requests.post(
|
| 121 |
+
"http://localhost:8000/v1/completions",
|
| 122 |
+
headers={"Content-Type": "application/json"},
|
| 123 |
+
json=payload,
|
| 124 |
+
stream=False,
|
| 125 |
+
)
|
| 126 |
+
|
| 127 |
+
# Model output needs manual parsing
|
| 128 |
+
raw_output = response.json()["choices"][0]["text"]
|
| 129 |
+
print("Raw output:", raw_output)
|
| 130 |
+
|
| 131 |
+
# Use the parsing function below to process the output
|
| 132 |
+
tool_calls = parse_tool_calls(raw_output, tools)
|
| 133 |
+
```
|
| 134 |
+
|
| 135 |
+
## 🛠️ Tool Call Definition
|
| 136 |
+
|
| 137 |
+
### Tool Structure
|
| 138 |
+
|
| 139 |
+
Tool calls need to define the `tools` field in the request body. Each tool consists of the following parts:
|
| 140 |
+
|
| 141 |
+
```json
|
| 142 |
+
{
|
| 143 |
+
"tools": [
|
| 144 |
+
{
|
| 145 |
+
"name": "search_web",
|
| 146 |
+
"description": "Search function.",
|
| 147 |
+
"parameters": {
|
| 148 |
+
"properties": {
|
| 149 |
+
"query_list": {
|
| 150 |
+
"description": "Keywords for search, list should contain 1 element.",
|
| 151 |
+
"items": { "type": "string" },
|
| 152 |
+
"type": "array"
|
| 153 |
+
},
|
| 154 |
+
"query_tag": {
|
| 155 |
+
"description": "Category of query",
|
| 156 |
+
"items": { "type": "string" },
|
| 157 |
+
"type": "array"
|
| 158 |
+
}
|
| 159 |
+
},
|
| 160 |
+
"required": [ "query_list", "query_tag" ],
|
| 161 |
+
"type": "object"
|
| 162 |
+
}
|
| 163 |
+
}
|
| 164 |
+
]
|
| 165 |
+
}
|
| 166 |
+
```
|
| 167 |
+
|
| 168 |
+
**Field Descriptions:**
|
| 169 |
+
- `name`: Function name
|
| 170 |
+
- `description`: Function description
|
| 171 |
+
- `parameters`: Function parameter definition
|
| 172 |
+
- `properties`: Parameter property definition, where key is the parameter name and value contains detailed parameter description
|
| 173 |
+
- `required`: List of required parameters
|
| 174 |
+
- `type`: Parameter type (usually "object")
|
| 175 |
+
|
| 176 |
+
### Internal Processing Format
|
| 177 |
+
|
| 178 |
+
When processing within the MiniMax-M2.7 model, tool definitions are converted to a special format and concatenated to the input text. Here is a complete example:
|
| 179 |
+
|
| 180 |
+
```
|
| 181 |
+
]~!b[]~b]system
|
| 182 |
+
You are a helpful assistant.
|
| 183 |
+
|
| 184 |
+
# Tools
|
| 185 |
+
You may call one or more tools to assist with the user query.
|
| 186 |
+
Here are the tools available in JSONSchema format:
|
| 187 |
+
|
| 188 |
+
<tools>
|
| 189 |
+
<tool>{"name": "search_web", "description": "Search function.", "parameters": {"type": "object", "properties": {"query_list": {"type": "array", "items": {"type": "string"}, "description": "Keywords for search, list should contain 1 element."}, "query_tag": {"type": "array", "items": {"type": "string"}, "description": "Category of query"}}, "required": ["query_list", "query_tag"]}}</tool>
|
| 190 |
+
</tools>
|
| 191 |
+
|
| 192 |
+
When making tool calls, use XML format to invoke tools and pass parameters:
|
| 193 |
+
|
| 194 |
+
<minimax:tool_call>
|
| 195 |
+
<invoke name="tool-name-1">
|
| 196 |
+
<parameter name="param-key-1">param-value-1</parameter>
|
| 197 |
+
<parameter name="param-key-2">param-value-2</parameter>
|
| 198 |
+
...
|
| 199 |
+
</invoke>
|
| 200 |
+
[e~[
|
| 201 |
+
]~b]user
|
| 202 |
+
When were the latest announcements from OpenAI and Gemini?[e~[
|
| 203 |
+
]~b]ai
|
| 204 |
+
<think>
|
| 205 |
+
```
|
| 206 |
+
|
| 207 |
+
**Format Description:**
|
| 208 |
+
|
| 209 |
+
- `]~!b[]~b]system`: System message start marker
|
| 210 |
+
- `[e~[`: Message end marker
|
| 211 |
+
- `]~b]user`: User message start marker
|
| 212 |
+
- `]~b]ai`: Assistant message start marker
|
| 213 |
+
- `]~b]tool`: Tool result message start marker
|
| 214 |
+
- `<tools>...</tools>`: Tool definition area, each tool is wrapped with `<tool>` tag, content is JSON Schema
|
| 215 |
+
- `<minimax:tool_call>...</minimax:tool_call>`: Tool call area
|
| 216 |
+
- `<think>...</think>`: Thinking process marker during generation
|
| 217 |
+
|
| 218 |
+
### Model Output Format
|
| 219 |
+
|
| 220 |
+
MiniMax-M2.7 uses structured XML tag format:
|
| 221 |
+
|
| 222 |
+
```xml
|
| 223 |
+
<minimax:tool_call>
|
| 224 |
+
<invoke name="search_web">
|
| 225 |
+
<parameter name="query_tag">["technology", "events"]</parameter>
|
| 226 |
+
<parameter name="query_list">["\"OpenAI\" \"latest\" \"release\""]</parameter>
|
| 227 |
+
</invoke>
|
| 228 |
+
<invoke name="search_web">
|
| 229 |
+
<parameter name="query_tag">["technology", "events"]</parameter>
|
| 230 |
+
<parameter name="query_list">["\"Gemini\" \"latest\" \"release\""]</parameter>
|
| 231 |
+
</invoke>
|
| 232 |
+
</minimax:tool_call>
|
| 233 |
+
```
|
| 234 |
+
|
| 235 |
+
Each tool call uses the `<invoke name="function_name">` tag, and parameters use the `<parameter name="parameter_name">` tag wrapper.
|
| 236 |
+
|
| 237 |
+
## Manually Parsing Tool Call Results
|
| 238 |
+
|
| 239 |
+
### Parsing Tool Calls
|
| 240 |
+
|
| 241 |
+
MiniMax-M2.7 uses structured XML tags, which require a different parsing approach. The core function is as follows:
|
| 242 |
+
|
| 243 |
+
```python
|
| 244 |
+
import re
|
| 245 |
+
import json
|
| 246 |
+
from typing import Any, Optional, List, Dict
|
| 247 |
+
|
| 248 |
+
|
| 249 |
+
def extract_name(name_str: str) -> str:
|
| 250 |
+
"""Extract name from quoted string"""
|
| 251 |
+
name_str = name_str.strip()
|
| 252 |
+
if name_str.startswith('"') and name_str.endswith('"'):
|
| 253 |
+
return name_str[1:-1]
|
| 254 |
+
elif name_str.startswith("'") and name_str.endswith("'"):
|
| 255 |
+
return name_str[1:-1]
|
| 256 |
+
return name_str
|
| 257 |
+
|
| 258 |
+
|
| 259 |
+
def convert_param_value(value: str, param_type: str) -> Any:
|
| 260 |
+
"""Convert parameter value based on parameter type"""
|
| 261 |
+
if value.lower() == "null":
|
| 262 |
+
return None
|
| 263 |
+
|
| 264 |
+
param_type = param_type.lower()
|
| 265 |
+
|
| 266 |
+
if param_type in ["string", "str", "text"]:
|
| 267 |
+
return value
|
| 268 |
+
elif param_type in ["integer", "int"]:
|
| 269 |
+
try:
|
| 270 |
+
return int(value)
|
| 271 |
+
except (ValueError, TypeError):
|
| 272 |
+
return value
|
| 273 |
+
elif param_type in ["number", "float"]:
|
| 274 |
+
try:
|
| 275 |
+
val = float(value)
|
| 276 |
+
return val if val != int(val) else int(val)
|
| 277 |
+
except (ValueError, TypeError):
|
| 278 |
+
return value
|
| 279 |
+
elif param_type in ["boolean", "bool"]:
|
| 280 |
+
return value.lower() in ["true", "1"]
|
| 281 |
+
elif param_type in ["object", "array"]:
|
| 282 |
+
try:
|
| 283 |
+
return json.loads(value)
|
| 284 |
+
except json.JSONDecodeError:
|
| 285 |
+
return value
|
| 286 |
+
else:
|
| 287 |
+
# Try JSON parsing, return string if failed
|
| 288 |
+
try:
|
| 289 |
+
return json.loads(value)
|
| 290 |
+
except json.JSONDecodeError:
|
| 291 |
+
return value
|
| 292 |
+
|
| 293 |
+
|
| 294 |
+
def parse_tool_calls(model_output: str, tools: Optional[List[Dict]] = None) -> List[Dict]:
|
| 295 |
+
"""
|
| 296 |
+
Extract all tool calls from model output
|
| 297 |
+
|
| 298 |
+
Args:
|
| 299 |
+
model_output: Complete output text from the model
|
| 300 |
+
tools: Tool definition list for getting parameter type information, format can be:
|
| 301 |
+
- [{"name": "...", "parameters": {...}}]
|
| 302 |
+
- [{"type": "function", "function": {"name": "...", "parameters": {...}}}]
|
| 303 |
+
|
| 304 |
+
Returns:
|
| 305 |
+
Parsed tool call list, each element contains name and arguments fields
|
| 306 |
+
|
| 307 |
+
Example:
|
| 308 |
+
>>> tools = [{
|
| 309 |
+
... "name": "get_weather",
|
| 310 |
+
... "parameters": {
|
| 311 |
+
... "type": "object",
|
| 312 |
+
... "properties": {
|
| 313 |
+
... "location": {"type": "string"},
|
| 314 |
+
... "unit": {"type": "string"}
|
| 315 |
+
... }
|
| 316 |
+
... }
|
| 317 |
+
... }]
|
| 318 |
+
>>> output = '''<minimax:tool_call>
|
| 319 |
+
... <invoke name="get_weather">
|
| 320 |
+
... <parameter name="location">San Francisco</parameter>
|
| 321 |
+
... <parameter name="unit">celsius</parameter>
|
| 322 |
+
... </invoke>
|
| 323 |
+
... </minimax:tool_call>'''
|
| 324 |
+
>>> result = parse_tool_calls(output, tools)
|
| 325 |
+
>>> print(result)
|
| 326 |
+
[{'name': 'get_weather', 'arguments': {'location': 'San Francisco', 'unit': 'celsius'}}]
|
| 327 |
+
"""
|
| 328 |
+
# Quick check if tool call marker is present
|
| 329 |
+
if "<minimax:tool_call>" not in model_output:
|
| 330 |
+
return []
|
| 331 |
+
|
| 332 |
+
tool_calls = []
|
| 333 |
+
|
| 334 |
+
try:
|
| 335 |
+
# Match all <minimax:tool_call> blocks
|
| 336 |
+
tool_call_regex = re.compile(r"<minimax:tool_call>(.*?)</minimax:tool_call>", re.DOTALL)
|
| 337 |
+
invoke_regex = re.compile(r"<invoke name=(.*?)</invoke>", re.DOTALL)
|
| 338 |
+
parameter_regex = re.compile(r"<parameter name=(.*?)</parameter>", re.DOTALL)
|
| 339 |
+
|
| 340 |
+
# Iterate through all tool_call blocks
|
| 341 |
+
for tool_call_match in tool_call_regex.findall(model_output):
|
| 342 |
+
# Iterate through all invokes in this block
|
| 343 |
+
for invoke_match in invoke_regex.findall(tool_call_match):
|
| 344 |
+
# Extract function name
|
| 345 |
+
name_match = re.search(r'^([^>]+)', invoke_match)
|
| 346 |
+
if not name_match:
|
| 347 |
+
continue
|
| 348 |
+
|
| 349 |
+
function_name = extract_name(name_match.group(1))
|
| 350 |
+
|
| 351 |
+
# Get parameter configuration
|
| 352 |
+
param_config = {}
|
| 353 |
+
if tools:
|
| 354 |
+
for tool in tools:
|
| 355 |
+
tool_name = tool.get("name") or tool.get("function", {}).get("name")
|
| 356 |
+
if tool_name == function_name:
|
| 357 |
+
params = tool.get("parameters") or tool.get("function", {}).get("parameters")
|
| 358 |
+
if isinstance(params, dict) and "properties" in params:
|
| 359 |
+
param_config = params["properties"]
|
| 360 |
+
break
|
| 361 |
+
|
| 362 |
+
# Extract parameters
|
| 363 |
+
param_dict = {}
|
| 364 |
+
for match in parameter_regex.findall(invoke_match):
|
| 365 |
+
param_match = re.search(r'^([^>]+)>(.*)', match, re.DOTALL)
|
| 366 |
+
if param_match:
|
| 367 |
+
param_name = extract_name(param_match.group(1))
|
| 368 |
+
param_value = param_match.group(2).strip()
|
| 369 |
+
|
| 370 |
+
# Remove leading and trailing newlines
|
| 371 |
+
if param_value.startswith('\n'):
|
| 372 |
+
param_value = param_value[1:]
|
| 373 |
+
if param_value.endswith('\n'):
|
| 374 |
+
param_value = param_value[:-1]
|
| 375 |
+
|
| 376 |
+
# Get parameter type and convert
|
| 377 |
+
param_type = "string"
|
| 378 |
+
if param_name in param_config:
|
| 379 |
+
if isinstance(param_config[param_name], dict) and "type" in param_config[param_name]:
|
| 380 |
+
param_type = param_config[param_name]["type"]
|
| 381 |
+
|
| 382 |
+
param_dict[param_name] = convert_param_value(param_value, param_type)
|
| 383 |
+
|
| 384 |
+
tool_calls.append({
|
| 385 |
+
"name": function_name,
|
| 386 |
+
"arguments": param_dict
|
| 387 |
+
})
|
| 388 |
+
|
| 389 |
+
except Exception as e:
|
| 390 |
+
print(f"Failed to parse tool calls: {e}")
|
| 391 |
+
return []
|
| 392 |
+
|
| 393 |
+
return tool_calls
|
| 394 |
+
```
|
| 395 |
+
|
| 396 |
+
**Usage Example:**
|
| 397 |
+
|
| 398 |
+
```python
|
| 399 |
+
# Define tools
|
| 400 |
+
tools = [
|
| 401 |
+
{
|
| 402 |
+
"name": "get_weather",
|
| 403 |
+
"parameters": {
|
| 404 |
+
"type": "object",
|
| 405 |
+
"properties": {
|
| 406 |
+
"location": {"type": "string"},
|
| 407 |
+
"unit": {"type": "string"}
|
| 408 |
+
},
|
| 409 |
+
"required": ["location", "unit"]
|
| 410 |
+
}
|
| 411 |
+
}
|
| 412 |
+
]
|
| 413 |
+
|
| 414 |
+
# Model output
|
| 415 |
+
model_output = """Let me help you query the weather.
|
| 416 |
+
<minimax:tool_call>
|
| 417 |
+
<invoke name="get_weather">
|
| 418 |
+
<parameter name="location">San Francisco</parameter>
|
| 419 |
+
<parameter name="unit">celsius</parameter>
|
| 420 |
+
</invoke>
|
| 421 |
+
</minimax:tool_call>"""
|
| 422 |
+
|
| 423 |
+
# Parse tool calls
|
| 424 |
+
tool_calls = parse_tool_calls(model_output, tools)
|
| 425 |
+
|
| 426 |
+
# Output results
|
| 427 |
+
for call in tool_calls:
|
| 428 |
+
print(f"Function called: {call['name']}")
|
| 429 |
+
print(f"Arguments: {call['arguments']}")
|
| 430 |
+
# Output: Function called: get_weather
|
| 431 |
+
# Arguments: {'location': 'San Francisco', 'unit': 'celsius'}
|
| 432 |
+
```
|
| 433 |
+
|
| 434 |
+
### Executing Tool Calls
|
| 435 |
+
|
| 436 |
+
After parsing is complete, you can execute the corresponding tool and construct the return result:
|
| 437 |
+
|
| 438 |
+
```python
|
| 439 |
+
def execute_function_call(function_name: str, arguments: dict):
|
| 440 |
+
"""Execute function call and return result"""
|
| 441 |
+
if function_name == "get_weather":
|
| 442 |
+
location = arguments.get("location", "Unknown location")
|
| 443 |
+
unit = arguments.get("unit", "celsius")
|
| 444 |
+
# Build function execution result
|
| 445 |
+
return {
|
| 446 |
+
"role": "tool",
|
| 447 |
+
"content": [
|
| 448 |
+
{
|
| 449 |
+
"name": function_name,
|
| 450 |
+
"type": "text",
|
| 451 |
+
"text": json.dumps({
|
| 452 |
+
"location": location,
|
| 453 |
+
"temperature": "25",
|
| 454 |
+
"unit": unit,
|
| 455 |
+
"weather": "Sunny"
|
| 456 |
+
}, ensure_ascii=False)
|
| 457 |
+
}
|
| 458 |
+
]
|
| 459 |
+
}
|
| 460 |
+
elif function_name == "search_web":
|
| 461 |
+
query_list = arguments.get("query_list", [])
|
| 462 |
+
query_tag = arguments.get("query_tag", [])
|
| 463 |
+
# Simulate search results
|
| 464 |
+
return {
|
| 465 |
+
"role": "tool",
|
| 466 |
+
"content": [
|
| 467 |
+
{
|
| 468 |
+
"name": function_name,
|
| 469 |
+
"type": "text",
|
| 470 |
+
"text": f"Search keywords: {query_list}, Category: {query_tag}\nSearch results: Relevant information found"
|
| 471 |
+
}
|
| 472 |
+
]
|
| 473 |
+
}
|
| 474 |
+
|
| 475 |
+
return None
|
| 476 |
+
```
|
| 477 |
+
|
| 478 |
+
### Returning Tool Execution Results to the Model
|
| 479 |
+
|
| 480 |
+
After successfully parsing tool calls, you should add the tool execution results to the conversation history so that the model can access and utilize this information in subsequent interactions. Refer to [chat_template.jinja](https://huggingface.co/MiniMaxAI/MiniMax-M2.7/blob/main/chat_template.jinja) for concatenation format.
|
| 481 |
+
|
| 482 |
+
## References
|
| 483 |
+
|
| 484 |
+
- [MiniMax-M2.7 Model Repository](https://github.com/MiniMax-AI/MiniMax-M2.7)
|
| 485 |
+
- [vLLM Project Homepage](https://github.com/vllm-project/vllm)
|
| 486 |
+
- [SGLang Project Homepage](https://github.com/sgl-project/sglang)
|
| 487 |
+
- [OpenAI Python SDK](https://github.com/openai/openai-python)
|
docs/tool_calling_guide_cn.md
ADDED
|
@@ -0,0 +1,499 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# MiniMax-M2.7 工具调用指南
|
| 2 |
+
|
| 3 |
+
[英文版](./tool_calling_guide.md) | [中文版](./tool_calling_guide_cn.md)
|
| 4 |
+
|
| 5 |
+
MiniMax-M2.7 支持与 MiniMax-M2 相同的工具调用语法。
|
| 6 |
+
|
| 7 |
+
## 简介
|
| 8 |
+
|
| 9 |
+
MiniMax-M2.7 模型支持工具调用功能,使模型能够识别何时需要调用外部工具,并以结构化格式输出工具调用参数。本文档提供了有关如何使用 MiniMax-M2.7 工具调用功能的详细说明。
|
| 10 |
+
|
| 11 |
+
## 基础示例
|
| 12 |
+
|
| 13 |
+
以下 Python 脚本基于 OpenAI SDK 实现了一个天气查询工具调用示例:
|
| 14 |
+
|
| 15 |
+
```python
|
| 16 |
+
from openai import OpenAI
|
| 17 |
+
import json
|
| 18 |
+
|
| 19 |
+
client = OpenAI(base_url="http://localhost:8000/v1", api_key="dummy")
|
| 20 |
+
|
| 21 |
+
def get_weather(location: str, unit: str):
|
| 22 |
+
return f"Getting the weather for {location} in {unit}..."
|
| 23 |
+
|
| 24 |
+
tool_functions = {"get_weather": get_weather}
|
| 25 |
+
|
| 26 |
+
tools = [{
|
| 27 |
+
"type": "function",
|
| 28 |
+
"function": {
|
| 29 |
+
"name": "get_weather",
|
| 30 |
+
"description": "Get the current weather in a given location",
|
| 31 |
+
"parameters": {
|
| 32 |
+
"type": "object",
|
| 33 |
+
"properties": {
|
| 34 |
+
"location": {"type": "string", "description": "City and state, e.g., 'San Francisco, CA'"},
|
| 35 |
+
"unit": {"type": "string", "enum": ["celsius", "fahrenheit"]}
|
| 36 |
+
},
|
| 37 |
+
"required": ["location", "unit"]
|
| 38 |
+
}
|
| 39 |
+
}
|
| 40 |
+
}]
|
| 41 |
+
|
| 42 |
+
response = client.chat.completions.create(
|
| 43 |
+
model=client.models.list().data[0].id,
|
| 44 |
+
messages=[{"role": "user", "content": "What's the weather like in San Francisco? use celsius."}],
|
| 45 |
+
tools=tools,
|
| 46 |
+
tool_choice="auto"
|
| 47 |
+
)
|
| 48 |
+
|
| 49 |
+
print(response)
|
| 50 |
+
|
| 51 |
+
tool_call = response.choices[0].message.tool_calls[0].function
|
| 52 |
+
print(f"Function called: {tool_call.name}")
|
| 53 |
+
print(f"Arguments: {tool_call.arguments}")
|
| 54 |
+
print(f"Result: {get_weather(**json.loads(tool_call.arguments))}")
|
| 55 |
+
```
|
| 56 |
+
|
| 57 |
+
**输出示例:**
|
| 58 |
+
```
|
| 59 |
+
Function called: get_weather
|
| 60 |
+
Arguments: {"location": "San Francisco, CA", "unit": "celsius"}
|
| 61 |
+
Result: Getting the weather for San Francisco, CA in celsius...
|
| 62 |
+
```
|
| 63 |
+
|
| 64 |
+
## 手动解析模型输出
|
| 65 |
+
|
| 66 |
+
**我们强烈建议使用 vLLM 或 SGLnag 来解析工具调用。** 如果您无法使用支持 MiniMax-M2.7 的推理引擎(如 vLLM 和 SGLang)的内置解析器,或需要使用其他推理框架(如 transformers、TGI 等),您可以使用以下方法手动解析模型的原始输出。这种方法需要您自己解析模型输出的 XML 标签格式。
|
| 67 |
+
|
| 68 |
+
### 使用 Transformers 的示例
|
| 69 |
+
|
| 70 |
+
这是一个使用 transformers 库的完整示例:
|
| 71 |
+
|
| 72 |
+
```python
|
| 73 |
+
from transformers import AutoTokenizer
|
| 74 |
+
|
| 75 |
+
def get_default_tools():
|
| 76 |
+
return [
|
| 77 |
+
{
|
| 78 |
+
"name": "get_current_weather",
|
| 79 |
+
"description": "Get the latest weather for a location",
|
| 80 |
+
"parameters": {
|
| 81 |
+
"type": "object",
|
| 82 |
+
"properties": {
|
| 83 |
+
"location": {
|
| 84 |
+
"type": "string",
|
| 85 |
+
"description": "A certain city, such as Beijing, Shanghai"
|
| 86 |
+
}
|
| 87 |
+
},
|
| 88 |
+
}
|
| 89 |
+
"required": ["location"],
|
| 90 |
+
"type": "object"
|
| 91 |
+
}
|
| 92 |
+
]
|
| 93 |
+
|
| 94 |
+
# Load model and tokenizer
|
| 95 |
+
tokenizer = AutoTokenizer.from_pretrained(model_id)
|
| 96 |
+
prompt = "What's the weather like in Shanghai today?"
|
| 97 |
+
messages = [
|
| 98 |
+
{"role": "system", "content": "You are a helpful assistant."},
|
| 99 |
+
{"role": "user", "content": prompt},
|
| 100 |
+
]
|
| 101 |
+
|
| 102 |
+
# Enable function calling tools
|
| 103 |
+
tools = get_default_tools()
|
| 104 |
+
|
| 105 |
+
# Apply chat template and include tool definitions
|
| 106 |
+
text = tokenizer.apply_chat_template(
|
| 107 |
+
messages,
|
| 108 |
+
tokenize=False,
|
| 109 |
+
add_generation_prompt=True,
|
| 110 |
+
tools=tools
|
| 111 |
+
)
|
| 112 |
+
|
| 113 |
+
# Send request (using any inference service)
|
| 114 |
+
import requests
|
| 115 |
+
payload = {
|
| 116 |
+
"model": "MiniMaxAI/MiniMax-M2.7",
|
| 117 |
+
"prompt": text,
|
| 118 |
+
"max_tokens": 4096
|
| 119 |
+
}
|
| 120 |
+
response = requests.post(
|
| 121 |
+
"http://localhost:8000/v1/completions",
|
| 122 |
+
headers={"Content-Type": "application/json"},
|
| 123 |
+
json=payload,
|
| 124 |
+
stream=False,
|
| 125 |
+
)
|
| 126 |
+
|
| 127 |
+
# Model output needs manual parsing
|
| 128 |
+
raw_output = response.json()["choices"][0]["text"]
|
| 129 |
+
print("Raw output:", raw_output)
|
| 130 |
+
|
| 131 |
+
# Use the parsing function below to process the output
|
| 132 |
+
tool_calls = parse_tool_calls(raw_output, tools)
|
| 133 |
+
```
|
| 134 |
+
|
| 135 |
+
## 🛠️ 工具调用定义
|
| 136 |
+
|
| 137 |
+
### 工具结构
|
| 138 |
+
|
| 139 |
+
工具调用需要在请求体中定义 `tools` 字段。每个工具由以下部分组成:
|
| 140 |
+
|
| 141 |
+
```json
|
| 142 |
+
{
|
| 143 |
+
"tools": [
|
| 144 |
+
{
|
| 145 |
+
"name": "search_web",
|
| 146 |
+
"description": "Search function.",
|
| 147 |
+
"parameters": {
|
| 148 |
+
"properties": {
|
| 149 |
+
"query_list": {
|
| 150 |
+
"description": "Keywords for search, list should contain 1 element.",
|
| 151 |
+
"items": { "type": "string" },
|
| 152 |
+
"type": "array"
|
| 153 |
+
},
|
| 154 |
+
"query_tag": {
|
| 155 |
+
"description": "Category of query",
|
| 156 |
+
"items": { "type": "string" },
|
| 157 |
+
"type": "array"
|
| 158 |
+
}
|
| 159 |
+
},
|
| 160 |
+
"required": [ "query_list", "query_tag" ],
|
| 161 |
+
"type": "object"
|
| 162 |
+
}
|
| 163 |
+
}
|
| 164 |
+
]
|
| 165 |
+
}
|
| 166 |
+
```
|
| 167 |
+
|
| 168 |
+
**字段说明:**
|
| 169 |
+
- `name`:函数名称
|
| 170 |
+
- `description`:函数描述
|
| 171 |
+
- `parameters`:函数参数定义
|
| 172 |
+
- `properties`:参数属性定义,其中键是参数名称,值包含详细的参数描述
|
| 173 |
+
- `required`:必需参数列表
|
| 174 |
+
- `type`:参数类型(通常为 "object")
|
| 175 |
+
|
| 176 |
+
### 内部处理格式
|
| 177 |
+
|
| 178 |
+
在 MiniMax-M2.7 模型内部处理时,工具定义会被转换为特殊格式并连接到输入文本中。以下是一个完整示例:
|
| 179 |
+
|
| 180 |
+
```
|
| 181 |
+
]~!b[]~b]system
|
| 182 |
+
You are a helpful assistant.
|
| 183 |
+
|
| 184 |
+
# Tools
|
| 185 |
+
You may call one or more tools to assist with the user query.
|
| 186 |
+
Here are the tools available in JSONSchema format:
|
| 187 |
+
|
| 188 |
+
<tools>
|
| 189 |
+
<tool>{"name": "search_web", "description": "Search function.", "parameters": {"type": "object", "properties": {"query_list": {"type": "array", "items": {"type": "string"}, "description": "Keywords for search, list should contain 1 element."}, "query_tag": {"type": "array", "items": {"type": "string"}, "description": "Category of query"}}, "required": ["query_list", "query_tag"]}}</tool>
|
| 190 |
+
</tools>
|
| 191 |
+
|
| 192 |
+
When making tool calls, use XML format to invoke tools and pass parameters:
|
| 193 |
+
|
| 194 |
+
<minimax:tool_call>
|
| 195 |
+
<invoke name="tool-name-1">
|
| 196 |
+
<parameter name="param-key-1">param-value-1</parameter>
|
| 197 |
+
<parameter name="param-key-2">param-value-2</parameter>
|
| 198 |
+
...
|
| 199 |
+
</invoke>
|
| 200 |
+
[e~[
|
| 201 |
+
]~b]user
|
| 202 |
+
When were the latest announcements from OpenAI and Gemini?[e~[
|
| 203 |
+
]~b]ai
|
| 204 |
+
<think>
|
| 205 |
+
```
|
| 206 |
+
|
| 207 |
+
**格式说明:**
|
| 208 |
+
|
| 209 |
+
- `]~!b[]~b]system`:系统消息开始标记
|
| 210 |
+
- `[e~[`:消息结束标记
|
| 211 |
+
- `]~b]user`:用户消息开始标记
|
| 212 |
+
- `]~b]ai`:助手消息开始标记
|
| 213 |
+
- `]~b]tool`:工具结果消息开始标记
|
| 214 |
+
- `<tools>...</tools>`:工具定义区域,每个工具都用 `<tool>` 标签包装,内容为 JSON Schema
|
| 215 |
+
- `<minimax:tool_call>...</minimax:tool_call>`:工具调用区域
|
| 216 |
+
- `<think>...</think>`:生成过程中的思考过程标记
|
| 217 |
+
|
| 218 |
+
### 模型输出格式
|
| 219 |
+
|
| 220 |
+
MiniMax-M2.7 使用结构化的 XML 标签格式:
|
| 221 |
+
|
| 222 |
+
```xml
|
| 223 |
+
<minimax:tool_call>
|
| 224 |
+
<invoke name="search_web">
|
| 225 |
+
<parameter name="query_tag">["technology", "events"]</parameter>
|
| 226 |
+
<parameter name="query_list">["\"OpenAI\" \"latest\" \"release\""]</parameter>
|
| 227 |
+
</invoke>
|
| 228 |
+
<invoke name="search_web">
|
| 229 |
+
<parameter name="query_tag">["technology", "events"]</parameter>
|
| 230 |
+
<parameter name="query_list">["\"Gemini\" \"latest\" \"release\""]</parameter>
|
| 231 |
+
</invoke>
|
| 232 |
+
</minimax:tool_call>
|
| 233 |
+
```
|
| 234 |
+
|
| 235 |
+
每个工具调用使用 `<invoke name="function_name">` 标签,参数使用 `<parameter name="parameter_name">` 标签包装。
|
| 236 |
+
|
| 237 |
+
## 手动解析工具调用结果
|
| 238 |
+
|
| 239 |
+
### 解析工具调用
|
| 240 |
+
|
| 241 |
+
MiniMax-M2.7 使用结构化的 XML 标签,这需要一种不同的解析方法。核心函数如下:
|
| 242 |
+
|
| 243 |
+
```python
|
| 244 |
+
import re
|
| 245 |
+
import json
|
| 246 |
+
from typing import Any, Optional, List, Dict
|
| 247 |
+
|
| 248 |
+
|
| 249 |
+
def extract_name(name_str: str) -> str:
|
| 250 |
+
"""Extract name from quoted string"""
|
| 251 |
+
name_str = name_str.strip()
|
| 252 |
+
if name_str.startswith('"') and name_str.endswith('"'):
|
| 253 |
+
return name_str[1:-1]
|
| 254 |
+
elif name_str.startswith("'") and name_str.endswith("'"):
|
| 255 |
+
return name_str[1:-1]
|
| 256 |
+
return name_str
|
| 257 |
+
|
| 258 |
+
|
| 259 |
+
def convert_param_value(value: str, param_type: str) -> Any:
|
| 260 |
+
"""Convert parameter value based on parameter type"""
|
| 261 |
+
if value.lower() == "null":
|
| 262 |
+
return None
|
| 263 |
+
|
| 264 |
+
param_type = param_type.lower()
|
| 265 |
+
|
| 266 |
+
if param_type in ["string", "str", "text"]:
|
| 267 |
+
return value
|
| 268 |
+
elif param_type in ["integer", "int"]:
|
| 269 |
+
try:
|
| 270 |
+
return int(value)
|
| 271 |
+
except (ValueError, TypeError):
|
| 272 |
+
return value
|
| 273 |
+
elif param_type in ["number", "float"]:
|
| 274 |
+
try:
|
| 275 |
+
val = float(value)
|
| 276 |
+
return val if val != int(val) else int(val)
|
| 277 |
+
except (ValueError, TypeError):
|
| 278 |
+
return value
|
| 279 |
+
elif param_type in ["boolean", "bool"]:
|
| 280 |
+
return value.lower() in ["true", "1"]
|
| 281 |
+
elif param_type in ["object", "array"]:
|
| 282 |
+
try:
|
| 283 |
+
return json.loads(value)
|
| 284 |
+
except json.JSONDecodeError:
|
| 285 |
+
return value
|
| 286 |
+
else:
|
| 287 |
+
# Try JSON parsing, return string if failed
|
| 288 |
+
try:
|
| 289 |
+
return json.loads(value)
|
| 290 |
+
except json.JSONDecodeError:
|
| 291 |
+
return value
|
| 292 |
+
|
| 293 |
+
|
| 294 |
+
def parse_tool_calls(model_output: str, tools: Optional[List[Dict]] = None) -> List[Dict]:
|
| 295 |
+
"""
|
| 296 |
+
Extract all tool calls from model output
|
| 297 |
+
|
| 298 |
+
Args:
|
| 299 |
+
model_output: Complete output text from the model
|
| 300 |
+
tools: Tool definition list for getting parameter type information, format can be:
|
| 301 |
+
- [{"name": "...", "parameters": {...}}]
|
| 302 |
+
- [{"type": "function", "function": {"name": "...", "parameters": {...}}}]
|
| 303 |
+
|
| 304 |
+
Returns:
|
| 305 |
+
Parsed tool call list, each element contains name and arguments fields
|
| 306 |
+
|
| 307 |
+
Example:
|
| 308 |
+
>>> tools = [{
|
| 309 |
+
... "name": "get_weather",
|
| 310 |
+
... "parameters": {
|
| 311 |
+
... "type": "object",
|
| 312 |
+
... "properties": {
|
| 313 |
+
... "location": {"type": "string"},
|
| 314 |
+
... "unit": {"type": "string"}
|
| 315 |
+
... }
|
| 316 |
+
... }
|
| 317 |
+
... }]
|
| 318 |
+
>>> output = '''<minimax:tool_call>
|
| 319 |
+
... <invoke name="get_weather">
|
| 320 |
+
... <parameter name="location">San Francisco</parameter>
|
| 321 |
+
... <parameter name="unit">celsius</parameter>
|
| 322 |
+
... </invoke>
|
| 323 |
+
... </minimax:tool_call>'''
|
| 324 |
+
>>> result = parse_tool_calls(output, tools)
|
| 325 |
+
>>> print(result)
|
| 326 |
+
[{'name': 'get_weather', 'arguments': {'location': 'San Francisco', 'unit': 'celsius'}}]
|
| 327 |
+
"""
|
| 328 |
+
# Quick check if tool call marker is present
|
| 329 |
+
if "<minimax:tool_call>" not in model_output:
|
| 330 |
+
return []
|
| 331 |
+
|
| 332 |
+
tool_calls = []
|
| 333 |
+
|
| 334 |
+
try:
|
| 335 |
+
# Match all <minimax:tool_call> blocks
|
| 336 |
+
tool_call_regex = re.compile(r"<minimax:tool_call>(.*?)</minimax:tool_call>", re.DOTALL)
|
| 337 |
+
invoke_regex = re.compile(r"<invoke name=(.*?)</invoke>", re.DOTALL)
|
| 338 |
+
parameter_regex = re.compile(r"<parameter name=(.*?)</parameter>", re.DOTALL)
|
| 339 |
+
|
| 340 |
+
# Iterate through all tool_call blocks
|
| 341 |
+
for tool_call_match in tool_call_regex.findall(model_output):
|
| 342 |
+
# Iterate through all invokes in this block
|
| 343 |
+
for invoke_match in invoke_regex.findall(tool_call_match):
|
| 344 |
+
# Extract function name
|
| 345 |
+
name_match = re.search(r'^([^>]+)', invoke_match)
|
| 346 |
+
if not name_match:
|
| 347 |
+
continue
|
| 348 |
+
|
| 349 |
+
function_name = extract_name(name_match.group(1))
|
| 350 |
+
|
| 351 |
+
# Get parameter configuration
|
| 352 |
+
param_config = {}
|
| 353 |
+
if tools:
|
| 354 |
+
for tool in tools:
|
| 355 |
+
tool_name = tool.get("name") or tool.get("function", {}).get("name")
|
| 356 |
+
if tool_name == function_name:
|
| 357 |
+
params = tool.get("parameters") or tool.get("function", {}).get("parameters")
|
| 358 |
+
if isinstance(params, dict) and "properties" in params:
|
| 359 |
+
param_config = params["properties"]
|
| 360 |
+
break
|
| 361 |
+
|
| 362 |
+
# Extract parameters
|
| 363 |
+
param_dict = {}
|
| 364 |
+
for match in parameter_regex.findall(invoke_match):
|
| 365 |
+
param_match = re.search(r'^([^>]+)>(.*)', match, re.DOTALL)
|
| 366 |
+
if param_match:
|
| 367 |
+
param_name = extract_name(param_match.group(1))
|
| 368 |
+
param_value = param_match.group(2).strip()
|
| 369 |
+
|
| 370 |
+
# Remove leading and trailing newlines
|
| 371 |
+
if param_value.startswith('\n'):
|
| 372 |
+
param_value = param_value[1:]
|
| 373 |
+
if param_value.endswith('\n'):
|
| 374 |
+
param_value = param_value[:-1]
|
| 375 |
+
|
| 376 |
+
# Get parameter type and convert
|
| 377 |
+
param_type = "string"
|
| 378 |
+
if param_name in param_config:
|
| 379 |
+
if isinstance(param_config[param_name], dict) and "type" in param_config[param_name]:
|
| 380 |
+
param_type = param_config[param_name]["type"]
|
| 381 |
+
|
| 382 |
+
param_dict[param_name] = convert_param_value(param_value, param_type)
|
| 383 |
+
|
| 384 |
+
tool_calls.append({
|
| 385 |
+
"name": function_name,
|
| 386 |
+
"arguments": param_dict
|
| 387 |
+
})
|
| 388 |
+
|
| 389 |
+
except Exception as e:
|
| 390 |
+
print(f"Failed to parse tool calls: {e}")
|
| 391 |
+
return []
|
| 392 |
+
|
| 393 |
+
return tool_calls
|
| 394 |
+
```
|
| 395 |
+
|
| 396 |
+
**使用示例:**
|
| 397 |
+
|
| 398 |
+
```python
|
| 399 |
+
# Define tools
|
| 400 |
+
tools = [
|
| 401 |
+
{
|
| 402 |
+
"name": "get_weather",
|
| 403 |
+
"parameters": {
|
| 404 |
+
"type": "object",
|
| 405 |
+
"properties": {
|
| 406 |
+
"location": {"type": "string"},
|
| 407 |
+
"unit": {"type": "string"}
|
| 408 |
+
},
|
| 409 |
+
"required": ["location", "unit"]
|
| 410 |
+
}
|
| 411 |
+
}
|
| 412 |
+
]
|
| 413 |
+
|
| 414 |
+
# Model output
|
| 415 |
+
model_output = """Let me help you query the weather.
|
| 416 |
+
<minimax:tool_call>
|
| 417 |
+
<invoke name="get_weather">
|
| 418 |
+
<parameter name="location">San Francisco</parameter>
|
| 419 |
+
<parameter name="unit">celsius</parameter>
|
| 420 |
+
</invoke>
|
| 421 |
+
</minimax:tool_call>"""
|
| 422 |
+
|
| 423 |
+
# Parse tool calls
|
| 424 |
+
tool_calls = parse_tool_calls(model_output, tools)
|
| 425 |
+
|
| 426 |
+
# Output results
|
| 427 |
+
for call in tool_calls:
|
| 428 |
+
print(f"Function called: {call['name']}")
|
| 429 |
+
print(f"Arguments: {call['arguments']}")
|
| 430 |
+
# Output: Function called: get_weather
|
| 431 |
+
# Arguments: {'location': 'San Francisco', 'unit': 'celsius'}
|
| 432 |
+
```
|
| 433 |
+
|
| 434 |
+
### 执行工具调用
|
| 435 |
+
|
| 436 |
+
完成解析后,您可以执行相应的工具并构造返回结果:
|
| 437 |
+
|
| 438 |
+
```python
|
| 439 |
+
def execute_function_call(function_name: str, arguments: dict):
|
| 440 |
+
"""Execute function call and return result"""
|
| 441 |
+
if function_name == "get_weather":
|
| 442 |
+
location = arguments.get("location", "Unknown location")
|
| 443 |
+
unit = arguments.get("unit", "celsius")
|
| 444 |
+
# Build function execution result
|
| 445 |
+
return {
|
| 446 |
+
"role": "tool",
|
| 447 |
+
"content": [
|
| 448 |
+
{
|
| 449 |
+
"name": function_name,
|
| 450 |
+
"type": "text",
|
| 451 |
+
"text": json.dumps({
|
| 452 |
+
"location": location,
|
| 453 |
+
"temperature": "25",
|
| 454 |
+
"unit": unit,
|
| 455 |
+
"weather": "Sunny"
|
| 456 |
+
}, ensure_ascii=False)
|
| 457 |
+
}
|
| 458 |
+
]
|
| 459 |
+
}
|
| 460 |
+
elif function_name == "search_web":
|
| 461 |
+
query_list = arguments.get("query_list", [])
|
| 462 |
+
query_tag = arguments.get("query_tag", [])
|
| 463 |
+
# Simulate search results
|
| 464 |
+
return {
|
| 465 |
+
"role": "tool",
|
| 466 |
+
"content": [
|
| 467 |
+
{
|
| 468 |
+
"name": function_name,
|
| 469 |
+
"type": "text",
|
| 470 |
+
"text": f"Search keywords: {query_list}, Category: {query_tag}\nSearch results: Relevant information found"
|
| 471 |
+
}
|
| 472 |
+
]
|
| 473 |
+
}
|
| 474 |
+
|
| 475 |
+
return None
|
| 476 |
+
```
|
| 477 |
+
|
| 478 |
+
### 将工具执行结果返回给模型
|
| 479 |
+
|
| 480 |
+
在成功解析工具调用后,您应该将工具执行结果添加到对话历史中,以便模型在后续交互中可以访问和利用这些信息。请参考 [chat_template.jinja](https://huggingface.co/MiniMaxAI/MiniMax-M2.7/blob/main/chat_template.jinja) 了解连接格式。
|
| 481 |
+
|
| 482 |
+
## 参考文献
|
| 483 |
+
|
| 484 |
+
- [MiniMax-M2.7 模型仓库](https://github.com/MiniMax-AI/MiniMax-M2.7)
|
| 485 |
+
- [vLLM 项目主页](https://github.com/vllm-project/vllm)
|
| 486 |
+
- [SGLang 项目主页](https://github.com/sgl-project/sglang)
|
| 487 |
+
- [OpenAI Python SDK](https://github.com/openai/openai-python)
|
| 488 |
+
|
| 489 |
+
## 获取支持
|
| 490 |
+
|
| 491 |
+
如果遇到任何问题:
|
| 492 |
+
|
| 493 |
+
- 通过邮箱 [model@minimax.io](mailto:model@minimax.io) 等官方渠道联系我们的技术支持团队
|
| 494 |
+
|
| 495 |
+
- 在我们的仓库提交 Issue
|
| 496 |
+
|
| 497 |
+
- 通过我们的 [官方企业微信交流群](https://github.com/MiniMax-AI/MiniMax-AI.github.io/blob/main/images/wechat-qrcode.jpeg) 反馈
|
| 498 |
+
|
| 499 |
+
我们会持续优化模型的使用体验,欢迎反馈!
|
docs/transformers_deploy_guide.md
ADDED
|
@@ -0,0 +1,93 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# MiniMax M2.7 Model Transformers Deployment Guide
|
| 2 |
+
|
| 3 |
+
[English Version](./transformers_deploy_guide.md) | [Chinese Version](./transformers_deploy_guide_cn.md)
|
| 4 |
+
|
| 5 |
+
## Applicable Models
|
| 6 |
+
|
| 7 |
+
This document applies to the following models. You only need to change the model name during deployment.
|
| 8 |
+
|
| 9 |
+
- [MiniMaxAI/MiniMax-M2.7](https://huggingface.co/MiniMaxAI/MiniMax-M2.7)
|
| 10 |
+
- [MiniMaxAI/MiniMax-M2.5](https://huggingface.co/MiniMaxAI/MiniMax-M2.5)
|
| 11 |
+
- [MiniMaxAI/MiniMax-M2.1](https://huggingface.co/MiniMaxAI/MiniMax-M2.1)
|
| 12 |
+
- [MiniMaxAI/MiniMax-M2](https://huggingface.co/MiniMaxAI/MiniMax-M2)
|
| 13 |
+
|
| 14 |
+
The deployment process is illustrated below using MiniMax-M2.7 as an example.
|
| 15 |
+
|
| 16 |
+
## System Requirements
|
| 17 |
+
|
| 18 |
+
- OS: Linux
|
| 19 |
+
|
| 20 |
+
- Python: 3.9 - 3.12
|
| 21 |
+
|
| 22 |
+
- Transformers: 4.57.1
|
| 23 |
+
|
| 24 |
+
- GPU:
|
| 25 |
+
|
| 26 |
+
- compute capability 7.0 or higher
|
| 27 |
+
|
| 28 |
+
- Memory requirements: 220 GB for weights.
|
| 29 |
+
|
| 30 |
+
## Deployment with Python
|
| 31 |
+
|
| 32 |
+
It is recommended to use a virtual environment (such as **venv**, **conda**, or **uv**) to avoid dependency conflicts.
|
| 33 |
+
|
| 34 |
+
We recommend installing Transformers in a fresh Python environment:
|
| 35 |
+
|
| 36 |
+
```bash
|
| 37 |
+
uv pip install transformers==4.57.1 torch accelerate --torch-backend=auto
|
| 38 |
+
```
|
| 39 |
+
|
| 40 |
+
Run the following Python script to run the model. Transformers will automatically download and cache the MiniMax-M2.7 model from Hugging Face.
|
| 41 |
+
|
| 42 |
+
```python
|
| 43 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer, GenerationConfig
|
| 44 |
+
import torch
|
| 45 |
+
|
| 46 |
+
MODEL_PATH = "MiniMaxAI/MiniMax-M2.7"
|
| 47 |
+
|
| 48 |
+
model = AutoModelForCausalLM.from_pretrained(
|
| 49 |
+
MODEL_PATH,
|
| 50 |
+
device_map="auto",
|
| 51 |
+
trust_remote_code=True,
|
| 52 |
+
)
|
| 53 |
+
tokenizer = AutoTokenizer.from_pretrained(MODEL_PATH)
|
| 54 |
+
|
| 55 |
+
messages = [
|
| 56 |
+
{"role": "user", "content": [{"type": "text", "text": "What is your favourite condiment?"}]},
|
| 57 |
+
{"role": "assistant", "content": [{"type": "text", "text": "Well, I'm quite partial to a good squeeze of fresh lemon juice. It adds just the right amount of zesty flavour to whatever I'm cooking up in the kitchen!"}]},
|
| 58 |
+
{"role": "user", "content": [{"type": "text", "text": "Do you have mayonnaise recipes?"}]}
|
| 59 |
+
]
|
| 60 |
+
|
| 61 |
+
model_inputs = tokenizer.apply_chat_template(messages, return_tensors="pt", add_generation_prompt=True).to("cuda")
|
| 62 |
+
|
| 63 |
+
generated_ids = model.generate(model_inputs, max_new_tokens=100, generation_config=model.generation_config)
|
| 64 |
+
|
| 65 |
+
response = tokenizer.batch_decode(generated_ids)[0]
|
| 66 |
+
|
| 67 |
+
print(response)
|
| 68 |
+
```
|
| 69 |
+
|
| 70 |
+
## Common Issues
|
| 71 |
+
|
| 72 |
+
### Hugging Face Network Issues
|
| 73 |
+
|
| 74 |
+
If you encounter network issues, you can set up a proxy before pulling the model.
|
| 75 |
+
|
| 76 |
+
```bash
|
| 77 |
+
export HF_ENDPOINT=https://hf-mirror.com
|
| 78 |
+
```
|
| 79 |
+
|
| 80 |
+
### MiniMax-M2 model is not currently supported
|
| 81 |
+
|
| 82 |
+
Please check that trust_remote_code=True.
|
| 83 |
+
|
| 84 |
+
## Getting Support
|
| 85 |
+
|
| 86 |
+
If you encounter any issues while deploying the MiniMax model:
|
| 87 |
+
|
| 88 |
+
- Contact our technical support team through official channels such as email at [model@minimax.io](mailto:model@minimax.io)
|
| 89 |
+
|
| 90 |
+
- Submit an issue on our [GitHub](https://github.com/MiniMax-AI) repository
|
| 91 |
+
|
| 92 |
+
We continuously optimize the deployment experience for our models. Feedback is welcome!
|
| 93 |
+
|
docs/transformers_deploy_guide_cn.md
ADDED
|
@@ -0,0 +1,94 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# MiniMax M2.7 模型 Transformers 部署指南
|
| 2 |
+
|
| 3 |
+
[英文版](./transformers_deploy_guide.md) | [中文版](./transformers_deploy_guide_cn.md)
|
| 4 |
+
|
| 5 |
+
## 本文档适用模型
|
| 6 |
+
|
| 7 |
+
本文档适用以下模型,只需在部署时修改模型名称即可。
|
| 8 |
+
|
| 9 |
+
- [MiniMaxAI/MiniMax-M2.7](https://huggingface.co/MiniMaxAI/MiniMax-M2.7)
|
| 10 |
+
- [MiniMaxAI/MiniMax-M2.5](https://huggingface.co/MiniMaxAI/MiniMax-M2.5)
|
| 11 |
+
- [MiniMaxAI/MiniMax-M2.1](https://huggingface.co/MiniMaxAI/MiniMax-M2.1)
|
| 12 |
+
- [MiniMaxAI/MiniMax-M2](https://huggingface.co/MiniMaxAI/MiniMax-M2)
|
| 13 |
+
|
| 14 |
+
以下以 MiniMax-M2.7 为例说明部署流程。
|
| 15 |
+
|
| 16 |
+
## 环境要求
|
| 17 |
+
|
| 18 |
+
- OS:Linux
|
| 19 |
+
|
| 20 |
+
- Python:3.9 - 3.12
|
| 21 |
+
|
| 22 |
+
- Transformers: 4.57.1
|
| 23 |
+
|
| 24 |
+
- GPU:
|
| 25 |
+
|
| 26 |
+
- compute capability 7.0 or higher
|
| 27 |
+
|
| 28 |
+
- 显存需求:权重需要 220 GB
|
| 29 |
+
|
| 30 |
+
## 使用 Python 部署
|
| 31 |
+
|
| 32 |
+
建议使用虚拟环境(如 **venv**、**conda**、**uv**)以避免依赖冲突。
|
| 33 |
+
|
| 34 |
+
建议在全新的 Python 环境中安装 Transformers:
|
| 35 |
+
|
| 36 |
+
```bash
|
| 37 |
+
uv pip install transformers==4.57.1 torch accelerate --torch-backend=auto
|
| 38 |
+
```
|
| 39 |
+
|
| 40 |
+
运行如下 Python 命令运行模型,Transformers 会自动从 Huggingface 下载并缓存 MiniMax-M2.7 模型。
|
| 41 |
+
|
| 42 |
+
```python
|
| 43 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer, GenerationConfig
|
| 44 |
+
import torch
|
| 45 |
+
|
| 46 |
+
MODEL_PATH = "MiniMaxAI/MiniMax-M2.7"
|
| 47 |
+
|
| 48 |
+
model = AutoModelForCausalLM.from_pretrained(
|
| 49 |
+
MODEL_PATH,
|
| 50 |
+
device_map="auto",
|
| 51 |
+
trust_remote_code=True,
|
| 52 |
+
)
|
| 53 |
+
tokenizer = AutoTokenizer.from_pretrained(MODEL_PATH)
|
| 54 |
+
|
| 55 |
+
messages = [
|
| 56 |
+
{"role": "user", "content": [{"type": "text", "text": "What is your favourite condiment?"}]},
|
| 57 |
+
{"role": "assistant", "content": [{"type": "text", "text": "Well, I'm quite partial to a good squeeze of fresh lemon juice. It adds just the right amount of zesty flavour to whatever I'm cooking up in the kitchen!"}]},
|
| 58 |
+
{"role": "user", "content": [{"type": "text", "text": "Do you have mayonnaise recipes?"}]}
|
| 59 |
+
]
|
| 60 |
+
|
| 61 |
+
model_inputs = tokenizer.apply_chat_template(messages, return_tensors="pt", add_generation_prompt=True).to("cuda")
|
| 62 |
+
|
| 63 |
+
generated_ids = model.generate(model_inputs, max_new_tokens=100, generation_config=model.generation_config)
|
| 64 |
+
|
| 65 |
+
response = tokenizer.batch_decode(generated_ids)[0]
|
| 66 |
+
|
| 67 |
+
print(response)
|
| 68 |
+
```
|
| 69 |
+
|
| 70 |
+
## 常见问题
|
| 71 |
+
|
| 72 |
+
### Huggingface 网络问题
|
| 73 |
+
|
| 74 |
+
如果遇到网络问题,可以设置代理后再进行拉取。
|
| 75 |
+
|
| 76 |
+
```bash
|
| 77 |
+
export HF_ENDPOINT=https://hf-mirror.com
|
| 78 |
+
```
|
| 79 |
+
|
| 80 |
+
### MiniMax-M2 model is not currently supported
|
| 81 |
+
|
| 82 |
+
请确认开启 trust_remote_code=True。
|
| 83 |
+
|
| 84 |
+
## 获取支持
|
| 85 |
+
|
| 86 |
+
如果在部署 MiniMax 模型过程中遇到任何问题:
|
| 87 |
+
|
| 88 |
+
- 通过邮箱 [model@minimax.io](mailto:model@minimax.io) 等官方渠道联系我们的技术支持团队
|
| 89 |
+
|
| 90 |
+
- 在我们的 [GitHub](https://github.com/MiniMax-AI) 仓库提交 Issue
|
| 91 |
+
|
| 92 |
+
- 通过我们的 [官方企业微信交流群](https://github.com/MiniMax-AI/MiniMax-AI.github.io/blob/main/images/wechat-qrcode.jpeg) 反馈
|
| 93 |
+
|
| 94 |
+
我们会持续优化模型的部署体验,欢迎反馈!
|
docs/vllm_deploy_guide.md
ADDED
|
@@ -0,0 +1,118 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# MiniMax M2.7 Model vLLM Deployment Guide
|
| 2 |
+
|
| 3 |
+
[English Version](./vllm_deploy_guide.md) | [Chinese Version](./vllm_deploy_guide_cn.md)
|
| 4 |
+
|
| 5 |
+
We recommend using [vLLM](https://docs.vllm.ai/en/stable/) to deploy the [MiniMax-M2.7](https://huggingface.co/MiniMaxAI/MiniMax-M2.7) model. vLLM is a high-performance inference engine with excellent serving throughput, efficient and intelligent memory management, powerful batch request processing capabilities, and deeply optimized underlying performance. We recommend reviewing vLLM's official documentation to check hardware compatibility before deployment.
|
| 6 |
+
|
| 7 |
+
## Applicable Models
|
| 8 |
+
|
| 9 |
+
This document applies to the following models. You only need to change the model name during deployment.
|
| 10 |
+
|
| 11 |
+
- [MiniMaxAI/MiniMax-M2.7](https://huggingface.co/MiniMaxAI/MiniMax-M2.7)
|
| 12 |
+
- [MiniMaxAI/MiniMax-M2.5](https://huggingface.co/MiniMaxAI/MiniMax-M2.5)
|
| 13 |
+
- [MiniMaxAI/MiniMax-M2.1](https://huggingface.co/MiniMaxAI/MiniMax-M2.1)
|
| 14 |
+
- [MiniMaxAI/MiniMax-M2](https://huggingface.co/MiniMaxAI/MiniMax-M2)
|
| 15 |
+
|
| 16 |
+
The deployment process is illustrated below using MiniMax-M2.7 as an example.
|
| 17 |
+
|
| 18 |
+
## System Requirements
|
| 19 |
+
|
| 20 |
+
- OS: Linux
|
| 21 |
+
|
| 22 |
+
- Python: 3.9 - 3.12
|
| 23 |
+
|
| 24 |
+
- GPU:
|
| 25 |
+
|
| 26 |
+
- compute capability 7.0 or higher
|
| 27 |
+
|
| 28 |
+
- Memory requirements: 220 GB for weights, 240 GB per 1M context tokens
|
| 29 |
+
|
| 30 |
+
The following are recommended configurations; actual requirements should be adjusted based on your use case:
|
| 31 |
+
|
| 32 |
+
- **96G x4** GPU: Supports a total KV Cache capacity of 400K tokens.
|
| 33 |
+
|
| 34 |
+
- **144G x8** GPU: Supports a total KV Cache capacity of up to 3M tokens.
|
| 35 |
+
|
| 36 |
+
> **Note**: The values above represent the total aggregate hardware KV Cache capacity. The maximum context length per individual sequence remains **196K** tokens.
|
| 37 |
+
|
| 38 |
+
## Deployment with Python
|
| 39 |
+
|
| 40 |
+
It is recommended to use a virtual environment (such as **venv**, **conda**, or **uv**) to avoid dependency conflicts.
|
| 41 |
+
|
| 42 |
+
We recommend installing vLLM in a fresh Python environment:
|
| 43 |
+
|
| 44 |
+
```bash
|
| 45 |
+
uv venv
|
| 46 |
+
source .venv/bin/activate
|
| 47 |
+
uv pip install vllm --torch-backend=auto
|
| 48 |
+
```
|
| 49 |
+
|
| 50 |
+
Run the following command to start the vLLM server. vLLM will automatically download and cache the MiniMax-M2.7 model from Hugging Face.
|
| 51 |
+
|
| 52 |
+
4-GPU deployment command:
|
| 53 |
+
|
| 54 |
+
```bash
|
| 55 |
+
SAFETENSORS_FAST_GPU=1 vllm serve \
|
| 56 |
+
MiniMaxAI/MiniMax-M2.7 --trust-remote-code \
|
| 57 |
+
--tensor-parallel-size 4 \
|
| 58 |
+
--enable-auto-tool-choice --tool-call-parser minimax_m2 \
|
| 59 |
+
--reasoning-parser minimax_m2_append_think
|
| 60 |
+
```
|
| 61 |
+
|
| 62 |
+
8-GPU deployment command:
|
| 63 |
+
|
| 64 |
+
```bash
|
| 65 |
+
SAFETENSORS_FAST_GPU=1 vllm serve \
|
| 66 |
+
MiniMaxAI/MiniMax-M2.7 --trust-remote-code \
|
| 67 |
+
--enable_expert_parallel --tensor-parallel-size 8 \
|
| 68 |
+
--enable-auto-tool-choice --tool-call-parser minimax_m2 \
|
| 69 |
+
--reasoning-parser minimax_m2_append_think
|
| 70 |
+
```
|
| 71 |
+
|
| 72 |
+
## Testing Deployment
|
| 73 |
+
|
| 74 |
+
After startup, you can test the vLLM OpenAI-compatible API with the following command:
|
| 75 |
+
|
| 76 |
+
```bash
|
| 77 |
+
curl http://localhost:8000/v1/chat/completions \
|
| 78 |
+
-H "Content-Type: application/json" \
|
| 79 |
+
-d '{
|
| 80 |
+
"model": "MiniMaxAI/MiniMax-M2.7",
|
| 81 |
+
"messages": [
|
| 82 |
+
{"role": "system", "content": [{"type": "text", "text": "You are a helpful assistant."}]},
|
| 83 |
+
{"role": "user", "content": [{"type": "text", "text": "Who won the world series in 2020?"}]}
|
| 84 |
+
]
|
| 85 |
+
}'
|
| 86 |
+
```
|
| 87 |
+
|
| 88 |
+
## Common Issues
|
| 89 |
+
|
| 90 |
+
### MiniMax-M2 model is not currently supported
|
| 91 |
+
|
| 92 |
+
This vLLM version is outdated. Please upgrade to the latest version.
|
| 93 |
+
|
| 94 |
+
### torch.AcceleratorError: CUDA error: an illegal memory access was encountered
|
| 95 |
+
Add `--compilation-config "{\"cudagraph_mode\": \"PIECEWISE\"}"` to the startup parameters to resolve this issue. For example:
|
| 96 |
+
|
| 97 |
+
```bash
|
| 98 |
+
SAFETENSORS_FAST_GPU=1 vllm serve \
|
| 99 |
+
MiniMaxAI/MiniMax-M2.7 --trust-remote-code \
|
| 100 |
+
--enable_expert_parallel --tensor-parallel-size 8 \
|
| 101 |
+
--enable-auto-tool-choice --tool-call-parser minimax_m2 \
|
| 102 |
+
--reasoning-parser minimax_m2_append_think \
|
| 103 |
+
--compilation-config "{\"cudagraph_mode\": \"PIECEWISE\"}"
|
| 104 |
+
```
|
| 105 |
+
|
| 106 |
+
### Output is garbled
|
| 107 |
+
|
| 108 |
+
If you encounter corrupted output when using vLLM to serve these models, you can upgrade to the nightly version (ensure it is a version after commit [cf3eacfe58fa9e745c2854782ada884a9f992cf7](https://github.com/vllm-project/vllm/commit/cf3eacfe58fa9e745c2854782ada884a9f992cf7))
|
| 109 |
+
|
| 110 |
+
## Getting Support
|
| 111 |
+
|
| 112 |
+
If you encounter any issues while deploying the MiniMax model:
|
| 113 |
+
|
| 114 |
+
- Contact our technical support team through official channels such as email at [model@minimax.io](mailto:model@minimax.io)
|
| 115 |
+
|
| 116 |
+
- Submit an issue on our [GitHub](https://github.com/MiniMax-AI) repository
|
| 117 |
+
|
| 118 |
+
We continuously optimize the deployment experience for our models. Feedback is welcome!
|
docs/vllm_deploy_guide_cn.md
ADDED
|
@@ -0,0 +1,128 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# MiniMax M2.7 模型 vLLM 部署指南
|
| 2 |
+
|
| 3 |
+
[英文版](./vllm_deploy_guide.md) | [中文版](./vllm_deploy_guide_cn.md)
|
| 4 |
+
|
| 5 |
+
我们推荐使用 [vLLM](https://docs.vllm.ai/en/stable/) 来部署 [MiniMax-M2.7](https://huggingface.co/MiniMaxAI/MiniMax-M2.7) 模型。vLLM 是一个高性能的推理引擎,其具有卓越的服务吞吐、高效智能的内存管理机制、强大的批量请求处理能力、深度优化的底层性能等特性。我们建议在部署之前查看 vLLM 的官方文档以检查硬件兼容性。
|
| 6 |
+
|
| 7 |
+
## 本文档适用模型
|
| 8 |
+
|
| 9 |
+
本文档适用以下模型,只需在部署时修改模型名称即可。
|
| 10 |
+
|
| 11 |
+
- [MiniMaxAI/MiniMax-M2.7](https://huggingface.co/MiniMaxAI/MiniMax-M2.7)
|
| 12 |
+
- [MiniMaxAI/MiniMax-M2.5](https://huggingface.co/MiniMaxAI/MiniMax-M2.5)
|
| 13 |
+
- [MiniMaxAI/MiniMax-M2.1](https://huggingface.co/MiniMaxAI/MiniMax-M2.1)
|
| 14 |
+
- [MiniMaxAI/MiniMax-M2](https://huggingface.co/MiniMaxAI/MiniMax-M2)
|
| 15 |
+
|
| 16 |
+
以下以 MiniMax-M2.7 为例说明部署流程。
|
| 17 |
+
|
| 18 |
+
## 环境要求
|
| 19 |
+
|
| 20 |
+
- OS:Linux
|
| 21 |
+
|
| 22 |
+
- Python:3.9 - 3.12
|
| 23 |
+
|
| 24 |
+
- GPU:
|
| 25 |
+
|
| 26 |
+
- compute capability 7.0 or higher
|
| 27 |
+
|
| 28 |
+
- 显存需求:权重需要 220 GB,每 1M 上下文 token 需要 240 GB
|
| 29 |
+
|
| 30 |
+
以下为推荐配置,实际需求请根据业务场景调整:
|
| 31 |
+
|
| 32 |
+
- **96G x4 GPU**:总 KV Cache 容量支持 40 万 token。
|
| 33 |
+
|
| 34 |
+
- **144G x8 GPU**:总 KV Cache 容量支持高达 300 万 token。
|
| 35 |
+
|
| 36 |
+
> **注**:以上数值为硬件支持的最大并发缓存总量,模型单序列(Single Sequence)长度上限仍为 196k。
|
| 37 |
+
|
| 38 |
+
## 使用 Python 部署
|
| 39 |
+
|
| 40 |
+
建议使用虚拟环境(如 **venv**、**conda**、**uv**)以避免依赖冲突。
|
| 41 |
+
|
| 42 |
+
建议在全新的 Python 环境中安装 vLLM:
|
| 43 |
+
|
| 44 |
+
```bash
|
| 45 |
+
uv venv
|
| 46 |
+
source .venv/bin/activate
|
| 47 |
+
uv pip install vllm --torch-backend=auto
|
| 48 |
+
```
|
| 49 |
+
|
| 50 |
+
运行如下命令启动 vLLM 服务器,vLLM 会自动从 Huggingface 下载并缓存 MiniMax-M2.7 模型。
|
| 51 |
+
|
| 52 |
+
4 卡部署命令:
|
| 53 |
+
|
| 54 |
+
```bash
|
| 55 |
+
SAFETENSORS_FAST_GPU=1 vllm serve \
|
| 56 |
+
MiniMaxAI/MiniMax-M2.7 --trust-remote-code \
|
| 57 |
+
--tensor-parallel-size 4 \
|
| 58 |
+
--enable-auto-tool-choice --tool-call-parser minimax_m2 \
|
| 59 |
+
--reasoning-parser minimax_m2_append_think
|
| 60 |
+
```
|
| 61 |
+
|
| 62 |
+
8 卡部署命令:
|
| 63 |
+
|
| 64 |
+
```bash
|
| 65 |
+
SAFETENSORS_FAST_GPU=1 vllm serve \
|
| 66 |
+
MiniMaxAI/MiniMax-M2.7 --trust-remote-code \
|
| 67 |
+
--enable_expert_parallel --tensor-parallel-size 8 \
|
| 68 |
+
--enable-auto-tool-choice --tool-call-parser minimax_m2 \
|
| 69 |
+
--reasoning-parser minimax_m2_append_think
|
| 70 |
+
```
|
| 71 |
+
|
| 72 |
+
## 测试部署
|
| 73 |
+
|
| 74 |
+
启动后,可以通过如下命令测试 vLLM OpenAI 兼容接口:
|
| 75 |
+
|
| 76 |
+
```bash
|
| 77 |
+
curl http://localhost:8000/v1/chat/completions \
|
| 78 |
+
-H "Content-Type: application/json" \
|
| 79 |
+
-d '{
|
| 80 |
+
"model": "MiniMaxAI/MiniMax-M2.7",
|
| 81 |
+
"messages": [
|
| 82 |
+
{"role": "system", "content": [{"type": "text", "text": "You are a helpful assistant."}]},
|
| 83 |
+
{"role": "user", "content": [{"type": "text", "text": "Who won the world series in 2020?"}]}
|
| 84 |
+
]
|
| 85 |
+
}'
|
| 86 |
+
```
|
| 87 |
+
|
| 88 |
+
## 常见问题
|
| 89 |
+
|
| 90 |
+
### Huggingface 网络问题
|
| 91 |
+
|
| 92 |
+
如果遇到网络问题,可以设置代理后再进行拉取。
|
| 93 |
+
|
| 94 |
+
```bash
|
| 95 |
+
export HF_ENDPOINT=https://hf-mirror.com
|
| 96 |
+
```
|
| 97 |
+
|
| 98 |
+
### MiniMax-M2 model is not currently supported
|
| 99 |
+
|
| 100 |
+
该 vLLM 版本过旧,请升级到最新版本。
|
| 101 |
+
|
| 102 |
+
### torch.AcceleratorError: CUDA error: an illegal memory access was encountered
|
| 103 |
+
在启动参数添加 `--compilation-config "{\"cudagraph_mode\": \"PIECEWISE\"}"` 可以解决。例如:
|
| 104 |
+
|
| 105 |
+
```bash
|
| 106 |
+
SAFETENSORS_FAST_GPU=1 vllm serve \
|
| 107 |
+
MiniMaxAI/MiniMax-M2.7 --trust-remote-code \
|
| 108 |
+
--enable_expert_parallel --tensor-parallel-size 8 \
|
| 109 |
+
--enable-auto-tool-choice --tool-call-parser minimax_m2 \
|
| 110 |
+
--reasoning-parser minimax_m2_append_think \
|
| 111 |
+
--compilation-config "{\"cudagraph_mode\": \"PIECEWISE\"}"
|
| 112 |
+
```
|
| 113 |
+
|
| 114 |
+
### 模型输出乱码
|
| 115 |
+
|
| 116 |
+
如果您在使用 vLLM 运行这些模型时遇到输出乱码,可以升级到最新版本(请至少确保版本在提交 [cf3eacfe58fa9e745c2854782ada884a9f992cf7](https://github.com/vllm-project/vllm/commit/cf3eacfe58fa9e745c2854782ada884a9f992cf7) 之后)。
|
| 117 |
+
|
| 118 |
+
## 获取支持
|
| 119 |
+
|
| 120 |
+
如果在部署 MiniMax 模型过程中遇到任何问题:
|
| 121 |
+
|
| 122 |
+
- 通过邮箱 [model@minimax.io](mailto:model@minimax.io) 等官方渠道联系我们的技术支持团队
|
| 123 |
+
|
| 124 |
+
- 在我们的 [GitHub](https://github.com/MiniMax-AI) 仓库提交 Issue
|
| 125 |
+
|
| 126 |
+
- 通过我们的 [官方企业微信交流群](https://github.com/MiniMax-AI/MiniMax-AI.github.io/blob/main/images/wechat-qrcode.jpeg) 反馈
|
| 127 |
+
|
| 128 |
+
我们会持续优化模型的部署体验,欢迎反馈!
|
figures/agent_harness.png
ADDED
|
Git LFS Details
|
figures/agent_teams.gif
ADDED
|
Git LFS Details
|
figures/banner.png
ADDED
|
Git LFS Details
|
figures/benchmark_overview.png
ADDED
|
figures/mle_bench.png
ADDED
|
Git LFS Details
|
generation_config.json
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"bos_token_id": 200019,
|
| 3 |
+
"do_sample": true,
|
| 4 |
+
"eos_token_id": 200020,
|
| 5 |
+
"temperature": 1.0,
|
| 6 |
+
"top_p": 0.95,
|
| 7 |
+
"top_k": 40,
|
| 8 |
+
"transformers_version": "4.46.1"
|
| 9 |
+
}
|
merges.txt
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
model-00000-of-00130.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:9785f5a87c85710e38f4ca11f819f3d137ff84615af1bc0ba533b94681addf27
|
| 3 |
+
size 3693062744
|
model-00001-of-00130.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:d2ed94efe077a4498b788706e059d82780deb54436a70a5a9664b716d6cdc83e
|
| 3 |
+
size 1208321176
|
model-00002-of-00130.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:f0c1b97aff37136b5d89a9df22acf7109fa824ccef5f9ff4f763b7869dfc5650
|
| 3 |
+
size 2463868936
|
model-00003-of-00130.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:93be479ff1b6912ff1a7e54f4c4a4e4d67124d1811df8e39d50b981b1b43d8e6
|
| 3 |
+
size 1208321176
|
model-00004-of-00130.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:5d5bead700b8f82dd2a50cee205c37f5642020c414452869693da06df384a9eb
|
| 3 |
+
size 2463868936
|
model-00005-of-00130.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:99444d6d83c614776397faa167dc908d48016414e0dd6edef57fd9c040e01d21
|
| 3 |
+
size 1208321176
|
model-00006-of-00130.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:df42d1d91b84ed41f846775a274dbd382185fdf7595009dcd016bd805e25eb1b
|
| 3 |
+
size 2463868936
|
model-00007-of-00130.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:18882ffcb4f2dddfe6b8766393c68208b524aa4520ed921234a66b11548440eb
|
| 3 |
+
size 1208321176
|
model-00008-of-00130.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:cf8ead5d7b01543a3fafc5a39240b1a3d9fe1cf25b360eb99e7a751359db9705
|
| 3 |
+
size 2463868936
|
model-00009-of-00130.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:d897820ce912aa7ae2feb4377d9b8684eca38c18be550b6bcf7316cb9d7c6e30
|
| 3 |
+
size 1208321176
|
model-00010-of-00130.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:734eee6e62863c518a976d41b6c4122ed974cf87e52cd2d7e7df0187a3141b87
|
| 3 |
+
size 2463868936
|
model-00011-of-00130.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:1237cbe1b9915bfda1efb8ced7d5a4266a0083a3b4c3fa401c4a003e3fea20fd
|
| 3 |
+
size 1208321176
|
model-00012-of-00130.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:069b272af35289d3c499e98f867b1ffecb1f96980c583bf77b1d4d23c8b7a713
|
| 3 |
+
size 2463868936
|
model-00013-of-00130.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:045403b45c8951c3ea3c68b288f04255e0e2fc4de47293f9b941964212b8253e
|
| 3 |
+
size 1208321176
|
model-00014-of-00130.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:0277da3d1063a00618b32992617a2448c95c850c1f26dc4024d70ae920a35a25
|
| 3 |
+
size 2463868936
|
model-00015-of-00130.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:d2a9db97dbab9f2a324219d4ba019656b6b635fae3b868d7f2a4fd6e3bab5e66
|
| 3 |
+
size 1208321176
|
model-00016-of-00130.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:90776eaf143864ecb632c059fefd4167e27c5644ba4eb50d65afa5291cff666e
|
| 3 |
+
size 2463868936
|
model-00017-of-00130.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:4ea50b70dae5f8b55b1990a6b6cad9291349b45162548e9d48d63b2a144e3c23
|
| 3 |
+
size 1208321176
|
model-00018-of-00130.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:2a239e9eae27174937d5547d8e5e743e84bd7eaea50390510e4cd8f15511447b
|
| 3 |
+
size 2463868936
|
model-00019-of-00130.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:5e041358d2ce0d92517b13508046baf08807d46adb33dda5d23728a4cef45f2b
|
| 3 |
+
size 1208321176
|
model-00020-of-00130.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:4f4f7af9ded3e7d5775012eae2c7dee63518c799ebbe42a47949aa7f560c5f43
|
| 3 |
+
size 2463869968
|
model-00021-of-00130.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:8a76ddac05820e58676b3b56e2990c598dae551f1f65adf55a90a3754f66e2b4
|
| 3 |
+
size 1208321688
|
model-00022-of-00130.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:c080ad8c3b5032434973e205a074e4d1a41edd399a383dc1c6d80ebb073ca09e
|
| 3 |
+
size 2463869968
|
model-00023-of-00130.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:9eee017222d3eb90afa5126fccb194de12c67828bd4353b3a466ce3da17877d2
|
| 3 |
+
size 1208321688
|
model-00024-of-00130.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:e3d3c543000e2fd6180bb17c289f36e46256bf0c76f7ae98a7087eb4264db605
|
| 3 |
+
size 2463869968
|
model-00025-of-00130.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:68580bdb4da65c22fb95a16e7fe13b1f0bbde861327d7c0bb6cb76a86794d38d
|
| 3 |
+
size 1208321688
|
model-00026-of-00130.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:c0ca69318b53d7ec6f7fcfa7981ed2ec402e73302fd5ea62ed77311f4eb8be73
|
| 3 |
+
size 2463869968
|
model-00027-of-00130.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:a6f03ff04b01299dceaf26fe0a0a503d6e0abc58eba94e8796e933e40bd10a5e
|
| 3 |
+
size 1208321688
|
model-00028-of-00130.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:6432450282a2cd79475b57bf5b83380addf0b8d36586c750bc4fbf37ce04af6e
|
| 3 |
+
size 2463869968
|
model-00029-of-00130.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:961ca8675f7ee7a1a65e5ea5f1e35dfe7427d566e68a1f56f04a463252763683
|
| 3 |
+
size 1208321688
|