Skip to main content
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.
langchain-localai is a 3rd party integration package for LocalAI. It provides a simple way to use LocalAI services in LangChain. The source code is available on GitHub

Installation and Setup

pip install langchain-localai

Embedding models

See a usage example.

Reranker

See a usage example.
Connect these docs programmatically to Claude, VSCode, and more via MCP for real-time answers.