Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,24 @@ response = client.model_router.select_model(
print(response.providers)
```

#### Fine-grained cost/quality control

For more granular control over the cost-quality tradeoff, use `cost_quality_tradeoff` (0–10 scale):

```python
response = client.model_router.select_model(
llm_providers=[
{"model": "gpt-4o", "provider": "openai"},
{"model": "gpt-4o-mini", "provider": "openai"},
],
messages=[
{"role": "user", "content": "Summarize this article: ..."},
],
cost_quality_tradeoff=5, # 0 = pure quality (default), 10 = cheapest model
)
print(response.providers)
```

### Train Custom Router

For even better performance, you can train a custom router on your own dataset. This allows the router to learn the specific patterns and preferences of your use case:
Expand Down
Loading