https:// billy.dev /posts/first/ ⌘K

在Mac Mini上部署私有化大语言模型

ƛMac mini

环境准备

  1. 系统要求:
    • macOS Monterey 12.3 或更高版本
    • 至少16GB内存(推荐32GB)
    • 安装Homebrew包管理器
# 安装Homebrew
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

安装部署

1. 安装Ollama

# 通过curl直接安装
curl -fsSL https://ollama.com/install.sh | sh

# 启动ollama服务
ollama serve

2. 部署Open WebUI

# 使用Docker运行webui容器
docker run -d -p 3000:8080 \
  -v ollama:/root/.ollama \
  --name open-webui \
  ghcr.io/open-webui/open-webui:main

模型加载

# 下载llama3模型(根据需求替换模型名称)
ollama pull llama3

# 查看已安装模型
ollama list

访问验证

  1. 打开浏览器访问:

    • Ollama管理界面:http://localhost:11434
    • WebUI界面:http://localhost:3000
  2. 在WebUI界面选择模型即可开始对话

注意事项

  1. 确保3000/11434端口未被占用
  2. 首次下载模型需要较长时间(取决于网络环境)
  3. 建议配合Ngrok实现内网穿透
  4. 使用GPU加速需要额外配置Metal后端
go run.
觉得这篇有用?
订阅 RSS 或去 GitHub 给 go-mcp 点个 ⭐