Mistral Large 3(675B MoE)
在 Clore.ai 的 GPU 上运行 Mistral Large 3——拥有 41B 激活参数的 675B MoE 前沿模型
最后更新于
这有帮助吗?
这有帮助吗?
# 安装 Ollama
curl -fsSL https://ollama.com/install.sh | sh
# 运行 675B 模型(需要多 GPU,Q4 量化约需 ~96GB 以上显存)
ollama run mistral-large-3:675b
# 对于较小的稠密变体(单 GPU):
ollama run mistral3:14b # 14B 稠密 — 可在 RTX 3060+ 上运行
ollama run mistral3:8b # 8B 稠密 — 适用于任何 GPU# 安装 vLLM
pip install vllm
# 在 8× A100/H100 上使用 NVFP4 量化进行服务
vllm serve mistralai/Mistral-Large-3-675B-Instruct-2512-NVFP4 \
--tensor-parallel-size 8 \
--tokenizer-mode mistral \
--config-format mistral \
--load-format mistral \
--max-model-len 65536 \
--gpu-memory-utilization 0.90 \
--enable-auto-tool-choice \
--tool-call-parser mistral \
--host 0.0.0.0 \
--port 8000
# 对于 FP8(原始权重,最高质量):
vllm serve mistralai/Mistral-Large-3-675B-Instruct-2512 \
--tensor-parallel-size 8 \
--tokenizer-mode mistral \
--config-format mistral \
--load-format mistral \
--max-model-len 131072 \
--host 0.0.0.0 \
--port 8000from openai import OpenAI
client = OpenAI(
base_url="http://localhost:8000/v1",
api_key="not-needed"
)
response = client.chat.completions.create(
model="mistralai/Mistral-Large-3-675B-Instruct-2512-NVFP4",
messages=[
{"role": "system", "content": "你是一个乐于助人的编码助理。"},
{"role": "user", "content": "使用 aiohttp 和 BeautifulSoup 编写一个 Python 异步网页抓取器。"}
],
temperature=0.1,
max_tokens=4096
)
print(response.choices[0].message.content)import json
from openai import OpenAI
client = OpenAI(base_url="http://localhost:8000/v1", api_key="n/a")
tools = [
{
"type": "function",
"function": {
"name": "get_weather",
"description": "获取某地当前天气",
"parameters": {
"type": "object",
"properties": {
"location": {"type": "string", "description": "城市名称"},
"unit": {"type": "string", "enum": ["celsius", "fahrenheit"]}
},
"required": ["location"]
}
}
}
]
response = client.chat.completions.create(
model="mistralai/Mistral-Large-3-675B-Instruct-2512-NVFP4",
messages=[{"role": "user", "content": "东京的天气怎么样?"}],
tools=tools,
tool_choice="auto"
)
tool_call = response.choices[0].message.tool_calls[0]
print(f"Function: {tool_call.function.name}")
print(f"Args: {tool_call.function.arguments}")import base64
from openai import OpenAI
client = OpenAI(base_url="http://localhost:8000/v1", api_key="n/a")
# 对图像进行编码
with open("diagram.png", "rb") as f:
image_b64 = base64.b64encode(f.read()).decode()
response = client.chat.completions.create(
model="mistralai/Mistral-Large-3-675B-Instruct-2512-NVFP4",
messages=[{
"role": "user",
"content": [
{"type": "text", "text": "详细描述此架构图。"},
{"type": "image_url", "image_url": {"url": f"data:image/png;base64,{image_b64}"}}
]
}],
max_tokens=2048
)
print(response.choices[0].message.content)