Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
81552db
Documenting thirdparty langchain-localai reranker
mkhludnev Nov 4, 2025
d7b2086
Documenting thirdparty langchain-localai reranker
mkhludnev Nov 4, 2025
a8e01ed
Update src/oss/python/integrations/document_transformers/localai_rera…
mkhludnev Nov 4, 2025
9865331
Update src/oss/python/integrations/document_transformers/localai_rera…
mkhludnev Nov 4, 2025
c6036ca
Update src/oss/python/integrations/document_transformers/localai_rera…
mkhludnev Nov 5, 2025
4fa6335
Update src/oss/python/integrations/document_transformers/localai_rera…
mkhludnev Nov 5, 2025
dc08c6e
Update src/oss/python/integrations/document_transformers/localai_rera…
mkhludnev Nov 6, 2025
3131da4
Merge branch 'main' into localai-reranker
mkhludnev Nov 6, 2025
d3921ae
Update src/oss/python/integrations/document_transformers/localai_rera…
mkhludnev Nov 6, 2025
3eb2473
Update src/oss/python/integrations/document_transformers/localai_rera…
mkhludnev Nov 6, 2025
b287901
Merge branch 'main' into localai-reranker
mkhludnev Nov 6, 2025
728d80e
Merge branch 'main' into localai-reranker
mkhludnev Nov 11, 2025
54ed250
Merge branch 'main' into localai-reranker
mkhludnev Nov 14, 2025
f7317a5
Merge branch 'main' into localai-reranker
mkhludnev Nov 18, 2025
b887539
Merge branch 'main' into localai-reranker
mkhludnev Nov 19, 2025
7dbba4b
Merge branch 'main' into localai-reranker
mkhludnev Nov 25, 2025
06f8550
Apply suggestion from @mdrxy
mdrxy Nov 30, 2025
b90232b
Apply suggestion from @mdrxy
mdrxy Nov 30, 2025
499417d
Merge branch 'main' into localai-reranker
mdrxy Nov 30, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
---
title: LocalAI Reranker
---

<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>

This notebook shows how to use [LocalAI Reranker API](https://localai.io/features/reranker/) for document compression and retrieval.
Let's load the `LocalAIRerank` class. In order to use the `LocalAIRerank` class, you need to have the LocalAI service hosted somewhere and configure the reranker. See the documentation at [localai.io/basics/getting_started/index.html](https://localai.io/basics/getting_started/index.html) and [localai.io/features/reranker/index.html](https://localai.io/features/reranker/index.html).

```bash
pip install -U langchain-localai
```

```python
from langchain_localai import LocalAIRerank
from langchain_core.documents import Document

reranker = LocalAIRerank(
openai_api_key="foo",
model="bge-reranker-v2-m3",
openai_api_base="http://localhost:8080",
)
reranked_docs = reranker.compress_documents(documents=[
Document(page_content="bar"), Document(page_content="baz")], query="foo")
```
2 changes: 1 addition & 1 deletion src/oss/python/integrations/text_embedding/localai.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: LocalAI
title: LocalAI Embeddings
---

<Info>
Expand Down