Feature: AIgateway provider integration (declarative provider)
- Langage dominant
- Rust
- Étoiles
- 54.2k
- Forks
- 6.2k
- Merge moyen
- 3 j 4 h
- PR mergées (30 j)
- 240
Description
**What problem would this solve?**
Goose's declarative provider set (`crates/goose-providers/src/declarative/definitions/`) includes aggregators like OpenRouter, Novita, Together, Venice and Vercel AI Gateway, but not [AIgateway](https://aigateway.sh). Users who hold an AIgateway key (one `sk-aig-` key for 1,000+ models from 85+ labs — Claude, GPT-5.4, Gemini, Kimi, GLM, DeepSeek — at pass-through provider pricing) currently have to configure it under the generic custom OpenAI-compatible provider, losing Goose's curated model metadata, pricing, and `/v1/models` discovery.
**Who it affects:** anyone using both Goose and AIgateway; also anyone who follows our catalog/docs into Goose.
**What would a good outcome look like?**
A first-class `aigateway` declarative provider: engine `openai`, base URL `https://api.aigateway.sh/v1/chat/completions`, `AIGATEWAY_API_KEY` env, curated model list with context limits + per-token costs, and `catalog_provider_id: aigateway` so the models.dev registry metadata (our provider entry merged there — anomalyco/models.dev#6361) enriches it.
**Possible approaches**
I had opened PR #11885 before this process existed; it was closed with a request to start here. That PR shows the concrete shape:
- `declarative/definitions/aigateway.json` — 13 curated models with per-token pricing from our live catalog (`GET /v1/models` returns 1,065 models; the JSON carries the top ones)
- `expose_declarative_providers!` macro registration
- `test_aigateway_provider_registry_wiring` test in `crates/goose/src/providers/init.rs` (Gondola pattern: name, default model `zai-org/glm-5.3-flash`, secret key) — passing locally
- AIgateway validation section in `goose-self-test.yaml`
- All CI green on the PR, `cargo test -p goose-providers --lib` 217/217
Trade-offs: none unusual — it follows the exact Novita/Vercel-AI-Gateway pattern. The only open question from the code-review bot was whether `max_tokens` fields in the JSON are useful given `ModelInfo` currently ignores them (existing definitions like Novita's carry the same field — happy to follow whatever the maintainers prefer there).
**Ownership & maintenance:** I'm the founder of AIgateway; we'll maintain the provider definition as our catalog evolves (pricing snapshots come from the same pipeline that publishes aigateway.sh/models).
**Additional context**
- PR with the implementation ready to reopen: aaif-goose/goose#11885 (branch still up)
- Our models.dev registry entry (feeds `catalog_provider_id`): anomalyco/models.dev#6361
- API docs: https://aigateway.sh/docs · catalog: https://aigateway.sh/models
- [x] I have verified this does not duplicate an existing feature request
Guide de contribution
Ouvrir le guide de contribution
Piste de recherche
Le travail se situe dans les définitions déclaratives des providers. Commencez par examiner le modèle existant dans crates/goose-providers/src/declarative/definitions/ pour des providers comme Novita ou Vercel AI Gateway. La tâche principale consiste à créer un nouveau fichier aigateway.json avec les modèles et les tarifs spécifiés, puis à l’enregistrer via la macro expose_declarative_providers!. Exécutez la suite de tests existante, en particulier le test dans crates/goose/src/providers/init.rs, afin de vérifier l’intégration. Le travail est considéré comme terminé lorsque CI passe et que le provider apparaît dans le catalogue.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Domaine
- ai, backend-api-design
- Type d'issue
- Fonctionnalité
- Difficulté
- 2/5
- Temps estimé
- 1-3 heures
- Activité
- Active
- Clarté
- Clairement spécifiée
- Accessibilité débutants
- 70/100