AI Proxy Advanced

AI License Required

Load balancing: Semantic with fallback

v3.13+ Configure the plugin to use three OpenAI models and route requests based on semantic similarity between the prompt and model descriptions.

In this example, two targets share the same description (“Specialist in programming problems”). When a prompt matches this description, the plugin will first route to the target with weight 75 (gpt-4o). If that target fails, it falls back to the target with weight 25 (gpt-4o-mini) using round-robin. The third target with a different description (“Specialist in real life topics”) handles prompts about non-technical topics.

Prerequisites

  • An OpenAI account

  • A Redis instance for vector storage

Environment variables

  • OPENAI_API_KEY: The API key to use to connect to OpenAI.

Set up the plugin

Something wrong?

Help us make these docs great!

Kong Developer docs are open source. If you find these useful and want to make them better, contribute today!