Skip to content

feat: add Kilo as a native provider#13765

Open
Nomadcxx wants to merge 1 commit intoanomalyco:devfrom
Nomadcxx:feat/kilo-provider
Open

feat: add Kilo as a native provider#13765
Nomadcxx wants to merge 1 commit intoanomalyco:devfrom
Nomadcxx:feat/kilo-provider

Conversation

@Nomadcxx
Copy link

@Nomadcxx Nomadcxx commented Feb 15, 2026

What does this PR do?

Adds Kilo as a built-in provider. Kilo's gateway is OpenAI-compatible, so this mostly wires up model discovery and auth — no new SDK needed.

The main thing: models are fetched dynamically from api.kilo.ai/api/gateway/models at startup, so users don't need to manually configure models in opencode.json. Select Kilo from the provider list, enter your API key, and all available models show up.

Changes:

  • provider.tsfetchKiloModels() hits the Kilo models endpoint, maps pricing/capabilities/limits to opencode's schema. Kilo entry is always injected into the database (even before auth) so it appears in the provider list. Models populate once authenticated.
  • auth.ts — Kilo in CLI auth login flow with priority and info message
  • dialog-provider.tsx — Kilo in TUI provider dialog with priority and description
  • provider.test.ts — 7 tests covering dynamic model loading, error handling, and config-based setup

Fixes #13767

How did you verify your code works?

  • Full test suite passes (985 pass, 5 skip, 0 fail)
  • Typecheck passes (all 12 packages)
  • Tested against live Kilo Gateway — 346 models fetched, chat completions working

@github-actions
Copy link
Contributor

Thanks for your contribution!

This PR doesn't have a linked issue. All PRs must reference an existing issue.

Please:

  1. Open an issue describing the bug/feature (if one doesn't exist)
  2. Add Fixes #<number> or Closes #<number> to this PR description

See CONTRIBUTING.md for details.

@github-actions
Copy link
Contributor

The following comment was made by an LLM, it may be inaccurate:

Potential Duplicate Found

PR #5709: feat: api.kilo.ai/api support
#5709

Why it might be related: This PR appears to address Kilo support, potentially overlapping with the current PR #13765 which adds Kilo as a native provider. Both seem to be related to integrating Kilo API support, though the current PR appears to be a more comprehensive native provider implementation.

Please verify if PR #5709 is a duplicate, merged, or an earlier iteration that this PR supercedes.

@Nomadcxx
Copy link
Author

Technically this is a backport, Kilo cli forked opencode, so we're just bringing the family back together here.

Adds Kilo (kilo.ai) as a built-in provider that dynamically fetches
available models from the Kilo Gateway API at startup.

- Add fetchKiloModels() to provider.ts — fetches model catalog from
  api.kilo.ai/api/gateway/models, maps pricing/capabilities/limits
  to opencode's schema
- Register Kilo in CUSTOM_LOADERS with autoload and baseURL
- Always inject a minimal database entry so Kilo appears in provider
  list before auth (lets users discover and select it)
- Add Kilo to CLI auth login flow with priority and info message
- Add Kilo to TUI provider dialog with priority and description
- Add 7 provider tests covering dynamic model loading, error handling,
  and config-based setup
@Nomadcxx Nomadcxx marked this pull request as ready for review February 15, 2026 21:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE]: Add Kilo as a native provider

1 participant