Interactive model selector screen for /model command.
Get the glyph set for the current charset mode.
Check whether the terminal is in ASCII charset mode.
Convenience wrapper so widgets can branch on charset without importing
both _detect_charset_mode and CharsetMode.
Remove the default model from the config file.
Deletes the [models].default key so that future launches fall back to
[models].recent or environment auto-detection.
Get available models dynamically from installed LangChain provider packages.
Imports model profiles from each provider package and extracts model names.
Results are cached after the first call; use clear_caches() to reset.
Load upstream profiles merged with config.toml overrides.
Keyed by provider:model spec string. Each entry contains the
merged profile dict and the set of keys overridden by config.toml.
Unlike get_available_models(), this includes all models from upstream
profiles regardless of capability filters (tool calling, text I/O).
Results are cached; use clear_caches() to reset. When cli_override is
provided the result is stored in a single-slot cache keyed by
id(cli_override). This relies on the caller retaining the same dict
object for the session (the CLI stores it once on the app instance);
passing a different dict with the same contents will bypass the cache
and overwrite the previous entry.
Check if credentials are available for a provider.
Resolution order:
config.toml) with api_key_env — takes
priority so user overrides are respected.class_path but no api_key_env —
assumed to manage their own auth (e.g., custom headers, JWT, mTLS).PROVIDER_API_KEY_ENV mapping (anthropic, openai, etc.).Update the default model in config file.
Reads existing config (if any), updates [models].default, and writes
back using proper TOML serialization.
Character glyphs for TUI display.
Parsed model configuration from config.toml.
Instances are immutable once constructed. The providers mapping is
wrapped in MappingProxyType to prevent accidental mutation of the
globally cached singleton returned by load().
Profile data for a model with override tracking.
A clickable model option in the selector.
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.