models.yaml file acts as the internal DNS for your gateway. It maps the model names requested by your clients to the specific upstream providers capable of fulfilling them.
File Structure
Directives
providers: An array of provider names (these exact names must match your.conffiles in theprovidersdirectory).strategy: The load balancing strategy relative to the configured providers. Currently,round_robinis supported by default.owned_by: (Optional) Overrides the internal owner metadata reported when querying/v1/models.
Routing Flow and Priority
When a request arrives at ONR, the gateway must determine which provider’s DSL to execute. It selects the upstream based on this strict priority:- Forced Override (Highest): If the client explicitly maps a provider via the
x-onr-providerHTTP header. - Model Registry Matching: Iterating through your
models.yamldictionary to find a matching model string. - Round Robin Execution: If the chosen model lists multiple providers, ONR will load-balance the requests across the array uniformly per request.