Skip to main content

parse_model_string

Function parse_model_string 

Source
pub fn parse_model_string(s: &str) -> (Option<&str>, &str)
Expand description

Parse a model string into (provider, model).

Supports:

  • provider/model → (provider, model)
  • nested provider namespaces like openai-codex/gpt-5.4
  • OpenRouter-style paths like openrouter/openai/gpt-5-codex

For three-or-more path segments, the first segment is the provider and the remainder is the model ID.