LangChain embeddings that run on the Apple Neural Engine, via ANEForge (no CoreML).
Project description
langchain-aneforge
LangChain embeddings that run on the Apple Neural Engine, via ANEForge. The encoder runs on the ANE with no CoreML, matching the fp32 reference to cosine ~1.0 at a fraction of the GPU's energy.
pip install langchain-aneforge
Apple Silicon macOS only (ANEForge reaches the engine through a built dispatch shim; see the ANEForge install notes).
Use
from langchain_aneforge import ANEEmbeddings
emb = ANEEmbeddings(model="sentence-transformers/all-MiniLM-L6-v2")
vec = emb.embed_query("the Apple Neural Engine runs networks at low power")
docs = emb.embed_documents(["one passage", "another passage"])
ANEEmbeddings is a standard langchain_core.embeddings.Embeddings, so it drops
into any LangChain retriever or vector store:
from langchain_community.vectorstores import FAISS
store = FAISS.from_texts(["...", "..."], ANEEmbeddings())
hits = store.similarity_search("query", k=3)
model is any BERT-family sentence encoder on the Hugging Face hub. Its pooling
mode and normalize flag are read from the model's own sentence-transformers config,
so mean-pooled (MiniLM, E5) and cls-pooled (BGE, GTE) models both produce correct
vectors. Pass int8=True to stream int8 weights (half the size, cosine ~0.9999).
License
MIT. Not affiliated with or endorsed by Apple or LangChain.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file langchain_aneforge-0.1.0.tar.gz.
File metadata
- Download URL: langchain_aneforge-0.1.0.tar.gz
- Upload date:
- Size: 3.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
011bfbfc6265e5b7eca2690f61dd87f9da3c704950d7e077cffec6dba5f11bfd
|
|
| MD5 |
34d35daaa671d51d21176134c3df600a
|
|
| BLAKE2b-256 |
50f8e51817890745862db1177bde38677c803bf25566267fe782807282ff0c3b
|
Provenance
The following attestation bundles were made for langchain_aneforge-0.1.0.tar.gz:
Publisher:
publish.yml on sbryngelson/langchain-aneforge
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
langchain_aneforge-0.1.0.tar.gz -
Subject digest:
011bfbfc6265e5b7eca2690f61dd87f9da3c704950d7e077cffec6dba5f11bfd - Sigstore transparency entry: 1933305194
- Sigstore integration time:
-
Permalink:
sbryngelson/langchain-aneforge@e1a0da2e60b35d535845f33eec550b6d5db3a947 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/sbryngelson
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@e1a0da2e60b35d535845f33eec550b6d5db3a947 -
Trigger Event:
release
-
Statement type:
File details
Details for the file langchain_aneforge-0.1.0-py3-none-any.whl.
File metadata
- Download URL: langchain_aneforge-0.1.0-py3-none-any.whl
- Upload date:
- Size: 4.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e55d1c442a111296b4bac6fe414555b5955625d3579d7980236c4928f31e0e88
|
|
| MD5 |
4b696e5b226cce1810ed891407ed3f0b
|
|
| BLAKE2b-256 |
596fe5b45847f60ad69460fc1644c9a129285c45d5786d48c4e54b95b0910fbd
|
Provenance
The following attestation bundles were made for langchain_aneforge-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on sbryngelson/langchain-aneforge
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
langchain_aneforge-0.1.0-py3-none-any.whl -
Subject digest:
e55d1c442a111296b4bac6fe414555b5955625d3579d7980236c4928f31e0e88 - Sigstore transparency entry: 1933305257
- Sigstore integration time:
-
Permalink:
sbryngelson/langchain-aneforge@e1a0da2e60b35d535845f33eec550b6d5db3a947 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/sbryngelson
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@e1a0da2e60b35d535845f33eec550b6d5db3a947 -
Trigger Event:
release
-
Statement type: