【作业贴】2025-01-24,18-私有化LLM仿OpenAI API接口的高可用工程实践 #71

Open
opened 2025-02-17 08:37:31 +08:00 by xiaodunh · 0 comments

具体实现步骤及结果:
1、修改源码,增加端口参数:
#增加端口参数
parser.add_argument('--port', default=19327, type=int)
#启动时,增加端口参数
uvicorn.run(app, host="0.0.0.0", port=args.port, workers=1, log_config=log_ config)
2、启动GPU版本,端口号19328
python openai_api_server.py --port 19328 --gpus 0 --base_model /root/autodl-tmp/llama-3-chinese-8b-instruct-v3
image
3、启动CPU版本,端口号19329
python openai_api_server.py --only_cpu --port 19329 --base_model /root/autodl-tmp/llama-3-chinese-8b-instruct-v3
image
4、开启隧道
5、启动OneApi
image
登录并修改默认密码:
image
6、添加渠道
image
7、创建令牌
image
8、配置客户端指向OneAPI
image
9、验证集群效果
停止一个端口服务,可以正常访问另一个端口。
能够明显看到CPU和GPU端口的性能区别。
image

具体实现步骤及结果: 1、修改源码,增加端口参数: #增加端口参数 parser.add_argument('--port', default=19327, type=int) #启动时,增加端口参数 uvicorn.run(app, host="0.0.0.0", port=args.port, workers=1, log_config=log_ config) 2、启动GPU版本,端口号19328 python openai_api_server.py --port 19328 --gpus 0 --base_model /root/autodl-tmp/llama-3-chinese-8b-instruct-v3 <img width="416" alt="image" src="/attachments/bf2c488e-c6f6-4f3e-a85a-879bef901340"> 3、启动CPU版本,端口号19329 python openai_api_server.py --only_cpu --port 19329 --base_model /root/autodl-tmp/llama-3-chinese-8b-instruct-v3 <img width="416" alt="image" src="/attachments/b0ae7f75-e94f-4b62-abb3-12c522cd2648"> 4、开启隧道 5、启动OneApi <img width="416" alt="image" src="/attachments/42b10fe6-5369-46f3-93df-274f67a4f273"> 登录并修改默认密码: <img width="416" alt="image" src="/attachments/8e35ab13-533d-40d6-9508-8c4770c4f843"> 6、添加渠道 <img width="416" alt="image" src="/attachments/dc764060-32b0-42c0-8ade-3d726ffd15ad"> 7、创建令牌 <img width="416" alt="image" src="/attachments/036bf12a-6bdd-4f7f-96f0-fbce4d3742fb"> 8、配置客户端指向OneAPI <img width="416" alt="image" src="/attachments/745720a3-eeb8-4ef9-895c-bc56a367d887"> 9、验证集群效果 停止一个端口服务,可以正常访问另一个端口。 能够明显看到CPU和GPU端口的性能区别。 <img width="416" alt="image" src="/attachments/bc1bd5eb-dfcd-4e1b-8d7e-fb4915dda92b">
Sign in to join this conversation.
No Label
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: HswOAuth/llm_share#71
No description provided.