Commit f0649ef
feat(byok): add direct BYOK support for Ollama Cloud (#2819) ☁️
* feat(byok): add direct BYOK support for Ollama Cloud
Adds Ollama Cloud as a new direct BYOK provider using its OpenAI-compatible
endpoint at https://ollama.com/v1. Model list and metadata are curated from
https://models.dev/api.json with descriptions sourced from the Kilo gateway
model catalog.
* refactor(byok): sync Ollama Cloud models dynamically from models.dev
Reworks the Ollama Cloud BYOK provider to pull its model catalog
dynamically via sync-direct-byok (mirroring zai-coding) instead of
hardcoding 37 models. Keeps a single recommended model (gpt-oss:120b)
inline and adds the display name to direct-byok-meta.
* chore(byok): use kimi-k2.6 as recommended Ollama Cloud model
* refactor(byok): fetch models.dev catalog once per sync
* refactor(byok): bareModelId strips vendor prefix and variant suffix
* chore(byok): drop ollama-cloud comment slop
* fix(byok): align ollama-cloud test model with recommended model
The dynamic sync leaves Redis empty until the first cron run, so only
the hardcoded recommended model is guaranteed to be present in the
model list. Use it as the test model to avoid a broken test-key flow
pre-sync.
* feat(ollama-cloud): add none/low/medium/high reasoning variants
* fix(byok): drop description from ollama-cloud recommended model, simplify sync
* refactor(byok): share models.dev fetch, strip :cloud suffix, fix ollama-cloud types
- Cache the models.dev catalog within a single syncDirectByokModels run so
providers sourced from it share one HTTP fetch.
- Rename stripVendorPrefix to modelIdToDisplayName and strip trailing :cloud
tags (e.g. kimi-k2.6:cloud -> kimi-k2.6) in addition to vendor prefixes.
- Drop variants: null from the ollama-cloud recommended model; the schema on
main is now .optional(), so the explicit null was rejected by tsgo.
* refactor(byok): strip any suffix after ':' in model display names
Broaden modelIdToDisplayName so tags other than ':cloud' (e.g. ':latest') are
stripped from the user-visible name as well.
* feat(byok): map reasoning.effort to reasoning_effort for Ollama Cloud
Mirror the chutes-byok transformRequest so reasoning variants (none/low/
medium/high) flow through to Ollama Cloud's OpenAI-compatible endpoint as
the reasoning_effort field.
---------
Co-authored-by: kiloconnect[bot] <240665456+kiloconnect[bot]@users.noreply.github.com>
Co-authored-by: Christiaan Arnoldus <christiaan@kilocode.ai>1 parent 4206937 commit f0649ef
6 files changed
Lines changed: 40 additions & 0 deletions
File tree
- apps/web/src/lib/ai-gateway/providers
- direct-byok
- openrouter
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
6 | 7 | | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
| 14 | + | |
13 | 15 | | |
14 | 16 | | |
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
| |||
Lines changed: 29 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
135 | 135 | | |
136 | 136 | | |
137 | 137 | | |
| 138 | + | |
138 | 139 | | |
139 | 140 | | |
140 | 141 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
32 | 37 | | |
33 | 38 | | |
34 | 39 | | |
| |||
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
98 | 98 | | |
99 | 99 | | |
100 | 100 | | |
| 101 | + | |
101 | 102 | | |
102 | 103 | | |
103 | 104 | | |
| |||
130 | 131 | | |
131 | 132 | | |
132 | 133 | | |
| 134 | + | |
133 | 135 | | |
134 | 136 | | |
135 | 137 | | |
| |||
0 commit comments