Intelligent Key Management
GPT-Load employs intelligent key management mechanisms through polling load balancing, automatic failure detection, and recovery mechanisms to ensure high service availability and stability.
Polling Mechanism
Objective
Achieve fair load balancing for requests among multiple keys within a group.
Implementation
Atomic Counter
Ensures polling consistency and fairness under high concurrency
Status Filtering
Polling scope limited to keys with 'valid' status within the group
Retry & Failure Handling
Trigger Scenarios
Automatically triggered when request fails (HTTP Status ≥ 400 or network errors)
Processing Flow
Mark Failure
Increment failure count for the current failed key
Get New Key
Immediately obtain the next available key within the group through polling
Transparent Retry
Retry request with new key, transparent to client
Retry Limit
Configured maximum retry attempts. If all attempts fail, return final error to client
Key Blacklisting & Recovery
Blacklisting Mechanism
Trigger Condition
When a key's cumulative failure count reaches the blacklist threshold
Actions Taken
Recovery Mechanism
Trigger Timing
Recovery Process
Health Check
Use blacklisted key to request validation endpoint (e.g., models list)
Validation Success
• Key status restored to 'valid'
• Failure count reset to 0
• Re-added to polling queue
Validation Failure
Maintain 'invalid' status, wait for next check cycle
Mechanism Advantages
Load Balancing
Atomic counter ensures fair polling under high concurrency
Auto Recovery
Scheduled health checks and automatic recovery of failed keys
Fault Isolation
Quickly identify failed keys to ensure service stability