Related Documentation
Minimum Version
Kong Gateway - 3.6
Tags
#ai

You can proxy requests to Llama2 AI models through AI Gateway using the AI Proxy and AI Proxy Advanced plugins. This reference documents all supported AI capabilities, configuration requirements, and provider-specific details needed for proper integration.

Upstream paths

AI Gateway automatically routes requests to the appropriate Llama2 API endpoints. The following table shows the upstream paths used for each capability.

Capability Upstream path or API
Chat completions User-defined
Completions User-defined
Embeddings User-defined

Supported capabilities

The following tables show the AI capabilities supported by Llama2 provider when used with the AI Proxy or the AI Proxy Advanced plugin.

Set the plugin’s route_type based on the capability you want to use. See the tables below for supported route types.

Text generation

Support for Llama2 basic text generation capabilities including chat, completions, and embeddings:

Capability Route type Streaming Model example Min version
Chat completions llm/v1/chat User-defined 3.6
Completions llm/v1/completions User-defined 3.6
Embeddings llm/v1/embeddings User-defined 3.11

Llama2 base URL

The base URL is $UPSTREAM_URL, where {route_type_path} is determined by the capability.

AI Gateway uses this URL automatically. You only need to configure a URL if you’re using a self-hosted or Llama2-compatible endpoint, in which case set the upstream_url plugin option.

Configure Llama2 with AI Proxy

To use Llama2 with AI Gateway, configure the AI Proxy or AI Proxy Advanced.

Here’s a minimal configuration for chat completions:

For more configuration options and examples, see:

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!