截止2026年1月15日,经过多次实验,ollama 不支持 MAI-UI/QWEN-3VL 系列多模态模型。
ARM 架构 Mac 上最新 vllm 默认使用 CPU 推理非常慢,MLX-LM 性能更佳,但是不支持QWEN-3VL。
因而采用 vllm-mlx 推理。核心原因:
vllm-mlx brings native Apple Silicon GPU acceleration to vLLM by integrating:
- MLX: Apple's ML framework with unified memory and Metal kernels
- mlx-lm: Optimized LLM inference with KV cache and quantization
- mlx-vlm: Vision-language models for multimodal inference
- mlx-audio: Speech-to-Text and Text-to-Speech with native voices
下载模型文件
curl -LsSf https://hf.co/cli/install.sh | bash
hf auth login
hf download Tongyi-MAI/MAI-UI-2B --local-dir ~/models/mai-ui-2b
安装 vllm-mlx
按照MAI-UI-2B 模型转换指南:在 Apple Silicon 上运行执行。在本机 8000 可以访问模型服务。例如:
curl http://127.0.0.1:8000/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{"model": "default", "messages": [{"role": "user", "content": "你好"}], "max_tokens": 100}'
{
"id": "chatcmpl-bc28cb7c",
"object": "chat.completion",
"created": 1768534410,
"model": "default",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "你好!有什么可以帮助你的吗?",
"tool_calls": null
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 0,
"completion_tokens": 7,
"total_tokens": 7
}
}