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

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 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
-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
    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”,
“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”:
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.

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!

hi @liang_nq !!

Can you try passing the header X-Ollama-BaseURL with the custom endpoint? I can see this in code but not documented.

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

Thanks!