feat(byok): add direct BYOK support for Ollama Cloud#2819
Open
kilo-code-bot[bot] wants to merge 15 commits intomainfrom
Open
feat(byok): add direct BYOK support for Ollama Cloud#2819kilo-code-bot[bot] wants to merge 15 commits intomainfrom
kilo-code-bot[bot] wants to merge 15 commits intomainfrom
Conversation
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.
Contributor
Author
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Files Reviewed (6 files)
Reviewed by gpt-5.5-20260423 · 838,815 tokens |
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.
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.
…ma-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.
Broaden modelIdToDisplayName so tags other than ':cloud' (e.g. ':latest') are stripped from the user-visible name as well.
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
syncDirectByokModelsflow; the catalog is fetched once per sync run and shared with the existingzai-codingfetcher.ollama-cloud) intoDirectUserByokInferenceProviderIdSchema, the BYOK test-model map, and the direct-byok definitions registry. The BYOK UI picks it up automatically viaDIRECT_BYOK_PROVIDERS.REASONING_VARIANTS_NONE_LOW_MEDIUM_HIGHpreset;transformRequestmirrors chutes-byok and promotesreasoning.effortonto the OpenAI-compatiblereasoning_effortfield.modelIdToDisplayNameand strips any:tagsuffix (e.g.kimi-k2.6:cloud→kimi-k2.6) in addition to vendor prefixes.The transport uses
https://ollama.com/v1(OpenAI-compat docs).Verification
ollama-cloudBYOK key in the BYOK Keys Manager and verified it appears in the provider list, populated from the models.dev catalog.UserByokTestModels['ollama-cloud'] = 'kimi-k2.6:cloud'.Visual Changes
N/A — provider is surfaced in the existing BYOK UI via the auto-populated `DIRECT_BYOK_PROVIDERS_LIST`.
Reviewer Notes
gpt-oss:120b,kimi-k2.6:cloud); the direct-byok model lookup is a plain string compare againstformatDirectByokModelId, so colons pass through without needing URL encoding.syncDirectByokModelsrun via a lazygetModelsDevCatalog()on a sharedSyncContext, so adding more models.dev-backed providers does not multiply HTTP calls.