Skip to content

Feature/Dynamic OpenAI compatible model fetching on front page#5562

Open
crazyrabbit0 wants to merge 4 commits intoKilo-Org:mainfrom
crazyrabbit0:feature/dynamic-openai-compatible-model-fetching
Open

Feature/Dynamic OpenAI compatible model fetching on front page#5562
crazyrabbit0 wants to merge 4 commits intoKilo-Org:mainfrom
crazyrabbit0:feature/dynamic-openai-compatible-model-fetching

Conversation

@crazyrabbit0
Copy link
Contributor

@crazyrabbit0 crazyrabbit0 commented Jan 30, 2026

Dynamic OpenAI-Compatible Model Fetching on Front Page

Context

This PR implements dynamic model fetching for OpenAI-compatible providers on the front page. Previously, users had to open model provider settings to view all available models. With this change, Kilo Code now automatically queries the provider's /models endpoint to retrieve available models on the front page whenever the configuration is updated, providing a more seamless and responsive experience. This is especially useful for local providers like LM Studio, Ollama, or custom OpenAI-compatible gateways where the available models frequently change.

Implementation

The solution involves both frontend and backend changes to fetch and propagate model lists:

  • Backend (Extension Host): Added a new message handler for requestOpenAiModels that uses the provider's base URL and API key to fetch models from the standard OpenAI-compatible /models endpoint.
  • Frontend (Webview):
    • Updated ExtensionStateContext.tsx to include a useDebounce hook that triggers a requestOpenAiModels message whenever the OpenAI configuration (Base URL, API Key, Headers) changes.
    • Modified useProviderModels.ts to consume the openAiModels list from the extension state.
    • Updated getModelsByProvider to transform the fetched string array into ModelRecord objects using sane defaults for model info (context window, cost, etc.).
  • State Management: The fetched models are stored in the extension's global state and synchronized with the webview, ensuring they persist across sessions and are available in the model selector UI.

Screenshots

before after
image image

How to Test

  1. Setup an OpenAI-compatible provider
  2. Configure Provider: In Kilo Code settings, select "OpenAI" as the provider.
  3. Enter Base URL: Provide the base URL for your service (e.g., http://localhost:1234/v1).
  4. Verify Fetching:
    • Observe the logs or network traffic to see the request to the /models endpoint.
    • Open the model selector dropdown on the front page in the chat interface.
    • You should see the list of models currently hosted by your provider.
  5. Update Provider: Change the models available in your local provider and verify that Kilo Code updates the list (after the debounce period).

Vasileios Zachariou added 2 commits January 30, 2026 22:44
Add support for dynamically fetching and displaying models from OpenAI-compatible providers.

- Add openAiModels field to ExtensionState and context
- Implement debounced model fetching request in ExtensionStateContext
- Update useProviderModels hook to prioritize fetched models for OpenAI providers
@changeset-bot
Copy link

changeset-bot bot commented Jan 30, 2026

🦋 Changeset detected

Latest commit: 23f86a7

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@crazyrabbit0 crazyrabbit0 changed the title Feature/dynamic OpenAI compatible model fetching Feature/Dynamic OpenAI compatible model fetching on front page Jan 31, 2026
jeremylongshore added a commit to jeremylongshore/kilocode that referenced this pull request Feb 14, 2026
jeremylongshore added a commit to jeremylongshore/kilocode that referenced this pull request Feb 14, 2026
- Add .reviews/README.md: case study framing for AI-assisted PR review
- Add 6 test evidence logs (combined batches + mega-combined)
- Copy evidence logs to 13 individual PR directories
- Update 13 status.json files with test_results + evidence_log refs
- Total: ~38,000 lines of raw terminal output as proof of work

Test runs (all fresh, turbo cache cleared):
  Batch 1: PRs Kilo-Org#5370+5660+5704 — 7,859 passed
  Individual: PR Kilo-Org#5562 — 7,803 passed
  Batch 2: PRs Kilo-Org#5739+5817 — 7,938 passed
  Batch 3: PRs Kilo-Org#5331+5568 — 7,935 passed
  Batch 4: PRs Kilo-Org#5667+5728+5807+5865+5869 — 7,935 passed
  Mega-combined: 11 PRs merged — 7,938 passed

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.

1 participant