fix: enable dynamic model selection for OpenAI Compatible provider (#… #4772
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.
Context
Enables dynamic model selection for OpenAI Compatible providers by fetching available models from the /v1/models endpoint. Previously, users had to manually enter model IDs. This also fixes a bug where model names with multiple slashes (e.g., chutes/moonshotai/Kimi-K2-Instruct) were being truncated to only show the first two path segments.
Closes #3271
Implementation
Dynamic Model Fetching
Model Name Parsing Fix
Data Flow
API (/v1/models) → openai.ts fetcher → RouterModels cache → useProviderModels hook → ModelSelector UI ↘ sets displayName ↘ fallback to prettyModelName()
How to Test
How to Test
Configure an OpenAI Compatible provider (e.g., Chutes, OpenRouter, or any OpenAI-compatible API)
Set the API key and base URL in provider settings
Open the model selector dropdown
Verify that:
Available models are fetched and displayed automatically
Model names with slashes display the full name (not truncated)
Models like moonshotai/Kimi-K2-Instruct-0905 show as "Moonshotai / Kimi K2 Instruct 0905"
Run tests:
Get in Touch
b3n.w on Kilo discord.