Code Monkey home page Code Monkey logo

glide's People

Contributors

arjunnair22 avatar daesu avatar fossabot avatar gernest avatar mkrueger12 avatar ppmdo avatar roma-glushko avatar tom-fitz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

glide's Issues

Init Model Pools

Define language model pools based on the configuration passed.

Init logger

Investigate if the default slogs module added in go1.21 is a good option to rely for logging functionality-wise.

If not, lets configure zap.

Requirements:

  • it's possible to set log level/severity via configs(account for that since configs are still in TODO)
  • it should be possible to log records as colored plain text and as JSON
  • it's possible to log a message and additional fields
  • it's fine to just write logs to stdout

Router Deployment Error

Receiving following error when deploying the following config:

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x2 addr=0x0 pc=0x10509150c]

goroutine 1 [running]:
glide/pkg.NewGateway(0x1400052e0c0)
        /Users/max/code/Glide/pkg/gateway.go:39 +0x3c
glide/pkg/cmd.NewCLI.func1(0x14000690600, {0x1050c419c?, 0x7?, 0x1050c173f?})
        /Users/max/code/Glide/pkg/cmd/cli.go:26 +0x54
github.com/spf13/cobra.(*Command).execute(0x14000690600, {0x14000122220, 0x2, 0x2})
        /Users/max/go/pkg/mod/github.com/spf13/[email protected]/command.go:983 +0x840
github.com/spf13/cobra.(*Command).ExecuteC(0x14000690600)
        /Users/max/go/pkg/mod/github.com/spf13/[email protected]/command.go:1115 +0x344
github.com/spf13/cobra.(*Command).Execute(0x14000070728?)
        /Users/max/go/pkg/mod/github.com/spf13/[email protected]/command.go:1039 +0x1c
main.main()
        /Users/max/code/Glide/main.go:25 +0x20
exit status 2
make: *** [run] Error 1
telemetry:
logging:
level: info
encoding: console # console, json
# other configs

api:
http:
listen_addr: 0.0.0.0:7685
max_body_size: "2Mi"
tls:
  ca_path:
  cert_path:
# other configs

routes:
language:
- id: openai-pool
  strategy: priority # round-robin, weighted-round-robin, priority, least-latency, priority, etc.
  models:
    - id: primary
      openai: # cohere, azureopenai, gemini, other providers we support
        model: gpt-3.5-turbo
        api_key: "sk-"
        default_params:
          temperature: 0.1

    - id: secondary
      cohere:
        model: command-light
        apiKey: ""
        default_params: # set the default request params
          temperature: 0.1

- id: latency-critical-pool
  strategy: least-latency
  models:
    - id: primary
      timeout_ms: 200
      openai:
        model: gpt-3.5-turbo
        api_key: "sk-"
     
    - id: secondary
      timeout_ms: 200
      cohere:
        api_key: ""

- id: cohere-openai-ab-test
  strategy: weighted-round-robin
  models:
    - id: openai
      weight: 30
      openai:
        api_key: "sk-"
    - id: cohere
      weight: 70
      cohere:
        api_key: ""

API keys redacted.

Setup CD

Configure a Github Action pipeline to build a new version of Glide on merges into the main branch.

GEP: EinStack/geps#7

Update Config Schema

The field under 'id' needs to be updated from 'openai' to 'provider'

routers:
  language:
    - id: test-router
      models:
        - id: openai
          openai:
            api_key: "sk"
        - id: cohere
          openai:
            api_key: ""

Init Glide CLI

Init a CLI and add there one command that would run the Glide server with a health API

[Routing] Find a way to normalize latency

We need to find a way to track model latency that would be independent from the response size.

Options:

  • use the time to fist byte metric (needs to instrument clients to get that info)
  • count the generated tokens in the response and dividing it by the response time
  • something else?

Reference:

Request Body to AI API schema

Transforms the request body to match the structure required by the AI provider.
It also ensures the values for each parameter are within the minimum and maximum
constraints defined in the provider's configuration. If a required parameter is missing,
it assigns the default value from the provider's configuration.

๐Ÿ“š Setup Docs

Setup documentation for Glide and deploy/host it somewhere.

Docs frameworks

Mkdocs + Material Theme

A popular option in Python community. I have been using it for my Hyx project.

Reference:

Hugo + Docsy

A popular option in CNCF community.

Reference:

Example of Real Docs:

Docusaurus

A popular option in general, gives a good looking UI but unsure about of effort to get it working/maintain.

Reference:

Examples of Real Docs:

Docs Hosting

Popular Options are:

Docs Licence

We can go with Apache 2.0 for code snippets + CC-BY-4.0 for the main content.

โœจ Support TLS/HTTPS

Allow to setup TLS for Glide HTTP API, so it's possible to:

  • securely connect to API
  • (potentially) setup mTLS authentication

โœจ Support Embedding API

Add a new set of API to support embeddings:

  • come up with the unified embedding request/response schemas
  • add a new model type to the routers config
  • define at least one provider with embedding capabilities

Update OpenAI Client

  • Map the OpenAI response to a struct then feed into Unified response
  • Change ProviderResponse to ModelResponse

Init configs

Let Glide be configured via a YAML file.

Requirements:

  • define the structure of the config file via a GEP (e.g. routing config, server configs, etc). [GEP0001]
  • implement the config subsystem that would include reading the file content and its validation
  • make the config accessible across the service
  • it should be possible to include env vars into the config (e.g. to load sensitive data like API keys)
  • explore ways to include separate files as a value of a config (e.g. to load sensitive data like API keys)

Reloading the service on config file change is outside of this task (#28)

๐Ÿ”ง Resiliency Testing: Implement FaultyProvider

Implement a mock provider called FaultyProvider that would enable us to do resiliency testing of Glide emulating super hostile conditions like:

  • temporary transient errors
  • rate limits
  • sudden response time increases
  • canceled in-flight responses

Update Readme.md

Readme.md is a face of the project. Let's fix the broken links and update copy to make good impression on people visiting the repo

๐Ÿ”Š Setup OpenTelemetry

In order to collect metrics on different aspects of the system (e.g. how many times OpenAI failed/accepted requests), we need to setup OpenTelemetry.

Also, we could use OpenTelemetry to implemented distributed tracing, so it's seamlessly integrated into business services that communicates with it and instrumented by OTEL. Also, this should be useful for us to have a better debugging capabilities.

Requirements:

  • setup OTEL
  • make it possible to disable traces/metrics via config if that's unused by users
  • emit gateway-specific metrics (instrument Fiber with OTEL)
  • allow to control cardinality of metrics

Tasks

Setup CI

Setup a new GH Action pipeline on each PR that includes:

  • linting
  • tests
  • try to build the app

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.