> ## Documentation Index
> Fetch the complete documentation index at: https://docs.langchain.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Localai integrations

> Integrate with Localai using LangChain Python.

> [LocalAI](https://localai.io/) 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.

<Info>
  `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](https://github.com/mkhludnev/langchain-localai)
</Info>

## Installation and setup

<CodeGroup>
  ```bash pip theme={"theme":{"light":"catppuccin-latte","dark":"catppuccin-mocha"}}
  pip install langchain-localai
  ```

  ```bash uv theme={"theme":{"light":"catppuccin-latte","dark":"catppuccin-mocha"}}
  uv add langchain-localai
  ```
</CodeGroup>

## Embedding models

See a [usage example](/oss/python/integrations/embeddings/localai).

## Reranker

See a [usage example](/oss/python/integrations/document_transformers/localai_rerank).

***

<div className="source-links">
  <Callout icon="terminal-2">
    [Connect these docs](/use-these-docs) to Claude, VSCode, and more via MCP for real-time answers.
  </Callout>

  <Callout icon="edit">
    [Edit this page on GitHub](https://github.com/langchain-ai/docs/edit/main/src/oss/python/integrations/providers/localai.mdx) or [file an issue](https://github.com/langchain-ai/docs/issues/new/choose).
  </Callout>
</div>
