Skip to content

Conversation

@im47cn
Copy link

@im47cn im47cn commented Oct 28, 2025

Add support for randomly selecting API keys from multiple keys configured per provider using semicolon-separated format, and enable random model selection from multiple model configurations in router settings. This improves load balancing and failover capabilities.

Key changes:

  • New keySelector utility with weighted random selection
  • Router updated to support multi-model switching via semicolon separation
  • Added comprehensive test coverage for new functionality
  • Updated configuration examples to demonstrate multi-key setup
  • Enhanced error handling for edge cases in router middleware

BREAKING CHANGE: Provider configuration now supports api_keys (semicolon-separated) in addition to existing api_key field for better multi-key management.

im47cn added 2 commits October 28, 2025 11:35
Add support for randomly selecting API keys from multiple keys configured per provider using semicolon-separated format, and enable random model selection from multiple model configurations in router settings. This improves load balancing and failover capabilities.

Key changes:
- New keySelector utility with weighted random selection
- Router updated to support multi-model switching via semicolon separation
- Added comprehensive test coverage for new functionality
- Updated configuration examples to demonstrate multi-key setup
- Enhanced error handling for edge cases in router middleware

BREAKING CHANGE: Provider configuration now supports `api_keys` (semicolon-separated) in addition to existing `api_key` field for better multi-key management.
@gqfx
Copy link

gqfx commented Nov 1, 2025

Nice job! This multi-key switching feature is exactly what I was looking for.

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