Full-screen modal for model selection.
Displays available models grouped by provider with keyboard navigation and search filtering. Current model is highlighted.
Returns (model_spec, provider) tuple on selection, or None on cancel.
ModelSelectorScreen(
self,
current_model: str | None = None,
current_provider: str | None = None,
cli_profile_override: dict[str, Any] | None = None
)| Name | Type | Description |
|---|---|---|
current_model | str | None | Default: NoneThe currently active model name (to highlight). |
current_provider | str | None | Default: NoneThe provider of the current model. |
cli_profile_override | dict[str, Any] | None | Default: NoneExtra profile fields from Merged on top of upstream + config.toml profiles so that CLI
overrides appear with |
Compose the screen layout.
Set up the screen on mount.
Loads model data in a background thread so the screen frame renders immediately, then populates the model list.
Filter models as user types.
Handle Enter key when filter input is focused.
Handle click on a model option.
Move selection up.
Move selection down.
Replace search text with the currently selected model spec.
Move selection up by one visible page.
Move selection down by one visible page.
Select the current model.
Toggle the highlighted model as the default.
If the highlighted model is already the default, clears it. Otherwise sets it as the new default.
Cancel the selection.