Commit 12894ca
feat(frontend): add AI Gateway integration for dynamic provider and model selection
Add comprehensive AI Gateway integration to Console UI with the following features:
- **Gateway Selection**: Fetch and display available AI Gateways from AI Gateway API
- Auto-select first available gateway when creating agents
- Show gateway ID in agent configuration details
- **Dynamic Provider Loading**: Fetch LLM providers from AI Gateway ListModelProviders API
- Replace hardcoded provider list with dynamic data
- Display provider logos from API response
- **Dynamic Model Loading**: Fetch models from AI Gateway ListModels API
- Filter models by selected provider
- Auto-select first model when provider changes
- Show model metadata (context window, description)
- **Dual-Mode Support**:
- AI Gateway mode: Use gateway for auth, dynamic providers/models, hide API key field
- Legacy mode: Use API key, hardcoded providers/models (backward compatible)
- **Feature Flag**: enable-api-key-configuration-agent
- false (default): AI Gateway mode with dynamic data
- true: Legacy mode with hardcoded providers and API key requirement
- **API Integration**:
- Add buf.build/redpandadata/ai-gateway dependency
- Generate TypeScript types for Gateway, ModelProviders, and Models services
- Create React Query hooks with proper caching and authentication
- Configure dev server proxy for AI Gateway API (/.redpanda/api/redpanda.api.aigateway.v1)
- **Validation**:
- API key optional when gateway is configured (proto updated with ignore = IGNORE_IF_ZERO_VALUE)
- Gateway required when available
- Conditional validation based on mode
- **UX Improvements**:
- No layout shift: gateway field always visible (disabled when unavailable)
- Loading states for gateway/provider/model dropdowns
- No validation errors during loading transitions
- Icons displayed for providers in both selected state and dropdown
Technical details:
- Proto generation includes AI Gateway v1 API from buf.build
- Proxy configuration in both Console UI and Cloud UI to handle CORS
- Custom transport for AI Gateway with bearer token authentication
- React Query caching with staleTime to prevent excessive refetching
Co-Authored-By: Claude Sonnet 4.5 (1M context) <noreply@anthropic.com>1 parent a73e658 commit 12894ca
File tree
219 files changed
+109352
-207
lines changed- backend/pkg/protogen/redpanda/api/aigateway/v1
- aigatewayv1connect
- frontend
- src
- components
- pages/agents/create
- hooks
- protogen
- buf/validate
- google/api
- redpanda/api/aigateway/v1
- react-query/api
- proto/gen/openapi
- taskfiles
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
219 files changed
+109352
-207
lines changedLines changed: 2415 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 895 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 452 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 1443 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 683 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 378 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 375 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 89 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
0 commit comments