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
Wrapper
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 Reference:OpenLLM
llm("To build a LLM from scratch, the following are the steps:")
Related
- LLM conceptual guide
- LLM how-to guides