xusenlinzy/api-for-open-llm

请问支持启动时加载多个LLM模型吗?

rzechen opened this issue · 1 comments

提交前必须检查以下项目 | The following items must be checked before submission

  • 请确保使用的是仓库最新代码(git pull),一些问题已被解决和修复。 | Make sure you are using the latest code from the repository (git pull), some issues have already been addressed and fixed.
  • 我已阅读项目文档FAQ章节并且已在Issue中对问题进行了搜索,没有找到相似问题和解决方案 | I have searched the existing issues / discussions

问题类型 | Type of problem

其他问题 | Other issues

操作系统 | Operating system

macOS

详细描述问题 | Detailed description of the problem

请问支持启动时加载多个LLM模型吗?我看在使用模型远程API的时候是可以指定model_name

Dependencies

# 请在此处粘贴依赖情况
# Please paste the dependencies here

运行日志或截图 | Runtime logs or screenshots

# 请在此处粘贴运行日志
# Please paste the run log here

你好,你可以分别启动多个模型,将模型全部转发到同一个base_url

https://github.com/xusenlinzy/api-for-open-llm/blob/master/examples/openai_api.py

然后参考上面提供的脚本,在 MODEL_LIST 中添加你的模型即可,修改完之后将 openai_api.py 文件移至根目录下执行

python openai_api.py

调用方式可参考https://github.com/xusenlinzy/api-for-open-llm/blob/master/examples/request_test.py