跳到主要内容
Open on GitHub

Anyscale

Anyscale 是一个平台,可以通过生产就绪的 API 运行、微调和扩展 LLM。Anyscale 端点以经济高效的方式提供许多开源模型。

Anyscale 还提供一个示例,说明如何设置 LangChainAnyscale 以用于高级聊天代理。

安装与设置

  • 获取 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 参考:AnyscaleEmbeddings