zeroclaw-labs/zeroclaw · error

providers.models.ollama.{alias}.model uses ':cloud', but uri

Error message

providers.models.ollama.{alias}.model uses ':cloud', but uri is local or unset. Set uri to a remote Ollama endpoint (for example https://ollama.com).

What it means

For every [providers.models.ollama.<alias>] whose model name ends with ':cloud', the uri must not be unset, empty, or point at a local host (localhost, 127.0.0.1, ::1, 0.0.0.0 — is_local_ollama_endpoint, schema.rs:19363). The ':cloud' suffix routes requests to Ollama Cloud, so a local or unset endpoint contradicts the routing and would silently hit a local daemon that lacks the model. Non-cloud model names skip these checks entirely.

Source

Thrown at crates/zeroclaw-config/src/schema.rs:21671

                    .with_outcome(::zeroclaw_log::EventOutcome::Unknown)
                    .with_attrs(::serde_json::json!({"path": w.path, "code": w.code})),
                &format!("{}", w.message)
            );
        }

        // Ollama cloud-routing safety checks
        for (alias, cfg) in &self.providers.models.ollama {
            let entry = &cfg.base;
            if !entry
                .model
                .as_deref()
                .is_some_and(|model| model.trim().ends_with(":cloud"))
            {
                continue;
            }

            if is_local_ollama_endpoint(entry.uri.as_deref()) {
                anyhow::bail!(
                    "providers.models.ollama.{alias}.model uses ':cloud', but uri is local or unset. Set uri to a remote Ollama endpoint (for example https://ollama.com)."
                );
            }
            if is_official_ollama_cloud_endpoint(entry.uri.as_deref())
                && !has_ollama_cloud_credential(entry.api_key.as_deref())
            {
                anyhow::bail!(
                    "providers.models.ollama.{alias}.model uses ':cloud', but no API key is configured. Set api_key on [providers.models.ollama.{alias}] (or via the schema-mirror grammar: ZEROCLAW_providers__models__ollama__{alias}__api_key=<value>)."
                );
            }
        }

        // Microsoft 365
        if self.microsoft365.enabled {
            let tenant = self
                .microsoft365
                .tenant_id
                .as_deref()

View on GitHub (pinned to 88bb9c8533)

Solutions

  1. Set a remote Ollama endpoint on the failing alias: `uri = "https://ollama.com"`
  2. If you actually meant the local daemon, remove the ':cloud' suffix from model
  3. After setting the remote uri, also set api_key — the official ollama.com endpoint triggers the next credential check
  4. Check each alias separately; the loop reports one alias at a time

Example fix

# before
[providers.models.ollama.default]
model = "gpt-oss:cloud"
uri = "http://127.0.0.1:11434"

# after
[providers.models.ollama.default]
model = "gpt-oss:cloud"
uri = "https://ollama.com"
api_key = "<ollama-cloud-key>"
Defensive patterns

Strategy: validation

Validate before calling

fn is_local_host(uri: Option<&str>) -> bool {
    let Some(raw) = uri.map(str::trim).filter(|v| !v.is_empty()) else { return true; };
    reqwest::Url::parse(raw).ok()
        .and_then(|u| u.host_str().map(|h| h.to_ascii_lowercase()))
        .is_some_and(|h| matches!(h.as_str(), "localhost" | "127.0.0.1" | "::1" | "0.0.0.0"))
}

fn ollama_cloud_precheck(cfg: &zeroclaw_config::Config) -> Result<(), String> {
    for (alias, entry) in &cfg.providers.models.ollama {
        let cloud = entry.base.model.as_deref().is_some_and(|m| m.trim().ends_with(":cloud"));
        if cloud && is_local_host(entry.base.uri.as_deref()) {
            return Err(format!("alias {alias}: :cloud model with local/unset uri"));
        }
    }
    Ok(())
}

Type guard

fn cloud_model_has_remote_uri(model: Option<&str>, uri: Option<&str>) -> bool {
    !model.is_some_and(|m| m.trim().ends_with(":cloud")) || !is_local_host(uri)
}

Try / catch

if let Err(err) = config.validate() {
    if err.to_string().contains(":cloud") && err.to_string().contains("uri is local") {
        // set uri = "https://ollama.com" on the named alias, or drop the :cloud suffix
    }
}

Prevention

When it happens

Trigger: Add `model = "gpt-oss:cloud"` while leaving uri unset (treated as local), or keep `uri = "http://127.0.0.1:11434"` from an existing local setup after switching the model tag to a :cloud name.

Common situations: Trying Ollama Cloud on a machine that already runs the local daemon by only changing the model tag; shared alias templates that pre-fill the local URL; switching an alias between local and cloud without touching uri.

Related errors


AI-assisted analysis of zeroclaw-labs/zeroclaw@88bb9c8533 (2026-08-23). Data as JSON: /api/errors/2549c05b97cebf10. Report an issue: GitHub.