Skip to content

Add full OpenRouter provider preferences schema#5172

Open
socathi wants to merge 1 commit intolivekit:mainfrom
socathi:feat/openrouter-full-provider-preferences
Open

Add full OpenRouter provider preferences schema#5172
socathi wants to merge 1 commit intolivekit:mainfrom
socathi:feat/openrouter-full-provider-preferences

Conversation

@socathi
Copy link

@socathi socathi commented Mar 20, 2026

Summary

  • Expand OpenRouterProviderPreferences to cover the complete OpenRouter provider routing API
  • Add OpenRouterSortOption for advanced sorting with partition (partition: "model" | "none")
  • Add OpenRouterPercentiles for performance threshold fields (p50/p75/p90/p99)
  • Add OpenRouterMaxPrice with typed pricing fields (prompt, completion, request, image)
  • Add missing provider preference fields: preferred_min_throughput, preferred_max_latency, zdr, enforce_distillable_text
  • Type quantizations with specific literal values instead of list[str]

Test plan

  • ruff check --fix passes
  • ruff format passes
  • mypy passes (no new errors; 54 pre-existing errors unrelated to this change)
  • Type-only change (TypedDicts) — no runtime behavior to test

Expand OpenRouterProviderPreferences to cover the complete OpenRouter
provider routing API including advanced sorting with partition,
performance thresholds, and pricing controls.

New types:
- OpenRouterSortOption: advanced sorting with partition support
- OpenRouterPercentiles: p50/p75/p90/p99 performance thresholds
- OpenRouterMaxPrice: typed pricing fields (prompt, completion, request, image)

New fields on OpenRouterProviderPreferences:
- preferred_min_throughput / preferred_max_latency (float or percentiles)
- zdr (Zero Data Retention)
- enforce_distillable_text
- Typed quantizations with specific literal values
@CLAassistant
Copy link

CLAassistant commented Mar 20, 2026

CLA assistant check
All committers have signed the CLA.

Copy link
Contributor

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 2 additional findings.

Open in Devin Review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants