llm-nomic-api-embed
Create embeddings using the Nomic API
Installation
Install this plugin in the same environment as LLM.
llm install llm-nomic-api-embed
Usage
This plugin requires a Nomic API key. These include a generous free allowance for their embedding API.
Configure the key like this:
llm keys set nomic
# Paste key here
You can then use the Nomic embedding models like this:
llm embed -m nomic-1.5 -c 'hello world'
This will return a 768 item floating point array as JSON.
See the LLM embeddings documentation for more you can do with the tool.
Models
Run llm embed-models for a full list. The Nomic models are:
nomic-embed-text-v1 (aliases: nomic-1)
nomic-embed-text-v1.5 (aliases: nomic-1.5)
nomic-embed-text-v1.5-512 (aliases: nomic-1.5-512)
nomic-embed-text-v1.5-256 (aliases: nomic-1.5-256)
nomic-embed-text-v1.5-128 (aliases: nomic-1.5-128)
nomic-embed-text-v1.5-64 (aliases: nomic-1.5-64)
nomic-embed-vision-v1
nomic-embed-vision-v1.5
nomic-embed-combined-v1
nomic-embed-combined-v1.5
Vision models can be used with image files using the --binary option, for example:
llm embed-multi images --files . '*.png' \
--binary --model nomic-embed-vision-v1.5
Combined vision and text models
The nomic-embed-combined-v1 and nomic-embed-combined-v1.5 models are special - they will automatically use their respective text models for text inputs and their respective vision models for images.
This means you can use them to create a collection that mixes images and text, or you can create an image collection with them and then use text to find similar images.
Here's how do do that for a photos/ directory full of JPEGs:
llm embed-multi --binary -m nomic-embed-combined-v1.5 \
-d photos.db photos --files photos/ '*.jpeg'
Then run similarity searches like this:
llm similar photos -d photos.db -c pelican
Development
To set up this plugin locally, first checkout the code. Then create a new virtual environment:
cd llm-nomic-api-embed
python3 -m venv venv
source venv/bin/activate
Now install the dependencies and test dependencies:
llm install -e '.[test]'
To run the tests:
pytest
Metadata
Release files for llm-nomic-api-embed 0.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| llm_nomic_api_embed-0.3.tar.gz | 8.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| llm_nomic_api_embed-0.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 16.3 kB
Release files / llm_nomic_api_embed-0.3.tar.gz
| Download URL | llm_nomic_api_embed-0.3.tar.gz |
|---|---|
| Size | 8.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
96729b3fbcfbc925b62208d55d38ca7850063cb96a81911ee0a73b21aff8699b
|
|
BLAKE2b-256 checksum How to use checksums |
73aaa39f0dde114ad184c841ddfee26a2ab387b4cae162a5bc46a67ae1080391
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/5.1.1 CPython/3.12.7
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 21, 2024.
Transparency logRelease files / llm_nomic_api_embed-0.3-py3-none-any.whl
| Download URL | llm_nomic_api_embed-0.3-py3-none-any.whl |
|---|---|
| Size | 8.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c7046739761cfb4058e3fcc19acf56612ff71631dde5cd774377ba298495a05f
|
|
BLAKE2b-256 checksum How to use checksums |
2af6309ac014bc8812956d5275941a73a29d33ed4fb2385183bd954a1dcacbe9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/5.1.1 CPython/3.12.7
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 21, 2024.
Transparency log