Skip to main content
A
Docs

Connect model providers

Add your own provider accounts and keys to the Gateway, choose which models each key can call, and spread traffic across keys.

Before you start

  • Get an account with each model provider that you want to use.
  • Get an API key or other credential for each account.
  • Make sure that the Gateway can reach the provider address from your network. Read Prerequisites.

Add a provider

  1. Open Model Providers in the Gateway console.
  2. Select the provider type.
  3. Add a key. Give it a name.
  4. Enter the credential.
  5. List the models that this key can call. Use the model or deployment names from your provider account.
  6. Set the weight of the key. The Gateway sends more traffic to keys with a higher weight.
  7. Save.

Some provider types also need the endpoint of your resource and an API version. The console asks for these values when they apply.

For a model server in your network, add a custom provider. Select the request format that the server uses and enter its base address.

Keep credentials out of the configuration

The Gateway can read a credential from a reference in place of the value. The reference can point to a file or to a secret store. Anar sets up the method with you during deployment.

Use more than one key

Add more than one key to a provider to spread the load. The Gateway selects a key by weight.

A virtual key can also allow more than one provider, each with a weight. The Gateway then spreads requests across those providers by weight.

Send requests through a proxy

You can set an outbound proxy for each provider. Use this when your network sends outbound traffic through a proxy.

Model names in requests

A request names the model in one of two ways:

  • provider/model, for example provider/your-model.
  • A bare model name, for example your-model. When exactly one provider has a key that lists the name, the Gateway sends the request to that provider.

The Gateway does not check model names against a list of its own. If your provider accepts the name, the Gateway routes it.