feat: add Avian as a new channel provider - #3128
Conversation
Add Avian (https://avian.io) as a new OpenAI-compatible channel type. Avian provides fast, affordable LLM inference. Changes: - Add ChannelTypeAvian (58) constant with base URL - Map to OpenAI API type (fully OpenAI-compatible) - Add to stream supported channels - Add to frontend channel options
WalkthroughThis pull request adds support for a new Avian channel type (ID: 58) throughout the backend and frontend. It includes channel constant definition, API type mapping to OpenAI, streaming support registration, and frontend channel option configuration. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
f5f43ea to
f140ce9
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@web/src/constants/channel.constants.js`:
- Around line 192-196: Add Avian (value 58) to the MODEL_FETCHABLE_CHANNEL_TYPES
array so the model auto-fetch path recognizes the new channel, and update the
channel-rendering switch in the render helper by adding a case for 58 that
returns the Avian icon component (import the Avian icon if needed) so the
channel shows the correct icon in the UI; modify MODEL_FETCHABLE_CHANNEL_TYPES
and the switch in the render helper (the function handling channel icon
rendering) accordingly.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: fe43ea55-7179-456d-aa88-e39022553b8c
📒 Files selected for processing (4)
common/api_type.goconstant/channel.gorelay/common/relay_info.goweb/src/constants/channel.constants.js
| { | ||
| value: 58, | ||
| color: 'green', | ||
| label: 'Avian', | ||
| }, |
There was a problem hiding this comment.
Complete Avian’s frontend enumeration updates.
Line 192-Line 196 adds the dropdown option, but Avian is still missing from MODEL_FETCHABLE_CHANNEL_TYPES (Line 200-Line 202), and web/src/helpers/render.jsx has no case 58 icon branch. This leads to partial UI support (no model auto-fetch path and no channel icon).
Suggested follow-up changes
// web/src/constants/channel.constants.js
export const MODEL_FETCHABLE_CHANNEL_TYPES = new Set([
1, 4, 14, 34, 17, 26, 27, 24, 47, 25, 20, 23, 31, 40, 42, 48, 43,
+ 58,
]);// web/src/helpers/render.jsx
switch (channelType) {
case 1: // OpenAI
case 3: // Azure OpenAI
case 57: // Codex
+ case 58: // Avian
return <OpenAI size={iconSize} />;🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@web/src/constants/channel.constants.js` around lines 192 - 196, Add Avian
(value 58) to the MODEL_FETCHABLE_CHANNEL_TYPES array so the model auto-fetch
path recognizes the new channel, and update the channel-rendering switch in the
render helper by adding a case for 58 that returns the Avian icon component
(import the Avian icon if needed) so the channel shows the correct icon in the
UI; modify MODEL_FETCHABLE_CHANNEL_TYPES and the switch in the render helper
(the function handling channel icon rendering) accordingly.
|
At present, we will only consider adding well-known AI providers; for all other providers, please use the OpenAI channel type for integration. |
Summary
Changes
constant/channel.go— new channel type, base URL, display namecommon/api_type.go— channel-to-API-type mappingrelay/common/relay_info.go— stream supportweb/src/constants/channel.constants.js— frontend dropdownTest plan
Summary by CodeRabbit