Skip to main content
GoModel can register multiple Ollama providers through suffixed environment variables. Flow: Client -> GoModel -> ollama-a / ollama-b

1. Run GoModel with multiple Ollama base URLs

OLLAMA_A_BASE_URL registers provider ollama-a. OLLAMA_B_BASE_URL registers provider ollama-b. Use different ports or hostnames for each Ollama instance.
On Linux, you may need to add --add-host=host.docker.internal:host-gateway so the container can reach Ollama running on the host.
Use YAML only when generated provider names such as ollama-a and ollama-b are not enough or you need a larger structured provider block.

2. Verify the model registry

Expected model IDs will be provider-qualified, for example:
  • ollama-a/llama3.2
  • ollama-b/llama3.2

3. Route to a specific Ollama backend

If you send only the bare model name such as llama3.2 and both providers expose it, GoModel will route the request to one provider based on provider registration order. To choose a specific Ollama backend, use the qualified form such as ollama-a/llama3.2 or ollama-b/llama3.2.

4. When YAML still makes sense

Use config.yaml when you need custom provider names, per-provider resilience overrides, or a larger structured config:
This pattern relies on the same suffixed env auto-discovery used across GoModel providers: OLLAMA_A_BASE_URL registers ollama-a, and OLLAMA_B_BASE_URL registers ollama-b.