openclaw - ๐Ÿ’ก(How to fix) Fix [Feature]: Support multiple Ollama hosts by decoupling provider keys from API types [1 participants]

Official PRs (โ€ฆ)
ON THIS PAGE

Recommended Tools

ร—6

Utilities matched from this issueโ€™s tags and category โ€” try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful ยท Quick feedback

Loadingโ€ฆ
GitHub stats
openclaw/openclaw#70249โ€ขFetched 2026-04-23 07:27:16
View on GitHub
Comments
0
Participants
1
Timeline
1
Reactions
0
Author
Participants
Timeline (top)
labeled ร—1

Allow multiple provider instances to use the api: "ollama" driver by decoupling the provider's unique ID from its API implementation type.

Error Message

Any custom key (like ollama-cpu) results in a No API provider registered error, even if api: "ollama" is specified. This forces a "one size fits all" approach to local LLM hosting which is inefficient for mixed-workload environments. Current Error Log (Representative): Error: No API provider registered for api: ollama-cpu

Root Cause

Current Error Log (Representative): Error: No API provider registered for api: ollama-cpu (Note: This occurs even when the sub-field api: ollama is correctly set, because the registry keys off the parent name.)

Code Example

providers:
  ollama-cpu: # Unique ID
    api: ollama # Driver lookup
    baseUrl: http://192.168.1.10:11434
  ollama-gpu: # Unique ID
    api: ollama # Driver lookup
    baseUrl: http://192.168.1.50:11434
RAW_BUFFERClick to expand / collapse

Summary

Allow multiple provider instances to use the api: "ollama" driver by decoupling the provider's unique ID from its API implementation type.

Problem to solve

Currently, OpenClaw appears to use the top-level provider key as the lookup mechanism for the API driver. This creates a 1:1 mapping constraint where only one Ollama instance can be registered.

Users with distributed setups (e.g. a low-power CPU host for light tasks and a powerful GPU host for heavy inference) cannot target these machines independently within OpenClaw.

Any custom key (like ollama-cpu) results in a No API provider registered error, even if api: "ollama" is specified. This forces a "one size fits all" approach to local LLM hosting which is inefficient for mixed-workload environments.

Proposed solution

Modify the provider factory/initialization logic to use the api field to resolve the driver, while preserving the provider key as a unique instance identifier.

providers:
  ollama-cpu: # Unique ID
    api: ollama # Driver lookup
    baseUrl: http://192.168.1.10:11434
  ollama-gpu: # Unique ID
    api: ollama # Driver lookup
    baseUrl: http://192.168.1.50:11434

The system should instantiate the OllamaProvider class (or equivalent) for every entry where api: "ollama" is found, passing the specific baseUrl and other parameters from that specific configuration block to the instance.

Alternatives considered

  • External Proxy (e.g. LiteLLM): Adding a proxy layer to multiplex the requests. Why it's weaker: It adds unnecessary infrastructure complexity, increased latency, and a new point of failure for a feature that is already standard for other provider types (like OpenAI).

  • Environment Variable Swapping: Manually changing the OLLAMA_HOST before startup. Why it's weaker: It prevents concurrent access to both hosts and requires manual intervention/restarts.

Impact

Affected users/systems: Users running multi-node local LLM setups or those transitioning between edge devices and workstation GPUs.

Severity: Blocks workflow. It prevents the architectural goal of offloading small tasks (heartbeats/summaries) to efficient hardware while reserving GPUs for complex queries.

Frequency: Always. The limitation is hard-coded into the current registration logic.

Consequence: Extra manual work (swapping configs), unnecessary power consumption (running small models on big GPUs), or forced adoption of complex third-party proxy tools.

Evidence/examples

Current Error Log (Representative): Error: No API provider registered for api: ollama-cpu (Note: This occurs even when the sub-field api: ollama is correctly set, because the registry keys off the parent name.)

This behavior is inconsistent with how openai-completions is handled in OpenClaw and other similar frameworks, where the api type defines the logic and the key defines the instance.

Additional information

This change would significantly improve OpenClaw's utility in home lab environments where hardware heterogeneity is common. Decoupling the ID from the Driver is a standard pattern that would make the provider system more robust for future plugins as well.

extent analysis

TL;DR

Modify the provider factory/initialization logic to use the api field for driver lookup, allowing multiple instances with unique IDs to use the same API driver.

Guidance

  • Update the provider registration logic to instantiate the OllamaProvider class for each configuration entry with api: "ollama", passing the specific baseUrl and other parameters to the instance.
  • Verify that the new logic correctly resolves the driver using the api field, rather than the top-level provider key.
  • Test the updated system with multiple provider instances using the same API driver, ensuring that each instance is correctly instantiated and functions as expected.
  • Review the configuration examples provided, such as the providers block with ollama-cpu and ollama-gpu instances, to ensure that the updated logic supports this use case.

Example

providers:
  ollama-cpu:
    api: ollama
    baseUrl: http://192.168.1.10:11434
  ollama-gpu:
    api: ollama
    baseUrl: http://192.168.1.50:11434

This example demonstrates how multiple provider instances can be defined with unique IDs (ollama-cpu and ollama-gpu) while using the same API driver (ollama).

Notes

The proposed solution aims to decouple the provider's unique ID from its API implementation type, allowing for more flexibility in configuring multiple provider instances. This change should improve the utility of OpenClaw in home lab environments with heterogeneous hardware.

Recommendation

Apply the proposed workaround by modifying the provider factory/initialization logic to use the api field for driver lookup. This change should enable multiple provider instances to use the same API driver, improving the overall functionality of OpenClaw in mixed-workload environments.

Vote matrix ยท Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loadingโ€ฆ

Still need to ship something?

ร—6

Another batch ranked right after the header list โ€” different links, same matching logic.

Back to top recommendations

TRENDING

openclaw - ๐Ÿ’ก(How to fix) Fix [Feature]: Support multiple Ollama hosts by decoupling provider keys from API types [1 participants]