Skip to content

Ollama auto-discovery fails: schema requires baseUrl+models[] but docs describe apiKey-only env var mode #22836

@13Guinness

Description

@13Guinness

Description

When trying to enable Ollama auto-discovery using only OLLAMA_API_KEY environment variable (as described in docs), the config schema validator rejects any models.providers.ollama entry that doesn't include both baseUrl and models[].

Steps to reproduce

  1. Set OLLAMA_API_KEY=ollama-local in gateway plist EnvironmentVariables
  2. Do NOT define models.providers.ollama in openclaw.json (as docs recommend for auto-discovery)
  3. Run openclaw models list — Ollama models do not appear
  4. Try openclaw config set models.providers.ollama.apiKey "ollama-local"

Error

Error: Config validation failed:
- models.providers.ollama.baseUrl: Invalid input: expected string, received undefined
- models.providers.ollama.models: Invalid input: expected array, received undefined

What docs say

From /providers/ollama docs:

OpenClaw can auto-discover tool-capable models when you opt in with OLLAMA_API_KEY (or an auth profile) and do not define an explicit models.providers.ollama entry.

The simplest way to enable Ollama is via environment variable:

export OLLAMA_API_KEY="ollama-local"

What actually happens

The schema validator requires baseUrl and models[] whenever models.providers.ollama is defined at all — but the env-var-only path (no config entry) also fails to trigger auto-discovery.

Environment

Expected behavior

Setting OLLAMA_API_KEY=ollama-local in the gateway environment should be sufficient to trigger auto-discovery and surface Ollama models in openclaw models list without requiring any config file changes.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions