Text2vec ollama embedding error

after modified the weaviate module in docker envs with text2vec-ollama then tried collection quering then errors happen as following:

vectorize params: vectorize params: vectorize params: vectorize keywords: remote client vectorize: send POST request: Post "http://localhost:11434/api/embeddings\“: dial tcp 127.0.0.1:11434: connect: connection refused”}"
if with local ollama embedding vectorizer working code example we will be greatly appreciated.
any idea ?

Hi @zhou_yangbo !

I have just published this ollama recipe:

Note the part:

Below we use http://localhost:11434 for calling ollama models.

As we are using Weaviate Embedded instead of Docker, and we assume here your ollama instalation is on the host, we should call ollama, from Weaviate, at http://localhost:11434

If your are running Weaviate as a docker container, the api_endpoint must be http://host.docker.internal:11434.

yes , and what I did is only copy pasted your codebase , then post to ollama embedding get response , then followed Building a Local RAG System for Privacy Preservation with Ollama and Weaviate | Weaviate - Vector Database to do near vector querying , then errors happen as following: grpc._channel._InactiveRpcError: <_InactiveRpcError of RPC that terminated with:
###nearVector queried results: QueryReturn(objects=)
###queried response: QueryReturn(objects=)
Traceback (most recent call last):
File “/Users/yangboz/anaconda3/envs/py311/lib/python3.11/site-packages/weaviate/collections/grpc/query.py”, line 649, in __call
res, _ = self._connection.grpc_stub.Search.with_call(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/Users/yangboz/anaconda3/envs/py311/lib/python3.11/site-packages/grpc/_channel.py”, line 1198, in with_call
return _end_unary_response_blocking(state, call, True, None)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/Users/yangboz/anaconda3/envs/py311/lib/python3.11/site-packages/grpc/_channel.py”, line 1006, in _end_unary_response_blocking
raise _InactiveRpcError(state) # pytype: disable=not-instantiable

status = StatusCode.UNKNOWN
details = “explorer: get class: vectorize params: vectorize params: vectorize params: vectorize keywords: remote client vectorize: send POST request: Post “http://localhost:11434/api/embeddings”: dial tcp 127.0.0.1:11434: connect: connection refused”
debug_error_string = “UNKNOWN:Error received from peer {grpc_message:“explorer: get class: vectorize params: vectorize params: vectorize params: vectorize keywords: remote client vectorize: send POST request: Post "http://localhost:11434/api/embeddings\”: dial tcp 127.0.0.1:11434: connect: connection refused”, grpc_status:2, created_time:“2024-05-31T14:41:52.814425+08:00”}"

any idea? thanks

I just stumbled on to this after making my own post. I think I’m seeing the same issue. Ollama API is listening on /api/embed not /api/embeddings/

Check out my post for context: Text2vec ollama embedding error - #3 by zhou_yangbo

Sadly I don’t have a fix for it yet

I made a Github issue for this: text2vec_ollama takes api_endpoint but has wrong path appended · Issue #1394 · weaviate/weaviate-python-client · GitHub