simonw / llm-jina-api

Access Jina AI embeddings via their API
Apache License 2.0
2 stars 0 forks source link

llm-jina-api

PyPI Changelog Tests License

Access Jina AI embeddings via their API

Installation

Install this plugin in the same environment as LLM.

llm install llm-jina-api

Usage

The plugin adds an embedding model called jina-clip-v1-api. You'll need to set an API key first:

llm keys set jina
# paste API key here

Follow the LLM documentation using jina-clip-v1-api as the model name. For example:

llm embed -m jina-clip-v1-api -c 'pelican'

# To embed an image file:
llm embed --binary -m jina-clip-v1-api -i pelican.jpg

Development

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

cd llm-jina-api
python -m venv venv
source venv/bin/activate

Now install the dependencies and test dependencies:

llm install -e '.[test]'

To run the tests:

python -m pytest