dsh-polyglot: Providing OpenAI-Compatible Endpoint Switching and Automatic Fallback for DSH

dsh-polyglot is an MIT-licensed DSH plugin developed by Jesse-njx, designed to address challenges in DSH when invoking external models, including multi-endpoint management, unstable free quotas, and rate limiting. This plugin consolidates multiple OpenAI-compatible providers into a single virtual provider, `polyglot`, utilizing a universal adapter to handle streaming, tool calls, and usage extraction, while employing declarative configuration to accommodate variations across different services. At its core is an automatic fallback router that, upon encountering 429 rate limits, quota exhaustion, 5xx errors, or missing API keys, automatically switches to the next available provider in the chain, implementing exponential backoff and retry strategies for cooldown. The plugin maintains provider information through JSON preset files and records the service source, status, and token usage for each request in session logs.

Read More