infer_provider_from_model_id

Function infer_provider_from_model_id 

Source
pub fn infer_provider_from_model_id(model_id: &str) -> Option<&'static str>
Expand description

Attempt to infer the provider a model id belongs to.

Returns None if the model id does not match any known provider prefix. Callers should treat None as “unknown” and generally allow it.

Known inferences:

  • grok-*"grok"
  • claude-*"anthropic"
  • gemini-*"gemini"
  • gpt-*, o1-*, o3-*, o4-*, o5-*, ft:gpt-*, codex-*"openai"