Skip to main content
Open on GitHub

LocalAI

LocalAI is the free, Open Source OpenAI alternative. LocalAI act as a drop-in replacement REST API that’s compatible with OpenAI API specifications for local inferencing. It allows you to run LLMs, generate images, audio (and not only) locally or on-prem with consumer grade hardware, supporting multiple model families and architectures.

注意

为了确保正确兼容性,请确保您正在使用版本为 0.xopenai SDK。

信息

langchain-localai 是 LocalAI 的第三方集成包。它提供了一种简单的方法在 Langchain 中使用 LocalAI 服务。 源代码可以在 Github 上获取。

安装与设置

我们需要安装几个Python包:

pip install tenacity openai

嵌入模型

查看一个 使用示例

from langchain_localai import LocalAIEmbeddings