Windows 安装 Xinference 速记
Windows 安装 Xinference 速记
1. 环境准备
- 系统:Windows(含 NVIDIA GPU,CUDA ≥ 12.9)
- Python:3.10(推荐 Conda 环境)
conda create -n xinference python=3.10 -y
conda activate xinference
2. 安装依赖
- 在命令行窗口查看cuda版本:
bash nvidia-smi
依赖 | 安装命令 |
---|---|
PyTorch 2.0.1 + CUDA 12.9 | conda install pytorch==2.0.1 torchvision==0.15.2 torchaudio==2.0.2 pytorch-cuda=12.9 -c pytorch -c nvidia |
llama-cpp-python | pip install https://github.com/abetlen/llama-cpp-python/releases/download/v0.2.55/llama_cpp_python-0.2.55-cp310-cp310-win_amd64.whl |
chatglm-cpp | pip install https://github.com/li-plus/chatglm.cpp/releases/download/v0.3.1/chatglm_cpp-0.3.1-cp310-cp310-win_amd64.whl |
Xinference | pip install "xinference[all]" |
3. 环境变量配置
设置模型缓存路径(按需修改):
# Windows 系统环境变量
XINFERENCE_HOME=D:\XinferenceCache
4. 启动服务
命令行启动
xinference-local -H <本机 IP>
- 浏览器访问
http://<IP>:9997
- 在 Running Models 页面选择并加载模型。
5. 常见问题速查
问题 | 解决方案 |
---|---|
PyExtensionType 报错 | pyarrow=21.0.0版本太新了,得安装旧版本如18.0.0 ( pip install --user --upgrade pyarrow==18.0.0 ) |
中文乱码 | 启动前执行 chcp 65001 |
无法拉取镜像 | docker login xprobe/xinference:latest 或换源 |
6. 验证
- 浏览器打开
http://localhost:9997
- 加载模型 → 查看 Cluster Information → 完成!
✅ 至此,Xinference 已在 Windows 上成功部署并可用。