# tbphp/gpt-load

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/tbphp-gpt-load).**

6,223 stars · 661 forks · Go · MIT

## Links

- GitHub: https://github.com/tbphp/gpt-load
- Homepage: https://www.gpt-load.com
- awesome-repositories: https://awesome-repositories.com/repository/tbphp-gpt-load.md

## Topics

`anthropic` `claude` `gemini` `gin` `go` `golang` `openai`

## Description

gpt-load is a transparent proxy gateway that routes API requests to multiple AI providers—including OpenAI, Google Gemini, and Anthropic Claude—through a single endpoint while preserving each provider's native format and authentication. It acts as a centralized routing layer, allowing applications to switch between AI services by changing only the base URL without modifying any client code or business logic.

The proxy distinguishes itself through intelligent traffic management across pools of API keys, offering automatic key rotation, weighted or round-robin load balancing, and failover that detects unhealthy keys and reroutes requests to healthy ones within the same group. Configuration is managed dynamically through a web interface or REST API with hot-reload, applying changes immediately without service restarts, and settings are organized across three tiers—environment, system, and group—for flexible deployment. API keys are stored encrypted in a MySQL database with support for enabling, disabling, or rotating the encryption key, and separate authentication tokens secure the management interface and proxy requests.

For production deployments, gpt-load supports high-availability cluster setups with a master-slave architecture, horizontal scaling, configuration synchronization across nodes, and graceful shutdown protocols. Real-time monitoring provides health checks, request logs, and usage statistics through a web dashboard, while in-memory caching and rate-limiting use fast key-value stores for low-latency access. The project includes a web-based management interface for viewing and modifying settings, managing API keys and provider groups, and monitoring cluster health without editing files or restarting the service.

## Tags

### Part of an Awesome List

