-
Notifications
You must be signed in to change notification settings - Fork 269
Closed
Description
Describe the bug
Ollama.rs is hard coded to use the /api/embed endpoint and expects a return formatted like
{
"embedding": [
0.5896830558776855,
0.2319980412721634,
-0.20815671980381012
// ... many more floating-point numbers
]
}
This is the expected response of the /api/embeddings endpoint, which Ollama has said is deprecated
The actual response from /api/embed is
{
"model": "nomic-embed-text",
"embeddings": [
[
0.034329344,
0.059441593,
-0.16081077,
"..."
]
],
"total_duration": 66893984,
"load_duration": 17070078,
"prompt_eval_count": 10
}
Official ollama docs https://docs.ollama.com/api#generate-embeddings
To Reproduce
Attempt to embed with api_type=cocoindex.LlmApiType.OLLAMA,
Expected behavior
Working embedding with native Ollama endpoint
Screenshots
[2025-10-27T16:05:30Z ERROR cocoindex_engine::execution::source_indexer] Error in processing row from flow `repo_embeddings` source `repo` with key: {"requirements.txt"}
Caused by:
0: Evaluating ForEach op `.for_each.0`
1: Evaluating in scope with key {"requirements.txt"}
2: Evaluating ForEach op `.for_each.1`
3: Evaluating in scope with key {[0, 345)}
4: Evaluating Transform op `embedding`
5: Invalid JSON
6: error decoding response body
7: missing field `embedding` at line 1 column 9601
CocoIndex Version
0.22.2
Additional context
Add any other context about the problem here.
badmonster0
Metadata
Metadata
Assignees
Labels
No labels