Commit a320291
authored
fix(byok): skip Vercel BYOK for Kilo-exclusive models (#3001)
* feat(byok): exclude Kilo-exclusive models from user BYOK
Kilo-exclusive models must always be served through Kilo's own providers
and never through a user's BYOK key. This change:
- Adds isKiloExclusiveModel helper
- Skips BYOK lookup (direct and Vercel) in getProvider for Kilo-exclusive models
- Filters Kilo-exclusive models out of the listSupportedModels response
used by the BYOK selection screen
* refactor(byok): only skip Vercel BYOK for Kilo-exclusive models
Direct BYOK is unaffected — it targets dedicated OpenAI-compatible
providers by model ID prefix and does not overlap with Kilo-exclusive
models. Expanded the comment to explain why Vercel is incompatible:
the Vercel AI Gateway speaks upstream-native API shapes, whereas
Kilo-exclusive models live behind generic OpenAI-compatible endpoints
with our own request/response transforms.
* refactor(byok): move Kilo-exclusive check into checkVercelBYOK
Pushes the filter down to where it belongs and clarifies that the core
incompatibility is reasoning: the Vercel AI Gateway normalizes reasoning
to upstream-native shapes, whereas Kilo-exclusive models go through
generic OpenAI-compatible endpoints with transforms we apply ourselves.
* fix(byok): exclude disabled models from isKiloExclusiveModel
Matches the convention used by findKiloExclusiveModel and
isKiloExclusiveFreeModel: disabled exclusive models shouldn't be treated
as Kilo-exclusive for routing/filtering purposes.
* docs(byok): drop 'transforms we apply ourselves' from comment
---------
Co-authored-by: kiloconnect[bot] <240665456+kiloconnect[bot]@users.noreply.github.com>1 parent f0649ef commit a320291
3 files changed
Lines changed: 14 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
82 | 82 | | |
83 | 83 | | |
84 | 84 | | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
85 | 89 | | |
86 | 90 | | |
87 | 91 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
132 | 132 | | |
133 | 133 | | |
134 | 134 | | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
135 | 142 | | |
136 | 143 | | |
137 | 144 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
| 37 | + | |
37 | 38 | | |
38 | 39 | | |
39 | 40 | | |
| |||
106 | 107 | | |
107 | 108 | | |
108 | 109 | | |
| 110 | + | |
109 | 111 | | |
110 | 112 | | |
111 | 113 | | |
| |||
0 commit comments