# Query-time text2vec-ollama module ignores custom endpoint and always falls back to localhost:11434

**URL:** <https://forum.weaviate.io/t/query-time-text2vec-ollama-module-ignores-custom-endpoint-and-always-falls-back-to-localhost-11434/21423>\
**Category:** General\
**Tags:** bug\
**Created:** [June 17, 2025, 4:54pm UTC](https://forum.weaviate.io/t/query-time-text2vec-ollama-module-ignores-custom-endpoint-and-always-falls-back-to-localhost-11434/21423 "2025-06-17T16:54:14Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![liang\_nq](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.weaviate.io/liang_nq/32/7414_2.png) [@liang\_nq](https://forum.weaviate.io/u/liang_nq)\
**Post date:** [June 17, 2025, 4:54pm UTC](https://forum.weaviate.io/t/query-time-text2vec-ollama-module-ignores-custom-endpoint-and-always-falls-back-to-localhost-11434/21423/1 "2025-06-17T16:54:14Z")

</div>

**Description**  
I’m running Weaviate v1.30.8 in Docker Compose and hosting Ollama (BGE-M3) on my physical machine at 192.168.1.217:11434. Although embedding via Ollama works from the host, any query-time vectorization in Weaviate still tries to POST to [http://localhost:11434/api/embed](http://localhost:11434/api/embed) and fails with connection refused. Neither environment variables nor schema settings seem to take effect.

**Environment**

Weaviate version: v1.30.8 (Docker image semitechnologies/weaviate:latest)

Deployment: Docker Compose (bridge network), ports 8088:8080, 50051:50051

Ollama service: Running on host 192.168.1.217:11434, responds correctly to:

bash  
curl -X POST [http://192.168.1.217:11434/api/embed](http://192.168.1.217:11434/api/embed)  
-H ‘Content-Type: application/json’  
-d ‘{“model”:“bge-m3”,“input”:“test”}’  
**Client: Java SDK v5.2.1, using**

java  
.targetVectors(new String{ “title” })  
to trigger query-time embedding

**Docker Compose snippet**

yaml

services:  
weaviate:  
image: semitechnologies/weaviate:latest  
ports:

- “8088:8080”
- “50051:50051”  
volumes:
- /opt/weaviate/data:/var/lib/weaviate  
extra\_hosts:
- “host.docker.internal:host-gateway”  
environment:  
PERSISTENCE\_DATA\_PATH: “/var/lib/weaviate”  
ENABLE\_API\_BASED\_MODULES: “true”  
ENABLE\_MODULES: “text2vec-ollama,generative-ollama”  
DEFAULT\_VECTORIZER\_MODULE: “text2vec-ollama”  
TEXT2VEC\_OLLAMA\_API\_ENDPOINT: "[http://host.docker.internal:11434](http://host.docker.internal:11434/)  
CLUSTER\_HOSTNAME: “node1”  
command:
- –host
- “0.0.0.0”
- –port
- “8080”
- –scheme
- “http”
- –write-timeout
- “600s”

**Schema configuration (Java SDK)**  
java

List vectorizeProperties = List.of(“title”, “content”);  
WeaviateClass docClass = WeaviateClass.builder()  
.className(className)  
.vectorizer(“text2vec-ollama”)  
.moduleConfig(Map.of(  
“text2vec-ollama”, Map.of(  
“model”, “bge-m3”,  
“apiEndpoint”, “[http://host.docker.internal:11434](http://host.docker.internal:11434/)”,  
“vectorizeProperties”, vectorizeProperties  
)  
))  
.properties(List.of(docId, title, content, unit))  
.build();

client.schema().classCreator().withClass(docClass).run();

**Reproduction Steps**

Deploy Weaviate via the above Docker Compose.

Create schema with the above Java code.

Restart Weaviate:

Run a GraphQL query with .targetVectors(new String{ “title” }).

**Observed**  
WeaviateErrorMessage(…):  
remote client vectorize: send POST request:  
Post “[http://localhost:11434/api/embed](http://localhost:11434/api/embed)”:  
dial tcp 127.0.0.1:11434: connect: connection refused

**Expected**  
Weaviate should use one of these custom endpoints for query-time embedding instead of defaulting to localhost:11434:

Schema’s moduleConfig.text2vec-ollama.apiEndpoint

Environment variable like TEXT2VEC\_OLLAMA\_API\_ENDPOINT

**Additional Notes**

I have verified network connectivity from both host and container to [http://host.docker.internal:11434/api/embed](http://host.docker.internal:11434/api/embed).

No logs ever print my custom endpoint—Weaviate always seems unaware of it.

Please advise how to properly override the default embedding endpoint for query-time text2vec-ollama. Thank you!

---

<div class="post-metadata">

**Author:** ![DudaNogueira](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.weaviate.io/dudanogueira/32/7846_2.png) [@DudaNogueira](https://forum.weaviate.io/u/DudaNogueira)\
**Post date:** [June 17, 2025, 5:19pm UTC](https://forum.weaviate.io/t/query-time-text2vec-ollama-module-ignores-custom-endpoint-and-always-falls-back-to-localhost-11434/21423/2 "2025-06-17T17:19:15Z")

</div>

hi @liang_nq !!

Can you try passing the header `X-Ollama-BaseURL` with the custom endpoint? [I can see this in code](https://github.com/weaviate/weaviate/blob/a42a8f1830fb9a602280100c21390ef77ad23c25/modules/generative-ollama/clients/ollama.go#L153) but not documented.

Also, can you check if your collection config? It must follow the configuration you passed on creation.

Thanks!
