Skip to content

add support for load balancing across multiple models and providers #13

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

uniAIDevs
Copy link

Description

This pull request introduces significant enhancements to the gateway's load balancing capabilities, focusing on ensuring that operations are only directed towards healthy providers. By integrating health checks across various points where providers and models are accessed or manipulated, we ensure higher reliability and availability in serving requests. This change affects how models and providers are listed, fetched, created, updated, and how their configurations are retrieved, ensuring that only healthy entities are interacted with. Code was created by Alex Scott and Sweep AI.

Summary

  • Added health check validations in ListModels, ListProviders, GetProvider, CreateProvider, UpsertProvider, and GetProviderConfig methods within gateway/internal/api/v1/models.go and providers.go to ensure operations are performed only on healthy providers.
  • Implemented a DefaultHealthChecker struct in gateway/internal/router/health_checker.go that currently assumes all providers are healthy. This serves as a placeholder for future, more sophisticated health check logic.
  • Modified the PriorityRouter and RoundRobinRouter in gateway/internal/router/priority.go and round_robin.go to select the next available healthy provider, enhancing the robustness of load balancing mechanisms.
  • These changes collectively enhance the system's resilience by ensuring that unhealthy providers are gracefully bypassed, thereby improving the overall reliability of the service.

Files affected:

  • gateway/internal/api/v1/models.go
  • gateway/internal/api/v1/providers.go
  • gateway/internal/router/health_checker.go
  • gateway/internal/router/priority.go
  • gateway/internal/router/round_robin.go

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.

1 participant