Overview
Use@edenai as the model name to let the router automatically select the best available model. You can optionally provide router_candidates to restrict selection to a specific pool.
Related documentation:
- Router Getting Started - Core routing concepts and basics
- Router Advanced Usage - Advanced patterns and optimization
Basic Usage
Let the system choose from all available models:Python
Custom Candidate Pool
Restrict routing to a specific set of models usingrouter_candidates:
Python
Use Case Reference
| Use Case | Recommended Candidates | Notes |
|---|---|---|
| General chat | gpt-4o, claude-sonnet-4-5, gemini-2.5-flash | Balanced quality/cost |
| Code generation | gpt-4o, claude-sonnet-4-5 | Strong coding models |
| Creative writing | claude-opus-4-5, gpt-4o, gemini-2.5-pro | Premium models |
| Simple Q&A | gpt-4o-mini, gemini-2.5-flash, claude-haiku-4-5 | Fast and cheap |
| Function calling | gpt-4o, claude-sonnet-4-5, gemini-2.5-flash | Tool-compatible |
Next Steps
- Streaming Guide - Handle SSE responses