switched to fib backoff

This commit is contained in:
Luxferre
2026-07-30 09:53:36 +03:00
parent 1cc6ddb2e4
commit d49339d770
4 changed files with 519 additions and 5 deletions
+2 -1
View File
@@ -13,7 +13,7 @@ Dynagate is a lightweight, high-performance LLM gateway written in Go that acts
- Watches `models.csv` (overridable via command-line flags) continuously using a background thread and automatically reloads configuration updates without dropping active connections.
3. **Fallback and retry orchestration**:
- Attempts keys configured for the requested model sequentially.
- Attempts keys configured for the requested model sequentially using Fibonacci backoff delays (`-retry-delay`).
- Cascades automatically to the next model in the priority chain (wrapping around to cover all entries) if all keys for the requested model fail.
- Updates the `"model"` field dynamically in the outgoing request body before proxying, ensuring upstream compatibility.
@@ -98,6 +98,7 @@ my-secure-gateway-token-2
| `-key` | string | `""` | Path to a file containing the gateway's access tokens (one per line). If blank, authentication is disabled. |
| `-csv-updater` | string | `""` | Command/script to run periodically to update `models.csv`. |
| `-csv-update-interval`| int | `10` | Frequency in minutes to invoke `-csv-updater`. |
| `-retry-delay` | int | `100` | Base delay in milliseconds for Fibonacci failover retries (0 to disable). |
### Model CSV format rules
The gateway maps columns dynamically by looking at the header row. If no header is present, it defaults to: