Skip to main content

Generate embeddings for images and text using CLIP with LLM

Project description

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

llm-clip-0.1a0.tar.gz (2.7 kB view details)

Uploaded Source

Built Distribution

llm_clip-0.1a0-py3-none-any.whl (2.8 kB view details)

Uploaded Python 3

File details

Details for the file llm-clip-0.1a0.tar.gz.

File metadata

  • Download URL: llm-clip-0.1a0.tar.gz
  • Upload date:
  • Size: 2.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.5

File hashes

Hashes for llm-clip-0.1a0.tar.gz
Algorithm Hash digest
SHA256 7a33f8b00af7ec53cdfb3624514aaf56d4f7768e10bfba428bb0ea1a73f1edf0
MD5 bda6a6491995462963870f913cae37f9
BLAKE2b-256 ef9efd72167aaa5c9e9e374d201afd619737828b9d235e679ae6c8c640f6122d

See more details on using hashes here.

File details

Details for the file llm_clip-0.1a0-py3-none-any.whl.

File metadata

  • Download URL: llm_clip-0.1a0-py3-none-any.whl
  • Upload date:
  • Size: 2.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.5

File hashes

Hashes for llm_clip-0.1a0-py3-none-any.whl
Algorithm Hash digest
SHA256 db9e5bc9e3d6638a38582489c1bc34e6c5e8ca513373664cacb06d13c129c3b5
MD5 218ac6127d5bc79ee574c53fe5adc3c6
BLAKE2b-256 e9e222a95f1b3ec7929d628b13de30f10a0a204f9303b1ff8bd1993d59008564

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page