Skip to content

Conversation

@buptcws-cmd
Copy link

@buptcws-cmd buptcws-cmd commented Dec 23, 2025

Summary

  • Add "Test Connection" button for LLM configuration that validates API credentials and fetches available models
  • After successful connection test, model selection shows dropdown instead of text input
  • Support for OpenAI, Qwen, DeepSeek, Moonshot, Ollama, and custom OpenAI-compatible endpoints
  • Claude/Anthropic excluded from connection test (native API not OpenAI-compatible)

Changes

New Files

  • pixelle_video/utils/llm_connection.py - Connection test and model discovery utility

Modified Files

  • pixelle_video/llm_presets.py - Add connection test fields (supports_connection_test, models_url, models_response_path, model_id_field, requires_api_key)
  • web/components/settings.py - Add Test Connection button and model dropdown UI
  • web/i18n/locales/en_US.json - Add i18n translations
  • web/i18n/locales/zh_CN.json - Add i18n translations

Features

Provider Test Connection Model Discovery API Key Required
OpenAI Yes
Qwen Yes
DeepSeek Yes
Moonshot Yes
Ollama No
Claude Yes
Custom Depends

Screenshots

After clicking "Test Connection" with valid credentials:

  • Success message shows number of available models
  • Model input changes from text field to dropdown
  • User can select model from list or switch back to manual input

Test plan

  • Test connection with OpenAI-compatible endpoint (privnode.com)
  • Test connection with Ollama (local)
  • Test with invalid credentials (should show error)
  • Verify Claude preset shows "not supported" message
  • Verify model dropdown appears after successful test
  • Verify preset change resets connection state

🤖 Generated with Claude Code

Add "Test Connection" button for LLM configuration that validates API credentials
and fetches available models from the provider.

Changes:
- Add connection test fields to llm_presets.py (supports_connection_test, models_url, etc.)
- Create llm_connection.py utility with test_connection() and fetch_models()
- Update settings.py UI with Test Connection button and model dropdown
- Add i18n translations for new UI elements (en_US and zh_CN)

Features:
- Test connection validates API key and base URL before saving
- After successful test, model selection shows dropdown instead of text input
- Support for OpenAI, Qwen, DeepSeek, Moonshot, Ollama (Custom endpoints)
- Claude/Anthropic excluded (native API not OpenAI-compatible)
- Ollama allows empty API key (local server)
- OpenAI models filtered to show only chat-capable models

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

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