langchain-kjarni
LangChain integration for Kjarni: local embeddings in your own process, with no PyTorch, no ONNX Runtime, no GPU and no server.
Kjarni produces the same vectors as sentence-transformers for the same model. The model downloads once on first use and is cached; after that everything works offline.
Install
pip install -U langchain-kjarni
Embeddings
from langchain_kjarni import KjarniEmbeddings
embeddings = KjarniEmbeddings(model="minilm-l6-v2")
embeddings.embed_query("What is the capital of Iceland?") # 384 floats
embeddings.embed_documents(["Reykjavik", "Akureyri"]) # 2 x 384
Use it anywhere LangChain takes an Embeddings, for example a vector store:
from langchain_core.vectorstores import InMemoryVectorStore
store = InMemoryVectorStore.from_texts(
["Reykjavik is the capital of Iceland", "Paris is the capital of France"],
embedding=embeddings,
)
store.similarity_search("Icelandic capital", k=1)
| Setting | Default | |
|---|---|---|
model |
"minilm-l6-v2" |
Any Kjarni embedding model, e.g. mpnet-base-v2, bge-m3 (multilingual). kjarni model list shows all. |
device |
"cpu" |
"gpu" runs on Vulkan, Metal or DirectX 12. |
batch_size |
32 |
Texts per call from embed_documents. |
query_prefix, document_prefix |
"" |
For models trained with prefixes, e.g. "query: " and "passage: " for E5. |
cache_dir |
Kjarni's cache | Where models are stored. |
The model loads on first use, so constructing KjarniEmbeddings is free.
Example
examples/rag_without_pytorch.ipynb builds a small retrieval pipeline and measures the install size, the vectors against sentence-transformers, and the speed.
License
MIT
langchain-kjarni
langchain-kjarni
Metadata
Release files for langchain-kjarni 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| langchain_kjarni-0.1.0.tar.gz | 13.5 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| langchain_kjarni-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 18.9 kB
Release files / langchain_kjarni-0.1.0.tar.gz
| Download URL | langchain_kjarni-0.1.0.tar.gz |
|---|---|
| Size | 13.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
56a844328a41509c16302736639c5731a44c58da75be88c3bb3a8c4a3273976f
|
|
BLAKE2b-256 checksum How to use checksums |
76ba5f261e86e9ce521ad276c57492a690f29ee2ad0819ce8594cf716e512d0b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.7
|
Release files / langchain_kjarni-0.1.0-py3-none-any.whl
| Download URL | langchain_kjarni-0.1.0-py3-none-any.whl |
|---|---|
| Size | 5.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
bbd1e72d4fa449761566046102d1b01d274d342142363a3494f01c64cc1ef6d5
|
|
BLAKE2b-256 checksum How to use checksums |
1829b06f176e600253b9e52deace95700132714d85300eeb8b9a84780fd3256c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.7
|
Security for langchain-kjarni 0.1.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.