#How to configure multiple ollama servers (providers)

9 messages Β· Page 1 of 1 (latest)

eager sparrow
#

I have installed ollama on my gaming rig and want to use it as another ollama instance for Openclaw.

My existing instance is within my cluster and configured as:

"models": { "providers": { "ollama": { "baseUrl": "http://ollama.ai.svc.cluster.local:11434", "api": "ollama", "models":

Do I just add another baseUrl pointing to the gaming rig? Use the same ollama provider or does the provider name need to be unique?

round pythonBOT
vagrant zincBOT
#

To help others find answers, you can mark your question as solved via Right click solution message -> Apps -> βœ… Mark Solution

tidal carbonBOT
#

Yep, use separate provider IDs.

baseUrl is a single value, so for two Ollama servers you want two entries under models.providers, for example:

{
  models: {
    providers: {
      ollama-cluster: {
        baseUrl: "http://ollama.ai.svc.cluster.local:11434",
        apiKey: "ollama-local",
        api: "ollama",
        models: [
          // cluster models here
        ],
      },
#
      ollama-rig: {
        baseUrl: "http://gaming-rig:11434",
        apiKey: "ollama-local",
        api: "ollama",
        models: [
          // gaming rig models here
        ],
      },
    },
  },
}

A few important bits:

  • Provider key must be unique, it can be whatever you want, like ollama-rig.
#
  • Use model refs like:
    • ollama-cluster/llama3.3
    • ollama-rig/qwen2.5-coder:32b
  • Keep api: "ollama" so OpenClaw uses the native Ollama API
  • Do not use /v1 on the URL unless you intentionally want OpenAI-compat mode

One gotcha: once you define providers explicitly like this, you should define the models manually for each provider.

Docs:

If you want, I can sketch the full JSON5 for both providers with a couple of sample models.

eager sparrow
#

Nope. That's fine. I've got the structure of the existing models list that I can re-use.
Thanks very much. I'll mark as solved.

tidal carbonBOT
#

Perfect, that should do it. πŸ‘

And yep, please mark the solution so Answer Overflow picks it up:

right-click the solution message β†’ Apps β†’ βœ… Mark Solution

That helps future folks find it fast.