Skip to content

Conversation

@TerminallyLazy
Copy link
Contributor

Replace static model name text inputs with dynamic dropdowns that fetch
available models directly from each provider's API based on configured
API keys.

Supported providers:

  • OpenAI, Anthropic, Google Gemini, Groq, Mistral, DeepSeek, xAI
  • OpenRouter, SambaNova
  • Any OpenAI-compatible provider with custom api_base

Changes:

  • Add python/helpers/model_discovery.py for API-based model fetching
  • Add python/api/settings_refresh_models.py endpoint
  • Convert model name fields from text to select with dynamic options
  • Add frontend handlers for provider change and custom model entry
  • Include 1-hour cache with force refresh capability
  • Preserve "Custom (enter manually)" option for unlisted models

Backend

  • python/helpers/model_discovery.py: Core module that fetches models from each provider's /models endpoint with provider-specific authentication (Bearer token, Anthropic headers, Google query params)
  • python/api/settings_refresh_models.py: API endpoint called by frontend, resolves masked API key placeholders to actual values from environment

Frontend

  • handleSelectChange(): Triggers model refresh when provider dropdown changes
  • refreshAllModelOptions(): Fetches all model lists when settings modal opens
  • Custom model input: Falls back to text input when "Custom (enter manually)" is selected
  • Alpine.js reactivity fix: Uses splice() for in-place array modification to ensure UI updates

Caching

  • File-based cache at tmp/model_cache.json
  • 1-hour TTL with per-provider, per-type granularity
  • Force refresh option bypasses cache on provider change
  • Clear cache option available for troubleshooting

Dynamic Model Discovery:
- Add python/helpers/model_discovery.py for API-based model fetching
- Add python/api/settings_refresh_models.py endpoint
- Convert model name fields from text to select with dynamic options
- Support OpenAI, Anthropic, Google, Groq, Mistral, DeepSeek, xAI,
  OpenRouter, SambaNova, and OpenAI-compatible providers
- Include 1-hour cache with force refresh capability
- Preserve "Custom (enter manually)" option for unlisted models

Merged from upstream development:
- Settings system refactoring (backend/frontend separation)
- Process groups UI for collapsible step sequences
- Scheduler system with task management
- Banner system for security warnings
- Microsoft Dev Tunnels integration
- CSS reorganization (tables.css, scheduler.css)
- Component-based settings architecture
- Projects and contexts system
- Various UI polish and bug fixes

Co-Authored-By: Claude Opus 4.5 <[email protected]>
@TerminallyLazy TerminallyLazy force-pushed the feat-dynamic-model-list branch from bebe343 to 234270d Compare January 9, 2026 05:18
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