OpenLLM
🦾 OpenLLM 让开发者能够通过一条命令将任何开源大语言模型(LLMs)作为与OpenAI兼容的API端点运行。
- 🔬 为快速和生产使用而构建
- 🚂 支持 llama3、qwen2、gemma 等,并且包含许多 量化版本 完整列表
- ⛓️ 开放API,兼容OpenAI
- 💬 内置的类似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:")