Skip to main content

llm-clip

PyPI Changelog Tests License

LLM plugin for embedding images and text using CLIP

Installation

Install this plugin in the same environment as LLM.

llm install llm-clip

Usage

Once you have installed an embedding model you can use it to embed text like this:

llm embed -m clip -c 'Hello world'

Or an image like this:

llm embed -m clip --binary -i IMG_4801.jpeg

Embeddings are more useful if you store them in a database - see the LLM documentation for details.

To embed every photograph in a folder and save them in a collection called "photos":

llm embed-multi photos -m clip --binary --files photos/ '*.jpg'

You can then search for photos of specific things like this:

llm similar photos -c 'bunny'

Development

To set up this plugin locally, first checkout the code. Then create a new virtual environment:

cd llm-clip
python3 -m venv venv
source venv/bin/activate

Now install the dependencies and test dependencies:

pip install -e '.[test]'

To run the tests:

pytest

Release files for llm-clip 0.1

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

Source distribution (sdist)

Source distribution for llm-clip 0.1
File Size Uploaded
llm-clip-0.1.tar.gz 6.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for llm-clip 0.1
File Interpreter ABI Platform
llm_clip-0.1-py3-none-any.whl Python 3 none any Details

Total release size: 13.5 kB

Release files / llm-clip-0.1.tar.gz

Download URL llm-clip-0.1.tar.gz
Size 6.6 kB
Tags Source
SHA-256 checksum
How to use checksums
fcd7efe71a55170b530c30dbf4088d8af80c72562dc85dbd6ec48324525dbb7e
BLAKE2b-256 checksum
How to use checksums
7beff16404d79cff379f3098ce95cbe205929a01dfa6b5946331fdfe7b0e4f53
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.5

Release files / llm_clip-0.1-py3-none-any.whl

Download URL llm_clip-0.1-py3-none-any.whl
Size 6.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
31bca3c6dd3e4df192a805ff7d44eb788ccf6d4f1cb8b078f28adc8a2d547e1d
BLAKE2b-256 checksum
How to use checksums
05512a9b1b753c8f127275ccbbc8ae3cc3bfd6af9882566542273583ad885369
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.5

Release history Release notifications | RSS feed

This release

0.1 This release

2 release files

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