The Settings Panel allows users to configure how the application communicates with AI services. It provides two main configuration options:
- Direct API Mode - Enables direct communication with Gemini API
- API Key Management - Stores and manages the user's Gemini API key
- What it does: When enabled, messages are sent directly to the Gemini API using your API key, bypassing the backend server
- Default state: Disabled (messages go through backend server first)
- Benefits:
- Faster response times (no backend processing delay)
- Direct control over API usage
- Works even when backend is unavailable
- Uses official Google GenAI SDK for reliable communication
- Proper streaming support with abort controller
- Requirements: Must have a valid Gemini API key configured
- Storage: API keys are stored locally in the browser's localStorage
- Security: Keys are never sent to our servers
- Validation: The system checks for valid API keys when Direct API Mode is enabled
- Click the settings button (gear icon) in the MenuBar
- The Settings Modal will appear with current configuration
- Toggle the "Direct API Mode" switch to enable/disable
- When enabled, you'll see a warning message
- Make sure you have a valid API key configured
- Enter your Gemini API key in the "Gemini API Key" field
- The field is password-protected for security
- API key is required when Direct API Mode is enabled
- Click "Save" to store the configuration
- Click "Save" to apply and store your settings
- Click "Cancel" to discard changes and revert to previous settings
- Settings are automatically loaded when the modal opens
- Settings are stored in
localStorage - Keys used:
frontendOnlyMode: Boolean string ("true"/"false")geminiApiKey: The user's Gemini API key
- When Direct API Mode is enabled and a Gemini provider is selected:
- Messages are sent directly using the
@google/genaiSDK - Uses the user's API key for authentication
- Supports streaming responses with proper error handling
- Uses the same model (
gemini-2.0-flash-exp) as the backend
- Messages are sent directly using the
- When Direct API Mode is disabled:
- Messages are sent to the backend server as before
- Backend handles all API communication
- Validates API key presence when Direct API Mode is enabled
- Shows appropriate error messages for API failures
- Gracefully falls back to backend mode if direct API fails
- Proper abort controller support for cancelling requests
- Uses the official Google GenAI SDK for reliable API communication
- API keys are stored locally and never transmitted to our servers
- Keys are stored in password-protected input fields
- Direct API mode only works with Gemini providers
- All communication with Gemini API uses HTTPS
- Ensure you have a valid Gemini API key
- Check that the API key is properly saved
- Verify you're using a Gemini provider
- Check browser console for error messages
- Verify the API key is correct and active
- Check if the API key has proper permissions
- Ensure the API key is for Gemini services
- Direct API mode may be faster but uses your API quota
- Backend mode may be slower but provides additional features
- Consider switching modes based on your needs