## 简介 本来想直接在docker里面跑 vllm ,但是 mac m2 没有对应的镜像,所以改为直接系统上用python 跑 ## 准备 下载需要运行的模型,记得修改 `start.sh` 中的模型配置 例: 使用 `Qwen2.5-0.5B-Instruct` 模型调试 ``` # mac 系统 # 1. 安装 git-lfs,Git LFS(Large File Storage)是 Git 的一个扩展,专门用于高效地版本控制大型文件,如音频、视频、数据集、图形资产等 brew install git-lfs git lfs install # 2. 下载模型 mkdir models cd models git clone https://www.modelscope.cn/Qwen/Qwen2.5-0.5B-Instruct.git ``` ## 命令 ```shell # 启动 sh start.sh # 关闭 sh stop.sh # 查看是否成功 curl -H "Authorization: Bearer sk-local-827ccb0eea8a706c4c34a16891f84e7b" http://localhost:8022/v1/models # embedding curl http://localhost:8023/v1/embeddings \ -X POST \ -H "Authorization: Bearer sk-local-827ccb0eea8a706c4c34a16891f84e7b" \ -H "Content-Type: application/json" \ -d '{"input": ["Instruct: Given a web search query, retrieve relevant passages that answer the query\nQuery: What is the capital of China?", "Instruct: Given a web search query, retrieve relevant passages that answer the query\nQuery: Explain gravity"]}' ```