Skip to main content

langchain-localai

This package contains the LangChain integration with LocalAI

Installation

pip install -U langchain-localai

Embeddings

LocalAIEmbeddings class exposes embeddings from LocalAI.

from langchain_localai import LocalAIEmbeddings

embeddings = LocalAIEmbeddings(
    openai_api_base="http://localhost:8080",
    model="embedding-model-name")
embeddings.embed_query("What is the meaning of life?")

Reranker

LocalAIRerank class exposes reranker from LocalAI.

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

Metadata

Release files for langchain-localai 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for langchain-localai 1.0.0
File Size Uploaded Provenance Actions
langchain_localai-1.0.0.tar.gz 6.3 kB Without provenance Details for langchain_localai-1.0.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for langchain-localai 1.0.0
File Interpreter ABI Platform Actions
langchain_localai-1.0.0-py3-none-any.whl Python 3 none any Details for langchain_localai-1.0.0-py3-none-any.whl

Total release size: 13.7 kB

Release files / langchain_localai-1.0.0.tar.gz

Download URL langchain_localai-1.0.0.tar.gz
Size 6.3 kB
Tags Source
SHA-256 checksum
How to use checksums
0c4be1263d3d2d87c0e68b7c4beae112657d253a3a05009f6b1b815eb45e0765
BLAKE2b-256 checksum
How to use checksums
c2a73c9b122629debf2458e3c9920e2ddfbf82782e6605c272ef5abb3bc1d4a0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Release files / langchain_localai-1.0.0-py3-none-any.whl

Download URL langchain_localai-1.0.0-py3-none-any.whl
Size 7.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4f2370783620614700639487613f84033d396d9160aded6af00bf6b0bea82c8a
BLAKE2b-256 checksum
How to use checksums
9703b81ccaed613573c0e56e62384994be4924b105323d5c0a8bfe077213d86c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Security for langchain-localai 1.0.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page