Configuration
How to Configure the Gateway
Below details how to configure Glide.
In order to start, start Glide gateway, we need to pass a config file:
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 belowtelemetry
- 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/chat
endpoints from model providersid
- A unique id for your routerstrategy
- The type of router can be round-robin, weighted-round-robin, least-latency, prioritymodels/id
- A unique ID for the model configuration
See an example of a more advanced 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’slocalhost
or0.0.0.0
api.http.read_timeout
(default: 3m) - the timeout of data reading from clientsapi.http.write_timeout
(default: 3m) - the timeout of data writing to clientsapi.http.idle_timeout
(default: 1m) - the free timeout of the request link for persistent keep-alive connectionsapi.http.max_request_body_size
(default: 4Mb) - max body size of a request
A sample of the configuration:
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. Thejson
outputs structured logs useful for production setup whileconsole
is 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 generatedtelemetry.logging.disable_stacktrace
- controls adding information about full stacktrace to the code that generated logstelemetry.logging.output_paths
(default: [] (an empty array)) - allows to save logging streams to the specified filestelemetry.logging.output_paths
(default: (an empty map)) - key-value pairs to label each Glide’s log record.
A sample of the configuration:
Advanced Configuration
Additionally, parameters can be specified in the configuration as well. Refer to the providers section for more information on parameters.