Skip to main content
🦾 OpenLLM 让开发者能够通过单个命令将任意开源 LLM 作为兼容 OpenAI 的 API 端点运行。
  • 🔬 专为快速生产使用而构建
  • 🚂 支持 llama3、qwen2、gemma 等多种模型及多种量化版本(完整列表
  • ⛓️ 兼容 OpenAI 的 API
  • 💬 内置类 ChatGPT 界面
  • 🔥 通过最先进的推理后端加速 LLM 解码
  • 🌥️ 已为企业级云部署做好准备(支持 Kubernetes、Docker 和 BentoCloud)

安装

通过 PyPI 安装 openllm
pip install -qU  openllm

本地启动 OpenLLM 服务器

使用 openllm hello 命令启动 LLM 服务器:
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")
llm("To build a LLM from scratch, the following are the steps:")