-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#29: Merge remote-tracking branch 'origin/develop' into 29-setup-open…
…ai-client
- Loading branch information
Showing
21 changed files
with
394 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
1.21 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,80 @@ | ||
# Glide - An LLM Routing Engine | ||
Achieve 100% uptime for your Generative AI applications. Glide sits between your applications and your API endpoint. Pass your model preferences to the API endpoint and your call will be routed to the correct model based on model availability. | ||
# Glide | ||
<div align="center"> | ||
<img src="docs/images/glide.png" width="400px" alt="Glide GH Header" /> | ||
</div> | ||
|
||
[![LICENSE](https://img.shields.io/github/license/modelgateway/glide.svg?style=flat-square&color=%233f90c8)](https://github.com/modelgateway/glide/blob/main/LICENSE) | ||
|
||
Glide is a cloud-native open source high-performant model gateway. All LLMOps you needed is packed in one lightweight service. | ||
|
||
We take all problems and toll of managing and communicating with external providers out of your applications, | ||
so you could focus solving your core problems. | ||
|
||
Glide sits between your application and model providers that you use to seamlessly handle various LLMOps tasks like | ||
model failover, caching, etc. | ||
|
||
> [!Warning] | ||
> Glide is under active development right now. Give us a star to support the project ✨ | ||
## Features | ||
|
||
- **Unified REST API** across providers. Avoid vendor lock-ins and changes in your applications when you adopt new providers. | ||
- **High availability** and **resiliency** working with external model providers. Automatic **fallbacks** on provider failures, rate limits, transient errors. Smart retries to reduce communication latency. | ||
- Support **popular LLM providers**. | ||
- **High performance**. Performance is our priority. We want to keep Glide "invisible" for your latency-wise, while providing rich functionality. | ||
- **Production-ready observability** via OpenTelemetry, emit metrics on models health, allows whitebox monitoring. | ||
- Straightforward and simple maintenance and configuration, API key rotation, etc. | ||
|
||
## Supported Providers | ||
|
||
|| Provider | Support Status | ||
|---|---|---| | ||
| <img src="docs/images/openai.png" width=18 />| OpenAI | 🏗️ Coming Soon | | ||
| <img src="docs/images/azure.png" width=18>| Azure OpenAI | 🏗️ Coming Soon | | ||
| <img src="docs/images/anthropic.png" width=18>| Anthropic | 🏗️ Coming Soon | | ||
| <img src="docs/images/cohere.png" width=18>| Cohere | 🏗️ Coming Soon| | ||
| <img src="docs/images/bard.png" width=18>| Google Gemini | 🏗️ Coming Soon | | | ||
| <img src="docs/images/localai.png" width=18>| LocalAI | 🏗️ Coming Soon | | | ||
### Large Language Models | ||
|
||
<br /> | ||
| | Provider | Support Status | | ||
|-----------------------------------------------------|---------------|-----------------| | ||
| <img src="docs/images/openai.svg" width="18" /> | OpenAI | 🏗️ Coming Soon | | ||
| <img src="docs/images/azure.svg" width="18" /> | Azure OpenAI | 🏗️ Coming Soon | | ||
| <img src="docs/images/anthropic.svg" width="18" /> | Anthropic | 🏗️ Coming Soon | | ||
| <img src="docs/images/cohere.png" width="18" /> | Cohere | 🏗️ Coming Soon | | ||
| <img src="docs/images/bard.svg" width="18" /> | Google Gemini | 🏗️ Coming Soon | | ||
| <img src="docs/images/localai.webp" width="18" /> | LocalAI | 🏗️ Coming Soon | | ||
|
||
|
||
## Get Started | ||
|
||
TBU | ||
|
||
## Roadmap | ||
|
||
- REST API to set primary and secondary models based on LLM API status | ||
- Open an issue if there is a feature you'd like to see | ||
### MVP (Coming soon) | ||
|
||
- Unified LLM Chat REST API | ||
- Support for most popular LLM providers | ||
- Seamless model fallbacking | ||
- The Main Load Balancing: Priority, Round Robin, Weighted Round Robin, Latency | ||
|
||
### Future | ||
|
||
- Exact & Semantic Caching | ||
- Cost Management & Budgeting | ||
- and many more! | ||
|
||
Open [an issue](https://github.com/modelgateway/glide/issues) or start [a discussion](https://github.com/modelgateway/glide/discussions) | ||
if there is a feature or an enhancement you'd like to see in Glide. | ||
|
||
## Community | ||
|
||
- Join Discord for real-time discussions | ||
|
||
## Contribute | ||
|
||
- Maintainers | ||
|
||
- [Roman Hlushko](https://github.com/roma-glushko), Software Engineer, Distributed Systems & MLOps | ||
- [Max Krueger](https://github.com/mkrueger12), Data Engineer, Data Scientist | ||
|
||
Thanks everyone for already put their effort to make Glide better and more feature-rich: | ||
|
||
<a href="https://github.com/modelgateway/glide/graphs/contributors"> | ||
<img src="https://contributors-img.web.app/image?repo=modelgateway/glide" /> | ||
</a> | ||
|
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
// this file contains the BuildAPIRequest function which takes in the provider name, params map, and mode and returns the providerConfig map and error | ||
// The providerConfig map can be used to build the API request to the provider | ||
package pkg | ||
|
||
import ( | ||
"errors" | ||
"fmt" | ||
|
||
"glide/pkg/providers" | ||
"glide/pkg/providers/openai" | ||
|
||
"github.com/go-playground/validator/v10" | ||
Check failure on line 12 in pkg/buildAPIRequest.go GitHub Actions / Vulnerability Check
Check failure on line 12 in pkg/buildAPIRequest.go GitHub Actions / Vulnerability Check
Check failure on line 12 in pkg/buildAPIRequest.go GitHub Actions / Tests
Check failure on line 12 in pkg/buildAPIRequest.go GitHub Actions / Lint
|
||
) | ||
|
||
type ProviderConfigs = pkg.ProviderConfigs | ||
|
||
// Initialize configList | ||
|
||
var configList = map[string]interface{}{ | ||
"openai": openai.OpenAIConfig, | ||
} | ||
|
||
// Create a new validator instance | ||
var validate *validator.Validate = validator.New() | ||
Check failure on line 24 in pkg/buildAPIRequest.go GitHub Actions / Vulnerability Check
|
||
|
||
func BuildAPIRequest(provider string, params map[string]string, mode string) (interface{}, error) { | ||
// provider is the name of the provider, e.g. "openai", params is the map of parameters from the client, | ||
// mode is the mode of the provider, e.g. "chat", configList is the list of provider configurations | ||
var providerConfig map[string]interface{} | ||
|
||
if config, ok := configList[provider].(ProviderConfigs); ok { | ||
if modeConfig, ok := config[mode].(map[string]interface{}); ok { | ||
providerConfig = modeConfig | ||
} | ||
} | ||
|
||
// If the provider is not supported, return an error | ||
if providerConfig == nil { | ||
return nil, errors.New("unsupported provider") | ||
} | ||
|
||
// Build the providerConfig map by iterating over the keys in the providerConfig map and checking if the key exists in the params map | ||
|
||
for key := range providerConfig { | ||
if value, exists := params[key]; exists { | ||
providerConfig[key] = value | ||
} | ||
} | ||
|
||
// Validate the providerConfig map using the validator package | ||
err := validate.Struct(providerConfig) | ||
if err != nil { | ||
// Handle validation error | ||
return nil, fmt.Errorf("validation error: %v", err) | ||
} | ||
// If everything is fine, return the providerConfig and nil error | ||
return providerConfig, nil | ||
} |
Oops, something went wrong.