simonw / llm-jina-api

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

Initial prototype #1

Open simonw opened 2 months ago

simonw commented 2 months ago

Start with the jina-clip-v1-api model.

simonw commented 2 months ago

Jina API keys come with 1,000,000 free tokens. They charge about 2 cents per million tokens for more.

Images are charged at 1,000 tokens per 224x224 tile - I burned through the 1,000,000 token free trial with just a couple of images because I didn't resize them first!

Resizing to 896x896 before sending to the API uses a LOT less tokens - 16,000 per image. I've implemented that using Pillow.

simonw commented 2 months ago

I released this as an alpha, but there's a bunch of stuff I still need to do:

simonw commented 2 months ago

Full list of their current models: https://jina.ai/embeddings/

simonw commented 2 months ago

Some models have extra options, including query v.s. document for the Colbert ones:

CleanShot 2024-09-19 at 23 29 06@2x