requested_model_hint (src/model_selection.rs)

ironclaw · crates/contracts/ironclaw_common/src/model_selection.rs · rust · Apache-2.0
ai

Utility to map a client model string to an optional concrete model hint, filtering out default sentinel.

// Source: https://github.com/nearai/ironclaw | License: Apache-2.0 | Copyright 2026 NEAR AI
// Provided via justclaw.it.com; keep this notice with the code.
//! Caller-requested model-selection helpers shared across API surfaces
//! (OpenAI-compatible API, WebChat v2).

/// The alias every client may send to mean "use the server's active/default
/// model" rather than naming a concrete one. The models listing advertises it,
/// so it is not a routable model id.
const DEFAULT_MODEL_ALIAS: &str = "default";

/// Map a client `model` string to an optional caller-requested model *hint* for
/// turn routing.
///
/// Returns `None` for the [`DEFAULT_MODEL_ALIAS`] sentinel (and, defensively,
/// for empty/whitespace), so a client asking for the server default does not
/// pin an advisory route t

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key