- [AI Proxy](https://awesome-repositories.com/f/awesome-lists/devops/monitoring-and-health/gateway-health-monitors/ai-proxy.md) — Provides real-time statistics, health checks, and detailed request logs through a web management dashboard. ([source](https://cdn.jsdelivr.net/gh/tbphp/gpt-load@main/README.md))

### Data & Databases

- [API Key Failovers](https://awesome-repositories.com/f/data-databases/automatic-failover-controllers/api-key-failovers.md) — Detects failed or unhealthy API keys and reroutes requests to healthy ones within the same group without interrupting service. ([source](https://www.gpt-load.com/docs/channels))
- [Configuration and Log Persistence](https://awesome-repositories.com/f/data-databases/mysql-integrations/log-storage/configuration-and-log-persistence.md) — Stores API keys, user authentication data, usage statistics, and system logs in a relational database for durability. ([source](https://www.gpt-load.com/docs/architecture-design))

### Development Tools & Productivity

- [API Migration Tools](https://awesome-repositories.com/f/development-tools-productivity/api-migration-tools.md) — Switches an existing application to the proxy by changing only the base URL, leaving all business logic and SDK calls untouched. ([source](https://www.gpt-load.com/docs/channels))
- [Proxy Configuration Reloaders](https://awesome-repositories.com/f/development-tools-productivity/configuration-hot-reloading/proxy-configuration-reloaders.md) — Updates system and group settings without restarting the service by applying changes immediately through hot-reload. ([source](https://cdn.jsdelivr.net/gh/tbphp/gpt-load@main/README.md))
- [Real-Time Runtime Updates](https://awesome-repositories.com/f/development-tools-productivity/configuration-updates/real-time-runtime-updates.md) — Updates settings dynamically without restarting the service so you can tune performance in real time. ([source](https://www.gpt-load.com/docs/configuration))

### DevOps & Infrastructure

- [API Key Failure Retriers](https://awesome-repositories.com/f/devops-infrastructure/api-service-management/api-resilience/request-retries/api-key-failure-retriers.md) — Blacklists failing API keys and restores them after a recovery period to keep the proxy service running without interruption. ([source](https://cdn.jsdelivr.net/gh/tbphp/gpt-load@main/README.md))
- [Configuration Synchronizers](https://awesome-repositories.com/f/devops-infrastructure/cluster-node-management/configuration-synchronizers.md) — Uses a master node to manage configuration and database writes, while follower nodes handle proxy traffic and sync state.
- [Graceful Shutdowns](https://awesome-repositories.com/f/devops-infrastructure/graceful-shutdowns.md) — Removes a node from the load balancer, waits for in-flight requests to finish, then stops the service and cleans up resources. ([source](https://www.gpt-load.com/docs/deployment/cluster))
- [Leader-Follower Proxy Clusters](https://awesome-repositories.com/f/devops-infrastructure/helm-chart-management/high-availability-cluster-deployments/leader-follower-proxy-clusters.md) — Supports leader-follower architecture with horizontal scaling for high availability in enterprise environments. ([source](https://cdn.jsdelivr.net/gh/tbphp/gpt-load@main/README.md))
- [Master-Slave Proxy Clusters](https://awesome-repositories.com/f/devops-infrastructure/helm-chart-management/high-availability-cluster-deployments/master-slave-proxy-clusters.md) — Deploys a master-slave architecture where the master manages configuration and slaves handle proxy traffic for failover and load distribution. ([source](https://www.gpt-load.com/docs/deployment/cluster))
- [Proxy Cluster Deployments](https://awesome-repositories.com/f/devops-infrastructure/helm-chart-management/high-availability-cluster-deployments/proxy-cluster-deployments.md) — Deploying a master-slave architecture with horizontal scaling, configuration sync, and graceful shutdown for enterprise use.
- [Horizontal Scaling Deployments](https://awesome-repositories.com/f/devops-infrastructure/high-availability-deployments/horizontal-scaling-deployments.md) — Adds slave nodes that automatically sync configuration and integrate with the load balancer to handle increased traffic. ([source](https://www.gpt-load.com/docs/deployment/cluster))
- [API Key Rotation](https://awesome-repositories.com/f/devops-infrastructure/load-balancing/api-key-rotation.md) — Manages a pool of API keys across providers with automatic rotation, load balancing, and recovery from failures.
- [Multi-Provider Key Rotators](https://awesome-repositories.com/f/devops-infrastructure/load-balancing/api-key-rotation/multi-provider-key-rotators.md) — An intelligent proxy that routes requests to multiple AI providers with automatic API key rotation and failover.
- [AI Proxy Clusters](https://awesome-repositories.com/f/devops-infrastructure/remote-cluster-access/cluster-proxies/ai-proxy-clusters.md) — Deploys a master-slave architecture for horizontal scaling, failover, and centralized configuration management.
- [AI Model Load Balancers](https://awesome-repositories.com/f/devops-infrastructure/traffic-load-balancers/ai-model-load-balancers.md) — Distributes requests across multiple upstream endpoints using weighted load balancing to improve availability. ([source](https://cdn.jsdelivr.net/gh/tbphp/gpt-load@main/README.md))
- [Configuration APIs](https://awesome-repositories.com/f/devops-infrastructure/configuration-apis.md) — Reads and updates configuration settings from external tools through a programmatic interface. ([source](https://www.gpt-load.com/docs/configuration))
- [Environment-System-Group Override Layers](https://awesome-repositories.com/f/devops-infrastructure/tiered-configuration-inventories/environment-system-group-override-layers.md) — Loads settings from environment, system, and group layers so higher layers override lower ones for flexible deployment. ([source](https://www.gpt-load.com/docs/configuration))

### Networking & Communication

- [AI Provider Proxies](https://awesome-repositories.com/f/networking-communication/api-proxies/ai-provider-proxies.md) — Routing requests to OpenAI, Gemini, and Claude through a single proxy endpoint while preserving native API formats and authentication.
- [Upstream Endpoint Load Balancing](https://awesome-repositories.com/f/networking-communication/load-balancers/weighted-load-balancing/upstream-endpoint-load-balancing.md) — Distributes requests among multiple upstream AI endpoints using weighted load balancing to improve availability. ([source](https://cdn.jsdelivr.net/gh/tbphp/gpt-load@main/README.md))
- [API Key Load Balancers](https://awesome-repositories.com/f/networking-communication/load-balancing/api-key-load-balancers.md) — Distributes incoming requests evenly across all active API keys in a group to maximize throughput and reliability. ([source](https://www.gpt-load.com/docs/channels))
- [Round-Robin API Key Distributors](https://awesome-repositories.com/f/networking-communication/load-balancing/api-key-load-balancers/round-robin-api-key-distributors.md) — Routes requests across a pool of API keys using round-robin or weighted allocation with automatic failover on failure.
- [AI Provider Group Managers](https://awesome-repositories.com/f/networking-communication/proxy-group-managers/ai-provider-group-managers.md) — Organizes API keys into groups for different AI services and applies group-specific proxy keys and configurations. ([source](https://cdn.jsdelivr.net/gh/tbphp/gpt-load@main/README.md))
- [Proxy Authentication Schemes](https://awesome-repositories.com/f/networking-communication/traffic-proxying/proxy-traffic-management/proxy-authentication-schemes.md) — Uses distinct authentication keys for the management interface and proxy requests with global and group-level keys.

### Security & Cryptography

- [API Key Management](https://awesome-repositories.com/f/security-cryptography/api-key-management.md) — Adds, removes, and monitors API keys for multiple providers from a single management interface. ([source](https://www.gpt-load.com/docs/channels))
- [API Key Encryption at Rest](https://awesome-repositories.com/f/security-cryptography/encryption-key-management/api-key-encryption-at-rest.md) — Persists API keys, usage statistics, and logs in a MySQL database with at-rest encryption support. ([source](https://cdn.jsdelivr.net/gh/tbphp/gpt-load@main/README.md))
- [Encrypted Key Storage with Rate Limiting](https://awesome-repositories.com/f/security-cryptography/api-key-authentication/key-authentication-enforcers/encrypted-key-storage-with-rate-limiting.md) — Stores API keys encrypted in a database and enforces per-client rate limits with authentication for proxy and management interfaces.
- [via REST API](https://awesome-repositories.com/f/security-cryptography/api-key-management/via-rest-api.md) — Creates, updates, and deletes API keys, views statistics, and adjusts system settings through programmatic endpoints. ([source](https://www.gpt-load.com/docs/architecture-design))
- [Encrypted Key-Value Stores](https://awesome-repositories.com/f/security-cryptography/encrypted-key-value-stores.md) — Encrypts API keys at rest and allows enabling, disabling, or changing the encryption key at any time. ([source](https://cdn.jsdelivr.net/gh/tbphp/gpt-load@main/README.md))
- [Encrypted Key Registries](https://awesome-repositories.com/f/security-cryptography/encryption-key-management/encrypted-key-registries.md) — Stores API keys encrypted in a relational database with support for enabling, disabling, or rotating the encryption key.
- [Separate Management](https://awesome-repositories.com/f/security-cryptography/proxy-authentication/separate-management.md) — Uses distinct authentication keys for the management interface and proxy requests with global and group-level keys. ([source](https://cdn.jsdelivr.net/gh/tbphp/gpt-load@main/README.md))

### Software Engineering & Architecture

- [AI Provider Gateways](https://awesome-repositories.com/f/software-engineering-architecture/api-gateways/ai-provider-gateways.md) — A unified gateway that forwards requests to OpenAI, Google Gemini, and Anthropic Claude through a single endpoint.
- [Web-Based Configuration Dashboards](https://awesome-repositories.com/f/software-engineering-architecture/application-lifecycle-management/configuration-management/configuration-interfaces-and-editors/web-based-configuration-generators/web-based-configuration-dashboards.md) — Views and modifies settings through an online dashboard without editing files or restarting the service. ([source](https://www.gpt-load.com/docs/configuration))
- [Configuration Validation](https://awesome-repositories.com/f/software-engineering-architecture/configuration-validation.md) — Checks all configuration values against strict rules to catch errors before they affect operation. ([source](https://www.gpt-load.com/docs/configuration))
- [Rate Limiting with Usage Monitoring](https://awesome-repositories.com/f/software-engineering-architecture/request-throttling/rate-limiting/rate-limiting-with-usage-monitoring.md) — Enforces per-client rate limits, authenticates requests, and tracks usage statistics in real time through a web dashboard. ([source](https://www.gpt-load.com/docs/architecture-design))

### System Administration & Monitoring

- [Configuration Hot-Reloading](https://awesome-repositories.com/f/system-administration-monitoring/configuration-hot-reloading.md) — Applies system and group configuration changes immediately via hot-reload, eliminating service downtime. ([source](https://cdn.jsdelivr.net/gh/tbphp/gpt-load@main/README.md))
- [Hot-Reload Configuration Managers](https://awesome-repositories.com/f/system-administration-monitoring/configuration-hot-reloading/hot-reload-configuration-managers.md) — Applies changes to system settings and group configurations immediately without requiring a service restart. ([source](https://cdn.jsdelivr.net/gh/tbphp/gpt-load@main/README.md))
- [Web & API Configuration Managers](https://awesome-repositories.com/f/system-administration-monitoring/configuration-hot-reloading/web-api-configuration-managers.md) — Updates system and group settings dynamically without restarting the service through a web interface or REST API.
- [Proxy Performance Monitoring](https://awesome-repositories.com/f/system-administration-monitoring/proxy-performance-monitoring.md) — Displays real-time statistics, health checks, and detailed request logs through a web management interface. ([source](https://cdn.jsdelivr.net/gh/tbphp/gpt-load@main/README.md))
- [Real-Time Monitoring Systems](https://awesome-repositories.com/f/system-administration-monitoring/real-time-monitoring-systems.md) — Displays live statistics, health checks, and detailed request logs through a web management interface. ([source](https://cdn.jsdelivr.net/gh/tbphp/gpt-load@main/README.md))
- [Service Health Monitoring](https://awesome-repositories.com/f/system-administration-monitoring/service-health-monitoring.md) — Provides real-time statistics, health checks, and detailed request logging through a web management interface. ([source](https://cdn.jsdelivr.net/gh/tbphp/gpt-load@main/README.md))
- [AI Proxy Cluster Health Monitors](https://awesome-repositories.com/f/system-administration-monitoring/cluster-health-monitoring/ai-proxy-cluster-health-monitors.md) — Tracks request volume, response time, and database or cache connection status for each node in the cluster. ([source](https://www.gpt-load.com/docs/deployment/cluster))
- [Real-Time Node Health Monitors](https://awesome-repositories.com/f/system-administration-monitoring/health-monitoring/instance-health-monitors/microservices-health-monitoring/master-node-health-monitors/real-time-node-health-monitors.md) — Provides a web dashboard with real-time health checks, request logs, and usage statistics for the proxy cluster.

### Web Development

- [AI Provider Routing](https://awesome-repositories.com/f/web-development/api-endpoint-configurations/service-endpoint-configurations/ai-provider-routing.md) — Route requests to multiple AI providers through a single endpoint while preserving each provider's native API format and authentication. ([source](https://cdn.jsdelivr.net/gh/tbphp/gpt-load@main/README.md))
- [API Proxy Routings](https://awesome-repositories.com/f/web-development/traffic-routing/frontend-version-routing/api-proxy-routings.md) — Forward OpenAI-compatible API calls through a proxy service that handles routing, streaming responses, and error retries without changing client code. ([source](https://www.gpt-load.com/docs/architecture-design))
