simonw / llm-jina-api

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

Initial prototype #1

Open simonw opened 3 hours ago

simonw commented 3 hours ago

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

simonw commented 3 hours 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 3 hours ago

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

simonw commented 3 hours ago

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

simonw commented 3 hours ago

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

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