Xinference 模型推理平台
Xinference 用统一接口部署 LLM、Embedding、Rerank、语音和多模态模型,支持 OpenAI 兼容 API、分布式集群和模型热加载。适合内部模型广场和多模型服务。
核心概念:supervisor、worker、model、model uid 和 launch 参数。
安装并启动:
pip install "xinference[all]"
xinference-local --host 0.0.0.0 --port 9997
启动模型:
xinference launch --model-name qwen2.5-instruct --size-in-billions 7 --model-engine vllm
查看运行中的模型:
xinference list
OpenAI 兼容调用:
curl http://localhost:9997/v1/chat/completions \
-H 'Content-Type: application/json' \
-d '{"model":"qwen2.5-instruct","messages":[{"role":"user","content":"你好"}]}'
启动 embedding 模型:
xinference launch --model-name bge-m3 --model-type embedding
model-type 写错,launch 失败。