Anyscale
Anyscale 是一个通过生产就绪的 API 来运行、微调和扩展大型语言模型(LLM)的平台。 Anyscale Endpoints 以经济高效的方式提供多种开源模型服务。
Anyscale 还提供了 一个示例,
展示如何为高级聊天代理设置 LangChain 与 Anyscale。
安装与设置¶
- 获取 Anyscale 服务 URL、路由和 API 密钥,并将它们设置为环境变量(
ANYSCALE_SERVICE_URL、ANYSCALE_SERVICE_ROUTE、ANYSCALE_SERVICE_TOKEN)。 - 请参阅 Anyscale 文档 以获取更多详细信息。
我们需要安装 openai 包:
pip install openai
LLM
查看 使用示例。
from langchain_community.llms.anyscale import Anyscale
API 参考:Anyscale
聊天模型
查看 使用示例。
from langchain_community.chat_models.anyscale import ChatAnyscale
API 参考:ChatAnyscale
嵌入
查看 使用示例。
from langchain_community.embeddings import AnyscaleEmbeddings
API 参考:Anyscale 嵌入