Cinnamon / kotaemon

An open-source RAG-based tool for chatting with your documents.
https://cinnamon.github.io/kotaemon/
Apache License 2.0
17.49k stars 1.35k forks source link

[BUG] Wrong ollama embedding endpoint #494

Open r0kk opened 1 week ago

r0kk commented 1 week ago

Description

Hi, I think you are calling the wrong endpoint for local embedding for ollama, if I use settings from your instructions here

From official ollama api documentation here it should be called: http://localhost:11434/api/embedd endpoint, but from koteamon it is called http://localhost:11434/api/embeddings

following works: curl http://localhost:11434/api/embedd -d '{ "model": "", "input": "Why is the sky blue?" }'

following does not: curl http://localhost:11434/api/embeddings-d '{ "model": "", "input": "Why is the sky blue?" }'

There is also a problem that on UI we don't get any notification about the issues and one has to look into the logs. It would be great if it could be a little bit more explicit.

Reproduction steps

1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

Screenshots

![DESCRIPTION](LINK.png)

Logs

No response

Browsers

No response

OS

No response

Additional information

No response

taprosoft commented 1 week ago

So the examples we used following Ollama OpenAI API specs https://github.com/ollama/ollama/blob/main/docs/openai.md#curl

Please use the Test connection feature to make sure the Ollama connection working properly for both LLM & embedding models.

r0kk commented 1 week ago

It worked before, but ollamachanged endpoints from /embeddings to /embed, so OpenAI client should not work anymore because it uses /embeddings. At least this is my understanding. Screenshot 2024-11-15 125451

The openAI client endpoint: Screenshot 2024-11-15 125809

Neurozone commented 1 week ago

Same issue here with ollama -v ollama version is 0.4.1 and kotaemon full docker image

arno4000 commented 4 days ago

+1

vap0rtranz commented 4 days ago

Is this just an issue with Ollama v0.4?

ollama -v
ollama version is 0.3.9

Call from within Kotaemon app docker runtime:

root@justin-two-towers:/app# curl localhost:11434/api/embeddings -d '{ "model": "llama3.1:8b", "input": "Why is the sky blue?" }'
{"embedding":[]}

Seems fine ...