OpenLLM
🦾 OpenLLM 使开发者能够通过 单个命令 将任何 开源大语言模型(LLMs) 运行为 与 OpenAI 兼容的 API 端点。
- 🔬 为快速和生产用途而构建
- 🚂 支持llama3、qwen2、gemma等,以及许多量化版本 完整列表
- 与OpenAI兼容的API
- 内置类似ChatGPT的用户界面
- 🔥 使用最先进的推理后端加速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:")