Skip to content

feat: AI provider improvements — auto-detect models, per-provider config#11

Open
dchau360 wants to merge 2 commits into
jitrc:mainfrom
dchau360:feat/ai-provider-improvements
Open

feat: AI provider improvements — auto-detect models, per-provider config#11
dchau360 wants to merge 2 commits into
jitrc:mainfrom
dchau360:feat/ai-provider-improvements

Conversation

@dchau360
Copy link
Copy Markdown
Collaborator

Summary

  • Auto-detect models when switching providers or changing the URL field — no manual Refresh needed
  • URL normalization — custom provider accepts host:port or http://host:port (auto-appends /v1)
  • API type detection for custom URLs — probes Ollama native API then OpenAI-compatible, shows detected type in UI
  • Anthropic model fetching — fetches available models from https://api.anthropic.com/v1/models using x-api-key
  • Per-provider memory — URL, API key, and model are saved/restored independently when switching providers
  • Per-provider API keys stored in keyring (AI_API_KEYS dict in config)
  • Anthropic preset now shows correct URL in the URL field
  • Static model lists hidden for ollama/lm-studio/custom (only real fetched models shown)
  • Startup fetch uses correct saved URL (signals blocked during init to prevent premature fetch)
  • API type detection label shown only for custom provider

Test plan

  • Switch between all providers — verify URL, API key, and model restore correctly
  • Enter host:port in custom URL field — verify it normalizes and detects API type
  • Enter http://host:port in custom URL field — verify same behaviour
  • Verify ollama/lm-studio auto-fetch real models on selection
  • Verify anthropic fetches models when API key is present
  • Verify openai fetches models when API key is present
  • Restart app — verify saved provider settings load correctly with right model selected

🤖 Generated with Claude Code

dchau-wfr and others added 2 commits April 11, 2026 07:38
…manent delete

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Auto-fetch available models when provider is selected or URL changes
- normalize_url(): accept host:port or http://host:port → adds /v1
- detect_and_fetch(): probe Ollama native API then OpenAI-compat to
  detect API type and fetch real model list for custom providers
- fetch_anthropic_models(): fetch models from Anthropic API with x-api-key
- Per-provider storage for URL, API key, and model — switching providers
  restores each provider's last-used settings
- API key stored per-provider in keyring (AI_API_KEYS dict in config)
- Anthropic preset now shows https://api.anthropic.com/v1 in URL field
- Static model lists hidden for ollama/lm-studio/custom (real models only)
- Startup fetch uses correct saved URL (signals blocked during init)
- API type detection label shown only for custom provider

Co-Authored-By: Claude Sonnet 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.

2 participants