Configuration Structure
Glide’s configuration is a declarative YAML file with the following high level sections:- routers- defines Glide’s routers per model modality (e.g.- routers.language,- routers.speech, etc). For more information on router types see the router page.
- api- defines Glide’s server configuration for specific protocol. Read more about this below
- telemetry- defines configuration for Glide’s observability. Read more about this below.
Basic Configuration
At its simplest the gateway can be configured with a single router and two models. This example shows a failover router leveraging OpenAI and Azure OpenAI. For OpenAI, Cohere, and OctoML, only an API key needs to be provided. All other parameters, including the model, are provided by default. For Azure OpenAI, a model and base_url must be specified.- language- This is the language API endpoint which support a- /chatendpoints from model providers
- id- A unique id for your router
- strategy- The type of router can be round-robin, weighted-round-robin, least-latency, priority
- models/id- A unique ID for the model configuration
Secrets
Glide supports two ways of passing sensitive information like API keys:- via environment variables:
- via separate files (useful in cloud setups):
Dotenv files
To make it easier for you to manage secrets locally, Glide automatically attempts to load environment variables from.env files located in the directory where it was called.
You can use a separate --env flag to provide a specific path:
API Configuration
HTTP is the only supported protocol for Glide’s API right now. The following configurations are exposed for you to tweak:- api.http.host(default: localhost) - defines address to which Glide binds its server. Usually, it’s- localhostor- 0.0.0.0
- api.http.read_timeout(default: 3m) - the timeout of data reading from clients
- api.http.write_timeout(default: 3m) - the timeout of data writing to clients
- api.http.idle_timeout(default: 1m) - the free timeout of the request link for persistent keep-alive connections
- api.http.max_request_body_size(default: 4Mb) - max body size of a request
Telemetry
Telemetry configs defines logging, metrics (coming soon), and traces (coming soon) generated by Glide. Here are available parameters:- telemetry.logging.level(default: info) - minimal log level to output. Possible values:- debug,- info,- warning,- error
- telemetry.logging.encoding(default: json) - logging encoding. The- jsonoutputs structured logs useful for production setup while- consoleis much more readable, so it fits development setups.
- telemetry.logging.disable_caller- controls adding information about place in Glide’s codebase where the log was generated
- telemetry.logging.disable_stacktrace- controls adding information about full stacktrace to the code that generated logs
- telemetry.logging.output_paths(default: [] (an empty array)) - allows to save logging streams to the specified files
- telemetry.logging.output_paths(default: (an empty map)) - key-value pairs to label each Glide’s log record.
