OpenLLM
🦾 OpenLLM 让开发者只需一个命令即可将任何开源 LLM 作为 OpenAI 兼容的 API 终端节点运行。
- 🔬 为快速和生产使用而构建
- 🚂 支持 llama3、qwen2、gemma 等,以及许多量化版本 完整列表
- ⛓️ OpenAI 兼容的 API
- 💬 内置类似 ChatGPT 的 UI
- 🔥 通过最先进的推理后端加速 LLM 解码
- 🌥️ 准备好用于企业级云部署 (Kubernetes, Docker 和 BentoCloud)
安装
通过 PyPI 安装 openllm
%pip install --upgrade --quiet openllm
在本地启动 OpenLLM 服务器
要启动 LLM 服务器,请使用 openllm hello
命令
openllm hello
包装器
from langchain_community.llms import OpenLLM
server_url = "http://localhost:3000" # Replace with remote host if you are running on a remote server
llm = OpenLLM(base_url=server_url, api_key="na")
API 参考:OpenLLM
llm("To build a LLM from scratch, the following are the steps:")