tinyhumansai/openhuman · error · anyhow::Error

[chat-factory] provider string '{p}' has an empty model — us

Error message

[chat-factory] provider string '{p}' has an empty model — use '{form}'

What it means

Generic factory guard: a recognized provider prefix was matched, but the model segment of the provider string is empty, so the formatted 'form' hint in the message tells the user the expected '<prefix>:<model>' shape. Thrown during chat-model construction after access gates pass.

Source

Thrown at src/openhuman/inference/provider/factory.rs:1730

        return Some(Err(e));
    }
    if require_session {
        #[cfg(not(test))]
        if let Err(e) = verify_session_active(config) {
            return Some(Err(e));
        }
    }

    // Egress spine (privacy epic S2, #4436): committed to a local runtime here
    // (past the non-local `None` return + access gates). Disclose it as
    // NON-external — local inference never leaves the device, so
    // `emit_external_transfer` records it without firing a pending event. This
    // is the single local chokepoint for every ChatModel/turn entry.
    emit_inference_egress(role, &p);

    let unsupported = config.temperature_unsupported_models.clone();
    let empty_model_err = |p: &str, form: &str| {
        anyhow::anyhow!("[chat-factory] provider string '{p}' has an empty model — use '{form}'")
    };

    // Resolve the local `api_key` + auth style shared by lmstudio/omlx/local-openai
    // (Bearer when a key is configured, else no auth — same as the host builders).
    let keyed_auth = || {
        let api_key = config.local_ai.api_key.as_deref().unwrap_or("").to_string();
        let auth = if api_key.trim().is_empty() {
            CompatAuthStyle::None
        } else {
            CompatAuthStyle::Bearer
        };
        (api_key, auth)
    };
    // First env override, else `local_ai.base_url`, else the profile default.
    let env_or_config_url = |env: &str, default: &str| {
        std::env::var("OPENHUMAN_LOCAL_INFERENCE_URL")
            .ok()
            .filter(|s| !s.trim().is_empty())

View on GitHub (pinned to 7491200858)

Solutions

  1. Rewrite the provider string in the shape shown in the error message, supplying a concrete model id after the prefix
  2. Verify the role's provider field was not truncated or hand-edited in config.toml
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at src/openhuman/inference/provider/factory.rs:1730 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of tinyhumansai/openhuman@7491200858 (2026-08-17). Data as JSON: /api/errors/cf50658edf3b4ea5. Report an issue: GitHub.