0xPlaygrounds / 0xPlaygrounds/rig

feat(openrouter): model fallbacks and routed-model exposure

Abierto
#1,866 2 comentarios 0 reacciones 0 asignados Ver en GitHub
Lenguaje dominante
Rust
Estrellas
8.6k
Forks
959
Merge medio
4 h 32 min
PR fusionados (30 d)
117

Descripción

## Summary

Add typed OpenRouter model fallback routing via a `ModelFallbacks` helper and expose the provider-reported routed model through completion, streaming, and agent response surfaces.

## Motivation

OpenRouter supports a `models` fallback array for chat completions. Rig currently has no typed API for this (unlike `ProviderPreferences`), and the response `model` field (which may differ from the requested primary when fallbacks fire) is not surfaced to generic callers or agent `.prompt()` users.

## Proposed scope

- `ModelFallbacks::new([...])`, `to_json()`, and `CompletionModel::with_model_fallbacks()`
- Serialize `{ "model": "", "models": ["", ...] }` with documented precedence rules
- Populate `CompletionResponse.response_model` and propagate to agent `CompletionCall` / `PromptResponse` / streaming `FinalResponse`
- Unit tests for serialization/precedence; ignored live smoke tests for OpenRouter

Embeddings/transcription fallbacks are out of scope.

Guía de contribución

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.