Compare models on the same application task
Host function: pass separately configured providers. Each iteration owns a fresh Agent so conversation or opaque provider continuation state is not carried between candidates. Live candidates require credentials and incur their own requests.Add an explicit fallback chain
Host factory: pass configured providers in preference order. The caller owns the returned Agent and closes it after its runs. Every fallback candidate needs the tools, modalities, and output contract required by the application.Route deliberately
Choose a provider before a new run when the host already knows the task type. Use ModelRouter when its routing rules fit the application. Measure answer quality and actual costs for each route; heuristics cannot establish that the cheapest tier is sufficient for every request. When changing providers, verify:
See reasoning, model types, and the individual integration guide for exact behavior. A shared
ModelProvider interface does not make provider capabilities identical.