Skip to main content
Open In Colab在 GitHub 上打开

OpenLLM

🦾 OpenLLM 允许开发人员使用单个命令将任何开源 LLM 作为与 OpenAI 兼容的 API 终端节点运行。

  • 🔬 为快速和生产用途而构建
  • 🚂 支持 llama3、qwen2、gemma 等,以及许多量化版本完整列表
  • ⛓️ OpenAI 兼容 API
  • 💬 内置类似 ChatGPT 的 UI
  • 🔥 使用最先进的推理后端加速 LLM 解码
  • 🌥️ 为企业级云部署做好准备(Kubernetes、Docker 和 BentoCloud)

安装

安装openllm通过 PyPI

%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:")