pub async fn resolve_route<'a>(
requested: &'a str,
profiles: &'a [InferenceProfile],
catalog: &dyn ModelCatalogPort,
) -> ModelRoute<'a>Expand description
Resolve a requested model id into a ModelRoute.
Resolution order, first match wins:
- No
:in the id —ModelRoute::Bare, without touching the catalog. - The full id resolves in the catalog —
ModelRoute::Bare. A real model whose name contains a colon always beats a profile reading. - The suffix after the last
:matches a configured profile —ModelRoute::Profiled. - The base resolves in the catalog —
ModelRoute::ProfileNotFound. - Otherwise
ModelRoute::Bare, leaving the existing model-not-found path to report it.
Splitting on the last colon lets a colon-bearing model name still carry a
profile (qwen:27b:coding).
Catalog errors are treated as “not found” and logged: a degraded catalog should not turn into a hard failure on a request that may not need a profile at all.