1. 详细步骤
1.1 安装
# CUDA/CPU
pip install "xinference[transformers]"
pip install "xinference[vllm]"
pip install "xinference[sglang]"
# Metal(MPS)
pip install "xinference[mlx]"
CMAKE_ARGS="-DLLAMA_METAL=on" pip install llama-cpp-python
注:可能是 nvcc 版本等个人环境配置原因,llama-cpp-python 在 CUDA 上无法使用(C/C++ 环境上是正常的),Metal 的 llama-cpp-python 正常。如需安装 flashinfer 等依赖见官方安装文档:https://inference.readthedocs.io/zh-cn/latest/getting_started/installation.html
1.2 启动
1.2.1 直接启动
简洁命令
xinference-local --host 0.0.0.0 --port 9997
多参数命令
设置模型缓存路径和模型来源(Hugging Face/Modelscope)
# CUDA/CPU
XINFERENCE_HOME=/path/.xinference XINFERENCE_MODEL_SRC=modelscope xinference-local --host 0.0.0.0 --port 9997
# Metal(MPS)
XINFERENCE_HOME=/path/.xinference XINFERENCE_MODEL_SRC
4385


&spm=1001.2101.3001.11974&articleId=145593727&d=1&t=3&u=2d42763a95f84c2193b49e2a23184037)

被折叠的 条评论
为什么被折叠?



