Routing
The platform selects the actual upstream based on the group, model, weight, priority, availability status, and failure retry strategy.
Routing Process
- The platform reads the Token, user group, and model name from the request.
- It filters channels that are available to the current group, include the model, and have a normal status.
- It selects a channel based on priority, weight, rate limits, and health status.
- It converts the request format according to the channel type and forwards it to the upstream.
- It records logs, usage, errors, and necessary retry results.
How to Determine Whether Routing Is Correct
- Seeing a model in the model list only indicates that the current Token has permission to view it; it does not mean that every channel can call it.
- The actual channel, model mapping, and upstream status in the request logs are the basis for determining the routing result.
- The latency, billing, tool calls, and error formats of the same model may differ across channels.
- If all channels are unavailable, a 503 or an upstream-related error is usually returned. If only a certain model is unavailable, first check the model list and the channel's Models configuration.
When troubleshooting routing, record the model name, user group, Token name, Request ID, actual channel, and failure time. Do not determine the cause solely based on the “model does not exist” message displayed by the client.
