40 | {isEnum ? (
41 | <>
42 |
43 | {name}
44 |
45 |
46 | {description && (
47 |
48 | )}
49 |
50 | >
51 | ) : (
52 | <>
53 |
54 |
{name}
55 |
59 | {required === "true" ? 'required' : 'optional'}
60 |
61 |
62 |
$1'
66 | )
67 | }}/>
68 |
69 |
70 |
71 | {defaultValue && (
72 |
73 | {defaultValue}
74 |
75 | )}
76 | {description && (
77 |
78 | )}
79 | {enumValues && (
80 |
81 | Enum:{' '}
82 | {enumValues.map(v => {v}
)}
83 |
84 | )}
85 |
86 | >
87 | )}
88 |
89 | );
90 | };
91 |
92 | export default ApiField;
93 |
--------------------------------------------------------------------------------
/site/src/components/HomepageFeatures/index.tsx:
--------------------------------------------------------------------------------
1 | import clsx from 'clsx';
2 | import Heading from '@theme/Heading';
3 | import styles from './styles.module.css';
4 |
5 | type FeatureItem = {
6 | title: string;
7 | image: string;
8 | description: React.ReactElement;
9 | };
10 |
11 | const FeatureList: FeatureItem[] = [
12 | {
13 | title: 'Built together. Built in the open.',
14 | image: require('@site/static/img/1.png').default,
15 | description: (
16 | <>
17 | Envoy AI Gateway is the result of the community coming together to address GenAI traffic handling needs using Envoy.
18 | >
19 | ),
20 | },
21 | {
22 | title: 'v0.1 Release now available',
23 | image: require('@site/static/img/3.png').default,
24 | description: (
25 | <>
26 | The v0.1 Release of Envoy AI Gateway is now available. See the
blog post and the
release notes for more information.
27 | >
28 | ),
29 | },
30 | {
31 | title: 'Get involved in the community',
32 | image: require('@site/static/img/2.png').default,
33 | description: (
34 | <>
35 | Join our community on Slack, join the conversation on GitHub, and attend our Thursday community meetings. See links in footer.
36 | >
37 | ),
38 | },
39 | ];
40 |
41 | function Feature({title, image, description}: FeatureItem) {
42 | return (
43 |
44 |
45 |

46 |
47 |
48 |
{title}
49 |
{description}
50 |
51 |
52 | );
53 | }
54 |
55 | export default function HomepageFeatures(): React.ReactElement {
56 | return (
57 |
58 |
59 |
60 | {FeatureList.map((props, idx) => (
61 |
62 | ))}
63 |
64 |
65 |
66 | );
67 | }
68 |
--------------------------------------------------------------------------------
/site/src/components/HomepageFeatures/styles.module.css:
--------------------------------------------------------------------------------
1 | .features {
2 | display: flex;
3 | align-items: center;
4 | padding: 3rem 0;
5 | width: 100%;
6 | }
7 |
8 | .featureSvg {
9 | max-height: 120px;
10 | max-width: 120px;
11 | margin-bottom: 1.5rem;
12 | }
13 |
--------------------------------------------------------------------------------
/site/src/pages/index.tsx:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import clsx from 'clsx';
3 | import Link from '@docusaurus/Link';
4 | import useDocusaurusContext from '@docusaurus/useDocusaurusContext';
5 | import Layout from '@theme/Layout';
6 | import HomepageFeatures from '@site/src/components/HomepageFeatures';
7 | import Heading from '@theme/Heading';
8 |
9 | function HomepageHeader() {
10 | const {siteConfig} = useDocusaurusContext();
11 | return (
12 |
30 | );
31 | }
32 |
33 | export default function Home(): React.ReactElement {
34 | const {siteConfig} = useDocusaurusContext();
35 | return (
36 |
39 |
40 |
41 |
42 |
43 |
44 | );
45 | }
46 |
--------------------------------------------------------------------------------
/site/src/theme/MDXComponents.tsx:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import MDXComponents from '@theme-original/MDXComponents';
3 | import ApiField from '@site/src/components/ApiField';
4 |
5 | export default {
6 | ...MDXComponents,
7 | ApiField,
8 | };
9 |
--------------------------------------------------------------------------------
/site/static/.nojekyll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/envoyproxy/ai-gateway/d17719cd338fb7f9b63b6b378ffa979370f78e19/site/static/.nojekyll
--------------------------------------------------------------------------------
/site/static/diagrams/upstream-auth.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/envoyproxy/ai-gateway/d17719cd338fb7f9b63b6b378ffa979370f78e19/site/static/diagrams/upstream-auth.png
--------------------------------------------------------------------------------
/site/static/img/1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/envoyproxy/ai-gateway/d17719cd338fb7f9b63b6b378ffa979370f78e19/site/static/img/1.png
--------------------------------------------------------------------------------
/site/static/img/2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/envoyproxy/ai-gateway/d17719cd338fb7f9b63b6b378ffa979370f78e19/site/static/img/2.png
--------------------------------------------------------------------------------
/site/static/img/3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/envoyproxy/ai-gateway/d17719cd338fb7f9b63b6b378ffa979370f78e19/site/static/img/3.png
--------------------------------------------------------------------------------
/site/static/img/blog/0.1-release-image.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/envoyproxy/ai-gateway/d17719cd338fb7f9b63b6b378ffa979370f78e19/site/static/img/blog/0.1-release-image.png
--------------------------------------------------------------------------------
/site/static/img/control_plane.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/envoyproxy/ai-gateway/d17719cd338fb7f9b63b6b378ffa979370f78e19/site/static/img/control_plane.png
--------------------------------------------------------------------------------
/site/static/img/data_plane.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/envoyproxy/ai-gateway/d17719cd338fb7f9b63b6b378ffa979370f78e19/site/static/img/data_plane.png
--------------------------------------------------------------------------------
/site/static/img/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/envoyproxy/ai-gateway/d17719cd338fb7f9b63b6b378ffa979370f78e19/site/static/img/favicon.ico
--------------------------------------------------------------------------------
/site/static/img/logo-white.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/site/static/img/logo.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/site/static/img/social-card-envoy-ai-gw.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/envoyproxy/ai-gateway/d17719cd338fb7f9b63b6b378ffa979370f78e19/site/static/img/social-card-envoy-ai-gw.png
--------------------------------------------------------------------------------
/site/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | // This file is not used in compilation. It is here just for a nice editor experience.
3 | "extends": "@docusaurus/tsconfig",
4 | "compilerOptions": {
5 | "baseUrl": "."
6 | },
7 | "exclude": [".docusaurus", "build"]
8 | }
9 |
--------------------------------------------------------------------------------
/site/versioned_docs/version-0.1/capabilities/index.md:
--------------------------------------------------------------------------------
1 | ---
2 | id: capabilities
3 | title: Capabilities
4 | sidebar_position: 3
5 | ---
6 |
7 | # Envoy AI Gateway Capabilities
8 |
9 | Welcome to the Envoy AI Gateway capabilities documentation! This section provides detailed information about the various features and capabilities that Envoy AI Gateway offers to help you manage and optimize your AI/LLM traffic.
10 |
11 |
--------------------------------------------------------------------------------
/site/versioned_docs/version-0.1/concepts/architecture/control-plane.md:
--------------------------------------------------------------------------------
1 | ---
2 | id: control-plane
3 | title: Control Plane Explained
4 | sidebar_position: 3
5 | ---
6 |
7 | # Control Plane Explained
8 |
9 | The control plane is responsible for configuring and managing the system. It consists of several key components working together to manage the AI Gateway configuration.
10 |
11 | 
12 |
13 | ## How It Works
14 |
15 | The control plane operates through a chain of components that work together to manage the configuration:
16 |
17 | 1. The Envoy AI Gateway controller watches AI Gateway Custom Resources (CRs)
18 | 2. When changes are detected, it updates the Envoy Gateway configuration
19 | 3. Envoy Gateway then updates the Envoy Proxy configuration
20 | 4. The data plane (Envoy Proxy) processes AI traffic based on this configuration
21 |
22 | This architecture ensures a clear separation of concerns, where the AI Gateway controller focuses on AI-specific configuration while leveraging Envoy Gateway for general proxy management.
23 |
24 | ## Components
25 |
26 | ### AI Gateway Controller
27 | The AI Gateway Controller manages AI-specific components and configurations:
28 |
29 | #### ExtProc Management
30 | - Deploys and configures the External Processor (ExtProc) service
31 | - Creates and updates ExtProc ConfigMaps with processing rules
32 | - Configures ExtProc security policies and authentication
33 | - Manages ExtProc deployments and their lifecycle
34 |
35 | #### Resource Management
36 | - Watches AI Gateway Custom Resources (CRs)
37 | - Creates and manages `EnvoyExtensionPolicy` resources
38 | - Configures `HTTPRoute` resources for request routing
39 | - Manages backend security policies and authentication
40 |
41 | #### Integration with Envoy Gateway
42 | - Works alongside Envoy Gateway Controller (not directly configuring Envoy)
43 | - Creates resources that Envoy Gateway translates into Envoy configuration
44 | - Manages AI-specific extensions and filters
45 | - Enables token-based rate limiting through metadata
46 |
47 | ### Envoy Gateway Controller
48 | - Manages the core Envoy configuration through xDS
49 | - Handles service discovery and load balancing
50 | - Manages TLS certificates
51 | - Translates Gateway API resources into Envoy configuration
52 |
53 | ## Configuration Flow
54 |
55 | ```mermaid
56 | sequenceDiagram
57 | participant User
58 | participant K8s as Kubernetes API
59 | participant Controller as AI Gateway Controller
60 | participant EG as Envoy Gateway
61 | participant Envoy as Envoy Proxy
62 |
63 | User->>K8s: Apply AI Gateway CR
64 | K8s->>Controller: Notify of new/updated CR
65 | Controller->>K8s: Create/Update ExtProc Resources
66 | Controller->>K8s: Create EnvoyExtensionPolicy
67 | Controller->>K8s: Create HTTPRoute
68 | EG->>K8s: Watch Gateway Resources
69 | EG->>Envoy: Push xDS Configuration
70 | ```
71 |
72 | The configuration flow shows how changes propagate through the system:
73 | 1. Users apply AI Gateway Custom Resources (CRs)
74 | 2. The AI Gateway Controller processes these CRs
75 | 3. It creates or updates necessary resources (ExtProc, EnvoyExtensionPolicy, HTTPRoute)
76 | 4. Envoy Gateway watches these resources
77 | 5. Finally, it pushes the configuration to Envoy Proxy via xDS
78 |
79 |
80 | ## Next Steps
81 |
82 | To learn more:
83 | - Understand the [Data Plane and Traffic Flow](./data-plane.md)
84 |
--------------------------------------------------------------------------------
/site/versioned_docs/version-0.1/concepts/architecture/index.md:
--------------------------------------------------------------------------------
1 | ---
2 | id: architecture
3 | title: Architecture
4 | sidebar_position: 2
5 | ---
6 |
7 | # Architecture
8 |
9 | This section provides a detailed look at the architectural components of Envoy AI Gateway. Understanding the architecture will help you better deploy, configure, and maintain your gateway installation.
10 |
11 | ## Overview
12 |
13 | Envoy AI Gateway follows a modern cloud-native architecture with distinct control and data planes. This separation of concerns allows for better scalability, maintainability, and flexibility in deployment options.
14 |
15 | Envoy AI Gateway integrates with Envoy Gateway for the control plane and Envoy Proxy for the data plane.
16 |
17 | ## Key Concepts
18 |
19 | ### Control Plane
20 | A control plane is a component that manages the configuration of the data plane. We utilize Envoy Gateway as a central control plane, and Envoy AI Gateway works in conjunction with it to manage the data plane configuration.
21 |
22 | ### Data Plane
23 | The data plane is the component that sits in the request path and processes the requests. In the context of Envoy AI Gateway, the data plane consists of Envoy Proxy and the AI Gateway external processor that processes the AI requests.
24 |
25 | ### Token Rate Limiting
26 | The major AI model endpoints return usage metrics called "tokens" per HTTP request. These tokens represent the computational resources consumed by the request. One of the major features of Envoy AI Gateway is rate limiting based on token usage instead of standard "requests per second" style rate limiting.
27 |
28 | We call such rate limiting "Token Rate Limiting" in our context, and the metrics that represent the token usage are called "Token Usage" or "Used Tokens".
29 |
30 | ## In This Section
31 |
32 | 1. [System Architecture Overview](./system-architecture.md)
33 | - High-level architecture overview
34 | - Control and data plane separation
35 | - Component interactions
36 |
37 | 2. [Control Plane](./control-plane.md)
38 | - AI Gateway Controller
39 | - Envoy Gateway Controller
40 | - Configuration management
41 | - Resource orchestration
42 |
43 | 3. [Data Plane](./data-plane.md)
44 | - External Processor functionality
45 | - Request processing flow
46 | - Provider integration
47 |
48 | ## What's Next
49 |
50 | After understanding the architecture:
51 | - Check out our [Getting Started](../../getting-started/index.md) guide for hands-on experience
52 |
--------------------------------------------------------------------------------
/site/versioned_docs/version-0.1/concepts/index.md:
--------------------------------------------------------------------------------
1 | ---
2 | id: concepts
3 | title: Concepts
4 | sidebar_position: 3
5 | ---
6 |
7 | # Concepts
8 |
9 | Welcome to the Concepts section of Envoy AI Gateway documentation. This section will help you understand the core components and how they work together to manage AI traffic effectively.
10 |
11 | ## Architecture
12 |
13 | - [System Architecture Overview](./architecture/system-architecture.md) - High-level overview of control and data planes
14 | - [Control Plane](./architecture/control-plane.md) - How configuration and management works
15 | - [Data Plane](./architecture/data-plane.md) - Request processing and traffic flow
16 |
17 | ## Resources
18 |
19 | - [Resources Overview](./resources.md) - Understanding the AI Gateway resources and their relationships
20 |
--------------------------------------------------------------------------------
/site/versioned_docs/version-0.1/concepts/resources.md:
--------------------------------------------------------------------------------
1 | ---
2 | id: resources
3 | title: Resources
4 | sidebar_position: 2
5 | ---
6 |
7 | # Resources
8 |
9 | The Envoy AI Gateway uses several custom resources to manage AI traffic. Here's an overview of the key resources and how they relate to each other:
10 |
11 | ## Resource Reference
12 |
13 | | Resource | Purpose | API Reference |
14 | |----------|---------|---------------|
15 | | AIGatewayRoute | Defines unified API and routing rules for AI traffic | [AIGatewayRoute](../api/api.mdx#aigatewayroute) |
16 | | AIServiceBackend | Represents individual AI service backends | [AIServiceBackend](../api/api.mdx#aiservicebackend) |
17 | | BackendSecurityPolicy | Configures authentication for backend access | [BackendSecurityPolicy](../api/api.mdx#backendsecuritypolicy) |
18 |
19 | ## Core Resources
20 |
21 | ### AIGatewayRoute
22 |
23 | A resource that defines a unified AI API for a Gateway, allowing clients to interact with multiple AI backends using a single schema.
24 | - Specifies the input API schema for client requests
25 | - Contains routing rules to direct traffic to appropriate backends
26 | - Manages request/response transformations between different API schemas
27 | - Can track LLM request costs (like token usage)
28 |
29 | ### AIServiceBackend
30 |
31 | Represents a single AI service backend that handles traffic with a specific API schema.
32 |
33 | - Defines the output API schema the backend expects
34 | - References a Kubernetes Service or Envoy Gateway Backend
35 | - Can reference a BackendSecurityPolicy for authentication
36 |
37 | ### BackendSecurityPolicy
38 |
39 | Configures authentication and authorization rules for backend access.
40 |
41 | - API Key authentication
42 | - AWS credentials authentication
43 |
44 | ## Resource Relationships
45 |
46 | ```mermaid
47 | graph TD
48 | A[AIGatewayRoute] -->|references| B[AIServiceBackend]
49 | B -->|references| C[K8s Service/Backend]
50 | B -->|references| D[BackendSecurityPolicy]
51 | D -->|contains| E[API Key/AWS Credentials]
52 | ```
53 |
54 | The AIGatewayRoute acts as the entry point, defining how client requests are processed and routed to one or more AIServiceBackends. Each AIServiceBackend can reference a BackendSecurityPolicy, which provides the necessary credentials for accessing the underlying AI service.
55 |
--------------------------------------------------------------------------------
/site/versioned_docs/version-0.1/getting-started/connect-providers/aws-bedrock.md:
--------------------------------------------------------------------------------
1 | ---
2 | id: aws-bedrock
3 | title: Connect AWS Bedrock
4 | sidebar_position: 3
5 | ---
6 |
7 | # Connect AWS Bedrock
8 |
9 | This guide will help you configure Envoy AI Gateway to work with AWS Bedrock's foundation models.
10 |
11 | ## Prerequisites
12 |
13 | Before you begin, you'll need:
14 | - AWS credentials with access to Bedrock
15 | - Basic setup completed from the [Basic Usage](../basic-usage.md) guide
16 | - Basic configuration removed as described in the [Advanced Configuration](./index.md) overview
17 |
18 | ## AWS Credentials Setup
19 |
20 | Ensure you have:
21 | 1. An AWS account with Bedrock access enabled
22 | 2. AWS credentials with permissions to:
23 | - `bedrock:InvokeModel`
24 | - `bedrock:ListFoundationModels`
25 | 3. Your AWS access key ID and secret access key
26 | 4. Enabled model access to "Llama 3.2 1B Instruct" in the `us-east-1` region
27 | - If you want to use a different AWS region, you must update all instances of the string
28 | `us-east-1` with the desired region in `basic.yaml`.
29 |
30 | :::tip AWS Best Practices
31 | Consider using AWS IAM roles and limited-scope credentials for production environments.
32 | :::
33 |
34 | ## Configuration Steps
35 |
36 | :::info Ready to proceed?
37 | Ensure you have followed the steps in [Connect Providers](../connect-providers/)
38 | :::
39 |
40 | ### 1. Configure AWS Credentials
41 |
42 | Edit the `basic.yaml` file to replace these placeholder values:
43 | - `AWS_ACCESS_KEY_ID`: Your AWS access key ID
44 | - `AWS_SECRET_ACCESS_KEY`: Your AWS secret access key
45 |
46 | :::caution Security Note
47 | Make sure to keep your AWS credentials secure and never commit them to version control.
48 | The credentials will be stored in Kubernetes secrets.
49 | :::
50 |
51 | ### 2. Apply Configuration
52 |
53 | Apply the updated configuration and wait for the Gateway pod to be ready. If you already have a Gateway running,
54 | then the secret credential update will be picked up automatically in a few seconds.
55 |
56 | ```shell
57 | kubectl apply -f basic.yaml
58 |
59 | kubectl wait pods --timeout=2m \
60 | -l gateway.envoyproxy.io/owning-gateway-name=envoy-ai-gateway-basic \
61 | -n envoy-gateway-system \
62 | --for=condition=Ready
63 | ```
64 |
65 | ### 4. Test the Configuration
66 |
67 | You should have set `$GATEWAY_URL` as part of the basic setup before connecting to providers.
68 | See the [Basic Usage](../basic-usage.md) page for instructions.
69 |
70 | ```shell
71 | curl -H "Content-Type: application/json" \
72 | -d '{
73 | "model": "us.meta.llama3-2-1b-instruct-v1:0",
74 | "messages": [
75 | {
76 | "role": "user",
77 | "content": "Hi."
78 | }
79 | ]
80 | }' \
81 | $GATEWAY_URL/v1/chat/completions
82 | ```
83 |
84 | ## Troubleshooting
85 |
86 | If you encounter issues:
87 |
88 | 1. Verify your AWS credentials are correct and active
89 | 2. Check pod status:
90 | ```shell
91 | kubectl get pods -n envoy-gateway-system
92 | ```
93 | 3. View controller logs:
94 | ```shell
95 | kubectl logs -n envoy-ai-gateway-system deployment/ai-gateway-controller
96 | ```
97 | 4. Common errors:
98 | - 401/403: Invalid credentials or insufficient permissions
99 | - 404: Model not found or not available in region
100 | - 429: Rate limit exceeded
101 |
--------------------------------------------------------------------------------
/site/versioned_docs/version-0.1/getting-started/connect-providers/index.md:
--------------------------------------------------------------------------------
1 | ---
2 | id: connect-providers
3 | title: Connect Providers
4 | sidebar_position: 5
5 | ---
6 |
7 | # Connect Providers
8 |
9 | After setting up the basic AI Gateway with the mock backend, you can configure it to work with real AI model providers. This section will guide you through connecting different AI providers to your gateway.
10 |
11 | ## Available Providers
12 |
13 | Currently, Envoy AI Gateway supports the following providers:
14 |
15 | - [OpenAI](./openai.md) - Connect to OpenAI's GPT models
16 | - [AWS Bedrock](./aws-bedrock.md) - Access AWS Bedrock's suite of foundation models
17 |
18 | ## Before You Begin
19 |
20 | Before configuring any provider:
21 |
22 | 1. Complete the [Basic Usage](../basic-usage.md) guide
23 | 2. Remove the basic configuration with the mock backend
24 |
25 | ```shell
26 | kubectl delete -f https://raw.githubusercontent.com/envoyproxy/ai-gateway/refs/tags/v0.1.5/examples/basic/basic.yaml
27 |
28 | kubectl wait pods --timeout=15s \
29 | -l gateway.envoyproxy.io/owning-gateway-name=envoy-ai-gateway-basic \
30 | -n envoy-gateway-system \
31 | --for=delete
32 | ```
33 |
34 | 3. Download configuration template
35 |
36 | ```shell
37 | curl -O https://raw.githubusercontent.com/envoyproxy/ai-gateway/refs/tags/v0.1.5/examples/basic/basic.yaml
38 | ```
39 |
40 | ## Security Best Practices
41 |
42 | When configuring AI providers, keep these security considerations in mind:
43 |
44 | - Store credentials securely using Kubernetes secrets
45 | - Never commit API keys or credentials to version control
46 | - Regularly rotate your credentials
47 | - Use the principle of least privilege when setting up access
48 | - Monitor usage and set up appropriate rate limits
49 |
50 | ## Next Steps
51 |
52 | Choose your provider to get started:
53 | - [Connect OpenAI](./openai.md)
54 | - [Connect AWS Bedrock](./aws-bedrock.md)
55 |
--------------------------------------------------------------------------------
/site/versioned_docs/version-0.1/getting-started/connect-providers/openai.md:
--------------------------------------------------------------------------------
1 | ---
2 | id: openai
3 | title: Connect OpenAI
4 | sidebar_position: 2
5 | ---
6 |
7 | # Connect OpenAI
8 |
9 | This guide will help you configure Envoy AI Gateway to work with OpenAI's models.
10 |
11 | ## Prerequisites
12 |
13 | Before you begin, you'll need:
14 |
15 | - An OpenAI API key from [OpenAI's platform](https://platform.openai.com)
16 | - Basic setup completed from the [Basic Usage](../basic-usage.md) guide
17 | - Basic configuration removed as described in the [Advanced Configuration](./index.md) overview
18 |
19 | ## Configuration Steps
20 |
21 | :::info Ready to proceed?
22 | Ensure you have followed the steps in [Connect Providers](../connect-providers/)
23 | :::
24 |
25 | ### 1. Configure OpenAI Credentials
26 |
27 | Edit the `basic.yaml` file to replace the OpenAI placeholder value:
28 |
29 | - Find the section containing `OPENAI_API_KEY`
30 | - Replace it with your actual OpenAI API key
31 |
32 | :::caution Security Note
33 | Make sure to keep your API key secure and never commit it to version control.
34 | The key will be stored in a Kubernetes secret.
35 | :::
36 |
37 | ### 2. Apply Configuration
38 |
39 | Apply the updated configuration and wait for the Gateway pod to be ready. If you already have a Gateway running,
40 | then the secret credential update will be picked up automatically in a few seconds.
41 |
42 | ```shell
43 | kubectl apply -f basic.yaml
44 |
45 | kubectl wait pods --timeout=2m \
46 | -l gateway.envoyproxy.io/owning-gateway-name=envoy-ai-gateway-basic \
47 | -n envoy-gateway-system \
48 | --for=condition=Ready
49 | ```
50 |
51 | ### 3. Test the Configuration
52 |
53 | You should have set `$GATEWAY_URL` as part of the basic setup before connecting to providers.
54 | See the [Basic Usage](../basic-usage.md) page for instructions.
55 |
56 | ```shell
57 | curl -H "Content-Type: application/json" \
58 | -d '{
59 | "model": "gpt-4o-mini",
60 | "messages": [
61 | {
62 | "role": "user",
63 | "content": "Hi."
64 | }
65 | ]
66 | }' \
67 | $GATEWAY_URL/v1/chat/completions
68 | ```
69 |
70 | ## Troubleshooting
71 |
72 | If you encounter issues:
73 |
74 | 1. Verify your API key is correct and active
75 |
76 | 2. Check pod status:
77 |
78 | ```shell
79 | kubectl get pods -n envoy-gateway-system
80 | ```
81 |
82 | 3. View controller logs:
83 |
84 | ```shell
85 | kubectl logs -n envoy-ai-gateway-system deployment/ai-gateway-controller
86 | ```
87 |
88 | 4. View External Processor Logs
89 |
90 | ```shell
91 | kubectl logs services/ai-eg-route-extproc-envoy-ai-gateway-basic
92 | ```
93 |
94 | 5. Common errors:
95 | - 401: Invalid API key
96 | - 429: Rate limit exceeded
97 | - 503: OpenAI service unavailable
98 |
99 | ## Next Steps
100 |
101 | After configuring OpenAI:
102 |
103 | - [Connect AWS Bedrock](./aws-bedrock.md) to add another provider
104 |
--------------------------------------------------------------------------------
/site/versioned_docs/version-0.1/getting-started/index.md:
--------------------------------------------------------------------------------
1 | ---
2 | id: getting-started
3 | title: Getting Started
4 | sidebar_position: 2
5 | ---
6 |
7 | # Getting Started with Envoy AI Gateway
8 |
9 | Welcome to the Envoy AI Gateway getting started guide!
10 |
11 | This guide will walk you through setting up and using Envoy AI Gateway, a tool for managing GenAI traffic using Envoy.
12 |
13 | ## Guide Structure
14 |
15 | This getting started guide is organized into several sections:
16 |
17 | 1. [Prerequisites](./prerequisites.md)
18 | - Setting up your Kubernetes cluster
19 | - Installing required tools
20 | - Setting up Envoy Gateway
21 |
22 | 2. [Installation](./installation.md)
23 | - Installing Envoy AI Gateway
24 | - Configuring the gateway
25 | - Verifying the installation
26 |
27 | 3. [Basic Usage](./basic-usage.md)
28 | - Deploying a basic configuration
29 | - Making your first request
30 | - Understanding the response format
31 |
32 | 4. [Connect Providers](./connect-providers)
33 | - Setting up OpenAI integration
34 | - Configuring AWS Bedrock
35 | - Managing credentials securely
36 |
37 | ## Quick Start
38 |
39 | If you're familiar with Kubernetes and want to get started quickly, run these commands to install Envoy Gateway, Envoy AI Gateway, and deploy a basic configuration:
40 |
41 | ```shell
42 | helm upgrade -i eg oci://docker.io/envoyproxy/gateway-helm \
43 | --version v1.3.1 \
44 | --namespace envoy-gateway-system \
45 | --create-namespace
46 |
47 | helm upgrade -i aieg oci://docker.io/envoyproxy/ai-gateway-helm \
48 | --version v0.1.5 \
49 | --namespace envoy-ai-gateway-system \
50 | --create-namespace
51 |
52 | kubectl apply -f https://raw.githubusercontent.com/envoyproxy/ai-gateway/refs/tags/v0.1.5/examples/basic/basic.yaml
53 |
54 | kubectl wait --timeout=2m -n envoy-gateway-system deployment/envoy-gateway --for=condition=Available
55 | kubectl wait --timeout=2m -n envoy-ai-gateway-system deployment/ai-gateway-controller --for=condition=Available
56 | ```
57 |
58 | ### Make a request
59 |
60 | Check out Making a Request in the [Basic Usage Guide](./basic-usage.md)
61 |
62 | :::tip
63 |
64 | For detailed instructions and explanations, start with the [Prerequisites](./prerequisites.md) section.
65 |
66 | :::
67 |
68 | ## Need Help?
69 |
70 | If you run into any issues:
71 | - Join our [Community Slack](https://envoyproxy.slack.com/archives/C07Q4N24VAA)
72 | - File an issue on [GitHub](https://github.com/envoyproxy/ai-gateway/issues)
73 |
--------------------------------------------------------------------------------
/site/versioned_docs/version-0.1/getting-started/installation.md:
--------------------------------------------------------------------------------
1 | ---
2 | id: installation
3 | title: Installation
4 | sidebar_position: 3
5 | ---
6 |
7 | import Tabs from '@theme/Tabs';
8 | import TabItem from '@theme/TabItem';
9 |
10 | This guide will walk you through installing Envoy AI Gateway and its required components.
11 |
12 | ## Installing Envoy AI Gateway
13 |
14 | The easiest way to install Envoy AI Gateway is using the Helm chart. First, install the AI Gateway Helm chart and wait for the deployment to be ready:
15 |
16 | ```shell
17 | helm upgrade -i aieg oci://docker.io/envoyproxy/ai-gateway-helm \
18 | --version v0.1.5 \
19 | --namespace envoy-ai-gateway-system \
20 | --create-namespace
21 |
22 | kubectl wait --timeout=2m -n envoy-ai-gateway-system deployment/ai-gateway-controller --for=condition=Available
23 | ```
24 |
25 | ## Configuring Envoy Gateway
26 |
27 | After installing Envoy AI Gateway, apply the AI Gateway-specific configuration to Envoy Gateway, restart the deployment, and wait for it to be ready:
28 |
29 | ```shell
30 | kubectl apply -f https://raw.githubusercontent.com/envoyproxy/ai-gateway/refs/tags/v0.1.5/manifests/envoy-gateway-config/redis.yaml
31 | kubectl apply -f https://raw.githubusercontent.com/envoyproxy/ai-gateway/refs/tags/v0.1.5/manifests/envoy-gateway-config/config.yaml
32 | kubectl apply -f https://raw.githubusercontent.com/envoyproxy/ai-gateway/refs/tags/v0.1.5/manifests/envoy-gateway-config/rbac.yaml
33 |
34 | kubectl rollout restart -n envoy-gateway-system deployment/envoy-gateway
35 |
36 | kubectl wait --timeout=2m -n envoy-gateway-system deployment/envoy-gateway --for=condition=Available
37 | ```
38 |
39 | Note that the redis configuration is only used for the rate limiting feature. If you don't need rate limiting, you can skip the redis configuration,
40 | but you need to remove the relevant configuration in the `config.yaml` file as well.
41 |
42 | :::tip Verify Installation
43 |
44 | Check the status of the pods. All pods should be in the `Running` state with `Ready` status.
45 |
46 | Check AI Gateway pods:
47 | ```shell
48 | kubectl get pods -n envoy-ai-gateway-system
49 | ```
50 |
51 | Check Envoy Gateway pods:
52 | ```shell
53 | kubectl get pods -n envoy-gateway-system
54 | ```
55 |
56 | :::
57 |
58 | ## Next Steps
59 |
60 | After completing the installation:
61 | - Continue to [Basic Usage](./basic-usage.md) to learn how to make your first request
62 | - Or jump to [Connect Providers](./connect-providers) to set up OpenAI and AWS Bedrock integration
63 |
--------------------------------------------------------------------------------
/site/versioned_sidebars/version-0.1-sidebars.json:
--------------------------------------------------------------------------------
1 | {
2 | "tutorialSidebar": [
3 | {
4 | "type": "autogenerated",
5 | "dirName": "."
6 | }
7 | ]
8 | }
9 |
--------------------------------------------------------------------------------
/site/versions.json:
--------------------------------------------------------------------------------
1 | [
2 | "0.1"
3 | ]
4 |
--------------------------------------------------------------------------------
/tests/README.md:
--------------------------------------------------------------------------------
1 | This directory contains various integration tests. Each directory
2 | corresponds to `make test-
` target.
3 |
--------------------------------------------------------------------------------
/tests/crdcel/testdata/aigatewayroutes/basic.yaml:
--------------------------------------------------------------------------------
1 | # Copyright Envoy AI Gateway Authors
2 | # SPDX-License-Identifier: Apache-2.0
3 | # The full text of the Apache license is available in the LICENSE file at
4 | # the root of the repo.
5 |
6 | apiVersion: aigateway.envoyproxy.io/v1alpha1
7 | kind: AIGatewayRoute
8 | metadata:
9 | name: apple
10 | namespace: default
11 | spec:
12 | schema:
13 | name: OpenAI
14 | targetRefs:
15 | - name: some-gateway
16 | kind: Gateway
17 | group: gateway.networking.k8s.io
18 | rules:
19 | - matches:
20 | - headers:
21 | - type: Exact
22 | name: x-ai-eg-model
23 | value: llama3-70b
24 | backendRefs:
25 | - name: kserve
26 | weight: 20
27 | - name: aws-bedrock
28 | weight: 40
29 | - name: azure-openai
30 | weight: 40
31 |
--------------------------------------------------------------------------------
/tests/crdcel/testdata/aigatewayroutes/llmcosts.yaml:
--------------------------------------------------------------------------------
1 | # Copyright Envoy AI Gateway Authors
2 | # SPDX-License-Identifier: Apache-2.0
3 | # The full text of the Apache license is available in the LICENSE file at
4 | # the root of the repo.
5 |
6 | apiVersion: aigateway.envoyproxy.io/v1alpha1
7 | kind: AIGatewayRoute
8 | metadata:
9 | name: llmcosts
10 | namespace: default
11 | spec:
12 | schema:
13 | name: OpenAI
14 | targetRefs:
15 | - name: some-gateway
16 | kind: Gateway
17 | group: gateway.networking.k8s.io
18 | rules:
19 | - matches:
20 | - headers:
21 | - type: Exact
22 | name: x-ai-eg-model
23 | value: llama3-70b
24 | backendRefs:
25 | - name: kserve
26 | weight: 20
27 | - name: aws-bedrock
28 | weight: 40
29 | - name: azure-openai
30 | weight: 40
31 | llmRequestCosts:
32 | - metadataKey: llm_input_token
33 | type: InputToken
34 | - metadataKey: llm_output_token
35 | type: OutputToken
36 | - metadataKey: llm_total_token
37 | type: TotalToken
38 | - metadataKey: some_cel_cost
39 | type: CEL
40 | cel: "llm_input_token + llm_output_token + llm_total_token"
41 |
--------------------------------------------------------------------------------
/tests/crdcel/testdata/aigatewayroutes/no_target_refs.yaml:
--------------------------------------------------------------------------------
1 | # Copyright Envoy AI Gateway Authors
2 | # SPDX-License-Identifier: Apache-2.0
3 | # The full text of the Apache license is available in the LICENSE file at
4 | # the root of the repo.
5 |
6 | apiVersion: aigateway.envoyproxy.io/v1alpha1
7 | kind: AIGatewayRoute
8 | metadata:
9 | name: apple
10 | namespace: default
11 | spec:
12 | targetRefs: []
13 | schema:
14 | name: OpenAI
15 | rules:
16 | - matches:
17 | - headers:
18 | - type: Exact
19 | name: x-ai-eg-model
20 | value: llama3-70b
21 | backendRefs:
22 | - name: kserve
23 | weight: 20
24 | - name: aws-bedrock
25 | weight: 40
26 | - name: azure-openai
27 | weight: 40
28 |
--------------------------------------------------------------------------------
/tests/crdcel/testdata/aigatewayroutes/non_openai_schema.yaml:
--------------------------------------------------------------------------------
1 | # Copyright Envoy AI Gateway Authors
2 | # SPDX-License-Identifier: Apache-2.0
3 | # The full text of the Apache license is available in the LICENSE file at
4 | # the root of the repo.
5 |
6 | apiVersion: aigateway.envoyproxy.io/v1alpha1
7 | kind: AIGatewayRoute
8 | metadata:
9 | name: apple
10 | namespace: default
11 | spec:
12 | schema:
13 | # Schema name must be OpenAI schema at the moment, so this is invalid.
14 | name: AWSBedrock
15 | targetRefs:
16 | - name: some-gateway
17 | kind: Gateway
18 | group: gateway.networking.k8s.io
19 | rules:
20 | - matches:
21 | - headers:
22 | - type: Exact
23 | name: x-ai-eg-model
24 | value: llama3-70b
25 | backendRefs:
26 | - name: kserve
27 | weight: 20
28 | - name: aws-bedrock
29 | weight: 80
30 |
--------------------------------------------------------------------------------
/tests/crdcel/testdata/aigatewayroutes/unknown_schema.yaml:
--------------------------------------------------------------------------------
1 | # Copyright Envoy AI Gateway Authors
2 | # SPDX-License-Identifier: Apache-2.0
3 | # The full text of the Apache license is available in the LICENSE file at
4 | # the root of the repo.
5 |
6 | apiVersion: aigateway.envoyproxy.io/v1alpha1
7 | kind: AIGatewayRoute
8 | metadata:
9 | name: apple
10 | namespace: default
11 | spec:
12 | schema:
13 | # Schema name must be OpenAI schema at the moment, so this is invalid.
14 | name: SomeRandomVendor
15 | targetRefs:
16 | - name: some-gateway
17 | kind: Gateway
18 | group: gateway.networking.k8s.io
19 | rules:
20 | - matches:
21 | - headers:
22 | - type: Exact
23 | name: x-ai-eg-model
24 | value: llama3-70b
25 | backendRefs:
26 | - name: kserve
27 | weight: 20
28 | - name: aws-bedrock
29 | weight: 80
30 |
--------------------------------------------------------------------------------
/tests/crdcel/testdata/aigatewayroutes/unsupported_match.yaml:
--------------------------------------------------------------------------------
1 | # Copyright Envoy AI Gateway Authors
2 | # SPDX-License-Identifier: Apache-2.0
3 | # The full text of the Apache license is available in the LICENSE file at
4 | # the root of the repo.
5 |
6 | apiVersion: aigateway.envoyproxy.io/v1alpha1
7 | kind: AIGatewayRoute
8 | metadata:
9 | name: apple
10 | namespace: default
11 | spec:
12 | schema:
13 | name: OpenAI
14 | targetRefs:
15 | - name: some-gateway
16 | kind: Gateway
17 | group: gateway.networking.k8s.io
18 | rules:
19 | - matches:
20 | - headers:
21 | - type: RegularExpression
22 | name: x-ai-eg-model
23 | value: llama3-70b
24 | backendRefs:
25 | - name: kserve
26 | weight: 20
27 | - name: aws-bedrock
28 | weight: 80
29 |
--------------------------------------------------------------------------------
/tests/crdcel/testdata/aiservicebackends/basic-eg-backend-aws.yaml:
--------------------------------------------------------------------------------
1 | # Copyright Envoy AI Gateway Authors
2 | # SPDX-License-Identifier: Apache-2.0
3 | # The full text of the Apache license is available in the LICENSE file at
4 | # the root of the repo.
5 |
6 | apiVersion: aigateway.envoyproxy.io/v1alpha1
7 | kind: AIServiceBackend
8 | metadata:
9 | name: eg-backend
10 | namespace: default
11 | spec:
12 | schema:
13 | name: AWSBedrock
14 | backendRef:
15 | name: eg-backend
16 | kind: Backend
17 | group: gateway.envoyproxy.io
18 |
--------------------------------------------------------------------------------
/tests/crdcel/testdata/aiservicebackends/basic-eg-backend-azure.yaml:
--------------------------------------------------------------------------------
1 | # Copyright Envoy AI Gateway Authors
2 | # SPDX-License-Identifier: Apache-2.0
3 | # The full text of the Apache license is available in the LICENSE file at
4 | # the root of the repo.
5 |
6 | apiVersion: aigateway.envoyproxy.io/v1alpha1
7 | kind: AIServiceBackend
8 | metadata:
9 | name: eg-backend
10 | namespace: default
11 | spec:
12 | schema:
13 | name: AzureOpenAI
14 | backendRef:
15 | name: eg-backend
16 | kind: Backend
17 | group: gateway.envoyproxy.io
18 |
--------------------------------------------------------------------------------
/tests/crdcel/testdata/aiservicebackends/basic.yaml:
--------------------------------------------------------------------------------
1 | # Copyright Envoy AI Gateway Authors
2 | # SPDX-License-Identifier: Apache-2.0
3 | # The full text of the Apache license is available in the LICENSE file at
4 | # the root of the repo.
5 |
6 | apiVersion: aigateway.envoyproxy.io/v1alpha1
7 | kind: AIServiceBackend
8 | metadata:
9 | name: dog-backend
10 | namespace: default
11 | spec:
12 | schema:
13 | name: AWSBedrock
14 | backendRef:
15 | name: dog-service
16 | kind: Service
17 | port: 80
18 |
--------------------------------------------------------------------------------
/tests/crdcel/testdata/aiservicebackends/unknown_schema.yaml:
--------------------------------------------------------------------------------
1 | # Copyright Envoy AI Gateway Authors
2 | # SPDX-License-Identifier: Apache-2.0
3 | # The full text of the Apache license is available in the LICENSE file at
4 | # the root of the repo.
5 |
6 | apiVersion: aigateway.envoyproxy.io/v1alpha1
7 | kind: AIServiceBackend
8 | metadata:
9 | name: cat-backend
10 | namespace: default
11 | spec:
12 | schema:
13 | # Name must be one of the known schemas, so this is invalid.
14 | name: SomeRandomVendor
15 |
--------------------------------------------------------------------------------
/tests/crdcel/testdata/backendsecuritypolicies/aws_credential_file.yaml:
--------------------------------------------------------------------------------
1 | # Copyright Envoy AI Gateway Authors
2 | # SPDX-License-Identifier: Apache-2.0
3 | # The full text of the Apache license is available in the LICENSE file at
4 | # the root of the repo.
5 |
6 | apiVersion: aigateway.envoyproxy.io/v1alpha1
7 | kind: BackendSecurityPolicy
8 | metadata:
9 | name: dog-provider-policy
10 | namespace: default
11 | spec:
12 | type: AWSCredentials
13 | awsCredentials:
14 | region: us-east-1
15 | credentialsFile:
16 | secretRef:
17 | name: placeholder
18 |
--------------------------------------------------------------------------------
/tests/crdcel/testdata/backendsecuritypolicies/aws_oidc.yaml:
--------------------------------------------------------------------------------
1 | # Copyright Envoy AI Gateway Authors
2 | # SPDX-License-Identifier: Apache-2.0
3 | # The full text of the Apache license is available in the LICENSE file at
4 | # the root of the repo.
5 |
6 | apiVersion: aigateway.envoyproxy.io/v1alpha1
7 | kind: BackendSecurityPolicy
8 | metadata:
9 | name: dog-provider-policy
10 | namespace: default
11 | spec:
12 | type: AWSCredentials
13 | awsCredentials:
14 | region: us-east-1
15 | oidcExchangeToken:
16 | awsRoleArn: placeholder
17 | oidc:
18 | provider:
19 | issuer: placeholder
20 | clientID: placeholder
21 | clientSecret:
22 | name: placeholder
23 |
--------------------------------------------------------------------------------
/tests/crdcel/testdata/backendsecuritypolicies/azure_credentials_missing_client_id.yaml:
--------------------------------------------------------------------------------
1 | # Copyright Envoy AI Gateway Authors
2 | # SPDX-License-Identifier: Apache-2.0
3 | # The full text of the Apache license is available in the LICENSE file at
4 | # the root of the repo.
5 |
6 | apiVersion: aigateway.envoyproxy.io/v1alpha1
7 | kind: BackendSecurityPolicy
8 | metadata:
9 | name: dog-provider-policy
10 | namespace: default
11 | spec:
12 | type: AzureCredentials
13 | azureCredentials:
14 | tenantID: dummy_azure_tenant_id
15 | clientSecretRef:
16 | name: dummy_azure_secret_ref_name
17 |
--------------------------------------------------------------------------------
/tests/crdcel/testdata/backendsecuritypolicies/azure_credentials_missing_tenant_id.yaml:
--------------------------------------------------------------------------------
1 | # Copyright Envoy AI Gateway Authors
2 | # SPDX-License-Identifier: Apache-2.0
3 | # The full text of the Apache license is available in the LICENSE file at
4 | # the root of the repo.
5 |
6 | apiVersion: aigateway.envoyproxy.io/v1alpha1
7 | kind: BackendSecurityPolicy
8 | metadata:
9 | name: dog-provider-policy
10 | namespace: default
11 | spec:
12 | type: AzureCredentials
13 | azureCredentials:
14 | clientID: dummy_azure_client_id
15 | clientSecretRef:
16 | name: dummy_azure_secret_ref_name
17 |
--------------------------------------------------------------------------------
/tests/crdcel/testdata/backendsecuritypolicies/azure_missing_auth.yaml:
--------------------------------------------------------------------------------
1 | # Copyright Envoy AI Gateway Authors
2 | # SPDX-License-Identifier: Apache-2.0
3 | # The full text of the Apache license is available in the LICENSE file at
4 | # the root of the repo.
5 |
6 | apiVersion: aigateway.envoyproxy.io/v1alpha1
7 | kind: BackendSecurityPolicy
8 | metadata:
9 | name: azure-missing-provider-policy
10 | namespace: default
11 | spec:
12 | type: AzureCredentials
13 | azureCredentials:
14 | clientID: dummy_azure_client_id
15 | tenantID: dummy_azure_tenant_id
16 |
--------------------------------------------------------------------------------
/tests/crdcel/testdata/backendsecuritypolicies/azure_multiple_auth.yaml:
--------------------------------------------------------------------------------
1 | # Copyright Envoy AI Gateway Authors
2 | # SPDX-License-Identifier: Apache-2.0
3 | # The full text of the Apache license is available in the LICENSE file at
4 | # the root of the repo.
5 |
6 | apiVersion: aigateway.envoyproxy.io/v1alpha1
7 | kind: BackendSecurityPolicy
8 | metadata:
9 | name: azure-multiple-auth-provider-policy
10 | namespace: default
11 | spec:
12 | type: AzureCredentials
13 | azureCredentials:
14 | clientID: dummy_azure_client_id
15 | tenantID: dummy_azure_tenant_id
16 | clientSecretRef:
17 | name: dummy_azure_secret_ref_name
18 | oidcExchangeToken:
19 | oidc:
20 | provider:
21 | issuer: placeholder
22 | clientID: placeholder
23 | clientSecret:
24 | name: placeholder
25 |
--------------------------------------------------------------------------------
/tests/crdcel/testdata/backendsecuritypolicies/azure_oidc.yaml:
--------------------------------------------------------------------------------
1 | # Copyright Envoy AI Gateway Authors
2 | # SPDX-License-Identifier: Apache-2.0
3 | # The full text of the Apache license is available in the LICENSE file at
4 | # the root of the repo.
5 |
6 | apiVersion: aigateway.envoyproxy.io/v1alpha1
7 | kind: BackendSecurityPolicy
8 | metadata:
9 | name: bird-provider-policy
10 | namespace: default
11 | spec:
12 | type: AzureCredentials
13 | azureCredentials:
14 | clientID: dummy_azure_client_id
15 | tenantID: dummy_azure_tenant_id
16 | oidcExchangeToken:
17 | oidc:
18 | provider:
19 | issuer: placeholder
20 | clientID: placeholder
21 | clientSecret:
22 | name: placeholder
23 |
--------------------------------------------------------------------------------
/tests/crdcel/testdata/backendsecuritypolicies/azure_valid_credentials.yaml:
--------------------------------------------------------------------------------
1 | # Copyright Envoy AI Gateway Authors
2 | # SPDX-License-Identifier: Apache-2.0
3 | # The full text of the Apache license is available in the LICENSE file at
4 | # the root of the repo.
5 |
6 | apiVersion: aigateway.envoyproxy.io/v1alpha1
7 | kind: BackendSecurityPolicy
8 | metadata:
9 | name: dog-provider-policy
10 | namespace: default
11 | spec:
12 | type: AzureCredentials
13 | azureCredentials:
14 | clientID: dummy_azure_client_id
15 | tenantID: dummy_azure_tenant_id
16 | clientSecretRef:
17 | name: dummy_azure_secret_ref_name
18 |
--------------------------------------------------------------------------------
/tests/crdcel/testdata/backendsecuritypolicies/basic.yaml:
--------------------------------------------------------------------------------
1 | # Copyright Envoy AI Gateway Authors
2 | # SPDX-License-Identifier: Apache-2.0
3 | # The full text of the Apache license is available in the LICENSE file at
4 | # the root of the repo.
5 |
6 | apiVersion: aigateway.envoyproxy.io/v1alpha1
7 | kind: BackendSecurityPolicy
8 | metadata:
9 | name: dog-provider-policy
10 | namespace: default
11 | spec:
12 | type: APIKey
13 |
--------------------------------------------------------------------------------
/tests/crdcel/testdata/backendsecuritypolicies/missing_type.yaml:
--------------------------------------------------------------------------------
1 | # Copyright Envoy AI Gateway Authors
2 | # SPDX-License-Identifier: Apache-2.0
3 | # The full text of the Apache license is available in the LICENSE file at
4 | # the root of the repo.
5 |
6 | apiVersion: aigateway.envoyproxy.io/v1alpha1
7 | kind: BackendSecurityPolicy
8 | metadata:
9 | name: dog-provider-policy
10 | namespace: default
11 | spec:
12 | awsCredentials:
13 | region: us-east-1å
14 |
--------------------------------------------------------------------------------
/tests/crdcel/testdata/backendsecuritypolicies/multiple_security_policies.yaml:
--------------------------------------------------------------------------------
1 | # Copyright Envoy AI Gateway Authors
2 | # SPDX-License-Identifier: Apache-2.0
3 | # The full text of the Apache license is available in the LICENSE file at
4 | # the root of the repo.
5 |
6 | apiVersion: aigateway.envoyproxy.io/v1alpha1
7 | kind: BackendSecurityPolicy
8 | metadata:
9 | name: dog-provider-policy
10 | namespace: default
11 | spec:
12 | type: APIKey
13 | apiKey:
14 | secretRef:
15 | name: placeholder
16 | awsCredentials:
17 | region: us-east-1
18 |
--------------------------------------------------------------------------------
/tests/crdcel/testdata/backendsecuritypolicies/unknown_provider.yaml:
--------------------------------------------------------------------------------
1 | # Copyright Envoy AI Gateway Authors
2 | # SPDX-License-Identifier: Apache-2.0
3 | # The full text of the Apache license is available in the LICENSE file at
4 | # the root of the repo.
5 |
6 | apiVersion: aigateway.envoyproxy.io/v1alpha1
7 | kind: BackendSecurityPolicy
8 | metadata:
9 | name: dog-provider-policy
10 | namespace: default
11 | spec:
12 | type: UnknownType
13 |
--------------------------------------------------------------------------------
/tests/e2e/init/testupstream/manifest.yaml:
--------------------------------------------------------------------------------
1 | # Copyright Envoy AI Gateway Authors
2 | # SPDX-License-Identifier: Apache-2.0
3 | # The full text of the Apache license is available in the LICENSE file at
4 | # the root of the repo.
5 |
6 | apiVersion: apps/v1
7 | kind: Deployment
8 | metadata:
9 | name: testupstream
10 | namespace: default
11 | spec:
12 | replicas: 1
13 | selector:
14 | matchLabels:
15 | app: testupstream
16 | template:
17 | metadata:
18 | labels:
19 | app: testupstream
20 | spec:
21 | containers:
22 | - name: testupstream
23 | image: docker.io/envoyproxy/ai-gateway-testupstream:latest
24 | imagePullPolicy: IfNotPresent
25 | ports:
26 | - containerPort: 8080
27 | env:
28 | - name: TESTUPSTREAM_ID
29 | value: primary
30 | readinessProbe:
31 | httpGet:
32 | path: /health
33 | port: 8080
34 | initialDelaySeconds: 1
35 | periodSeconds: 1
36 | ---
37 | apiVersion: v1
38 | kind: Service
39 | metadata:
40 | name: testupstream
41 | namespace: default
42 | spec:
43 | selector:
44 | app: testupstream
45 | ports:
46 | - protocol: TCP
47 | port: 80
48 | targetPort: 8080
49 | type: ClusterIP
50 |
51 | ---
52 | apiVersion: apps/v1
53 | kind: Deployment
54 | metadata:
55 | name: testupstream-canary
56 | namespace: default
57 | spec:
58 | replicas: 1
59 | selector:
60 | matchLabels:
61 | app: testupstream-canary
62 | template:
63 | metadata:
64 | labels:
65 | app: testupstream-canary
66 | spec:
67 | containers:
68 | - name: testupstream-canary
69 | image: docker.io/envoyproxy/ai-gateway-testupstream:latest
70 | imagePullPolicy: IfNotPresent
71 | env:
72 | - name: TESTUPSTREAM_ID
73 | value: canary
74 | ports:
75 | - containerPort: 8080
76 | readinessProbe:
77 | httpGet:
78 | path: /health
79 | port: 8080
80 | initialDelaySeconds: 1
81 | periodSeconds: 1
82 | ---
83 | apiVersion: v1
84 | kind: Service
85 | metadata:
86 | name: testupstream-canary
87 | namespace: default
88 | spec:
89 | selector:
90 | app: testupstream-canary
91 | ports:
92 | - protocol: TCP
93 | port: 80
94 | targetPort: 8080
95 | type: ClusterIP
96 |
--------------------------------------------------------------------------------
/tests/e2e/testdata/translation_testupstream.yaml:
--------------------------------------------------------------------------------
1 | # Copyright Envoy AI Gateway Authors
2 | # SPDX-License-Identifier: Apache-2.0
3 | # The full text of the Apache license is available in the LICENSE file at
4 | # the root of the repo.
5 |
6 | apiVersion: gateway.networking.k8s.io/v1
7 | kind: GatewayClass
8 | metadata:
9 | name: translation-testupstream
10 | spec:
11 | controllerName: gateway.envoyproxy.io/gatewayclass-controller
12 | ---
13 | apiVersion: gateway.networking.k8s.io/v1
14 | kind: Gateway
15 | metadata:
16 | name: translation-testupstream
17 | namespace: default
18 | spec:
19 | gatewayClassName: translation-testupstream
20 | listeners:
21 | - name: http
22 | protocol: HTTP
23 | port: 80
24 | ---
25 | apiVersion: aigateway.envoyproxy.io/v1alpha1
26 | kind: AIGatewayRoute
27 | metadata:
28 | name: translation-testupstream
29 | namespace: default
30 | spec:
31 | schema:
32 | name: OpenAI
33 | targetRefs:
34 | - name: translation-testupstream
35 | kind: Gateway
36 | group: gateway.networking.k8s.io
37 | rules:
38 | - matches:
39 | - headers:
40 | - type: Exact
41 | name: x-ai-eg-model
42 | value: some-cool-model
43 | backendRefs:
44 | - name: translation-testupstream-cool-model-backend
45 | weight: 100
46 | - matches:
47 | - headers:
48 | - type: Exact
49 | name: x-ai-eg-model
50 | value: another-cool-model
51 | backendRefs:
52 | - name: translation-testupstream-another-cool-model-backend
53 | weight: 100
54 | ---
55 | apiVersion: aigateway.envoyproxy.io/v1alpha1
56 | kind: AIServiceBackend
57 | metadata:
58 | name: translation-testupstream-cool-model-backend
59 | namespace: default
60 | spec:
61 | schema:
62 | name: OpenAI
63 | backendRef:
64 | name: testupstream
65 | kind: Backend
66 | group: gateway.envoyproxy.io
67 | ---
68 | apiVersion: aigateway.envoyproxy.io/v1alpha1
69 | kind: AIServiceBackend
70 | metadata:
71 | name: translation-testupstream-another-cool-model-backend
72 | namespace: default
73 | spec:
74 | schema:
75 | name: AWSBedrock
76 | backendRef:
77 | name: testupstream-canary
78 | kind: Backend
79 | group: gateway.envoyproxy.io
80 | ---
81 | apiVersion: gateway.envoyproxy.io/v1alpha1
82 | kind: Backend
83 | metadata:
84 | name: testupstream
85 | namespace: default
86 | spec:
87 | endpoints:
88 | - fqdn:
89 | hostname: testupstream.default.svc.cluster.local
90 | port: 80
91 | ---
92 | apiVersion: gateway.envoyproxy.io/v1alpha1
93 | kind: Backend
94 | metadata:
95 | name: testupstream-canary
96 | namespace: default
97 | spec:
98 | endpoints:
99 | - fqdn:
100 | hostname: testupstream-canary.default.svc.cluster.local
101 | port: 80
102 |
--------------------------------------------------------------------------------
/tests/extproc/testdata/server.crt:
--------------------------------------------------------------------------------
1 | -----BEGIN CERTIFICATE-----
2 | MIIDazCCAlOgAwIBAgIUOSrQ5kL8uq0Uy4aVdSERQLFCttwwDQYJKoZIhvcNAQEL
3 | BQAwRTELMAkGA1UEBhMCQVUxEzARBgNVBAgMClNvbWUtU3RhdGUxITAfBgNVBAoM
4 | GEludGVybmV0IFdpZGdpdHMgUHR5IEx0ZDAeFw0yNTA1MDIwMjQwNDZaFw0yNjA1
5 | MDIwMjQwNDZaMEUxCzAJBgNVBAYTAkFVMRMwEQYDVQQIDApTb21lLVN0YXRlMSEw
6 | HwYDVQQKDBhJbnRlcm5ldCBXaWRnaXRzIFB0eSBMdGQwggEiMA0GCSqGSIb3DQEB
7 | AQUAA4IBDwAwggEKAoIBAQCZM1iByTyeiCHWP7RTeeXILPSx5TYpIch7q24m7k/M
8 | nGvqAlfig+81b4kI3H9Ga21cFThrGur/OG6HCMhdMKqC2tLWK6WFR4c/pc51r5ep
9 | Uh46Ul1zdW3uA2Tc7moYv//h42Nvm9bcfd8dD7RDhaL2scLW+zSvIjtp8FgcoBnN
10 | /h9LypsCJvuRjHcAm7fZfEmkfOppSJ8zVN7OIWpGXtpcF1qcgWhl0LhrkQ3U6lWS
11 | sX5oItTxsFsUvXDiiZRWp+ZYrS/Vgtb9m3KiSzF8YE08cxRmYUrb0BeYe8uakpUV
12 | SHAcuFdf8gG0w02tUZC8G5gW/4b2/8lPPfal10ORIM1VAgMBAAGjUzBRMB0GA1Ud
13 | DgQWBBSQvPvh83+cmXvrwuynobWcyxHQTTAfBgNVHSMEGDAWgBSQvPvh83+cmXvr
14 | wuynobWcyxHQTTAPBgNVHRMBAf8EBTADAQH/MA0GCSqGSIb3DQEBCwUAA4IBAQBg
15 | 6AB3FlY2iagYKpeR6Ww59/VLxE8gyxPORbNvhkMLUZPlrMBUr+KcYF9giMsgGZo3
16 | sr75vY/eohKW9ye18jIchS4yIyLypuN0AVAEd98P7dHGkFpQkxja5VYy8PpfZfA+
17 | gvXEEstFFqN4Ys3w5wIf8TIuGkuEgMu2gk6slfsT40jUZr4bXgNKWbl6KNbDoFTA
18 | f9wb6RNa66VmBmJFxJmsEwBH5ttmw5m8gBvpz31f9WcnFKaRe6T2BLy8cPwDowfw
19 | +X3QsH+6bJQ4fUXVNM2BGCcl4WPBC4YKcEc+qCx4xWH7wYxiVQlTgC9UUdeczTzM
20 | yJ2xUoXPM+W2MIVHj5Dd
21 | -----END CERTIFICATE-----
22 |
--------------------------------------------------------------------------------
/tests/extproc/testdata/server.key:
--------------------------------------------------------------------------------
1 | -----BEGIN PRIVATE KEY-----
2 | MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCZM1iByTyeiCHW
3 | P7RTeeXILPSx5TYpIch7q24m7k/MnGvqAlfig+81b4kI3H9Ga21cFThrGur/OG6H
4 | CMhdMKqC2tLWK6WFR4c/pc51r5epUh46Ul1zdW3uA2Tc7moYv//h42Nvm9bcfd8d
5 | D7RDhaL2scLW+zSvIjtp8FgcoBnN/h9LypsCJvuRjHcAm7fZfEmkfOppSJ8zVN7O
6 | IWpGXtpcF1qcgWhl0LhrkQ3U6lWSsX5oItTxsFsUvXDiiZRWp+ZYrS/Vgtb9m3Ki
7 | SzF8YE08cxRmYUrb0BeYe8uakpUVSHAcuFdf8gG0w02tUZC8G5gW/4b2/8lPPfal
8 | 10ORIM1VAgMBAAECggEAExuSWG2u/97eyYgch6TWggcJZf6+qJasGLCjBnwGu/Bu
9 | jTtJltj5xuJoZxCJV1EizK9g4Ar1cGurbXAs/WKKgdOlJE1BUcRAHDIj9A24jsfN
10 | OVz4huQIl/0YYW3jEb8wvQ3NYyg+vjV81HUW+Kz8TGSTdpjSU12jp2zwsHFPhp+Q
11 | AdvfO5gWJwpjn4tWZs36RpIF35s97/OdELNSUBCXcOedVLl7O2M+LOzXGC9k3FmN
12 | eLbRScHT7glqWq58W2uhFcH6XPHL3nJBwDfF0Au8R6tJ8qEXQhczv4Vw9qVqiKl/
13 | sKnLET4mw/7lqvQNcLdZkWRMKUuYuWtv4iiQVcFM6QKBgQDKjzJWjFR7v9fufTEN
14 | CqAKmag9kAlGNj4jN0Iuit26KLbdgMN29azcGGSVLCW+UEwhYXsCSgDANg7fDc7e
15 | qjCXP3plQkOybAVreeD8p1V2rYDCxGQXnQe9OYqKfr2fQ8+V1FX8HT+2OdyKK/Bh
16 | bVKz/xT3Qt3KyeUGFfNc3DPA3wKBgQDBnnhJvRAEc0sX5JmlqtTyS0aJWD3bzR9Y
17 | TIJPW3PcsW7zW4tVUV7A8m3tUi/7TLfc3G3B+bTQTdJS0IGdP3ocobcUBS30ZIuv
18 | w3U6ydgncTUKOnqquIkoHOKU+k8RECvcKCRaigCnfXrph/cggE5s7vSY7JOuUBmy
19 | kECG3HY0SwKBgQC+HOQ8Av2QICDEf8+3088d49XZ4gQyV9q+JrEBCejNPkVTY/UR
20 | A8g30tUkhQjvtGGfuuQ+48IMpTAT/du5dLaiXju8KhNrtKLpmrylpVA7UODW7Iic
21 | +Q84dHcpQYcrofOFRoNlWvZfS7NII7E7X+YNdk3xPFr6Z7+ClLuS3kHctQKBgARh
22 | nKE2iQVAwqNAxgVMr1LoRylWeNffdWUfHhfDnwSQc01IdgexNq6xDbHAGVvbaZGy
23 | 3zzzdJb+G9NJ6pTvWckKE8V9NIQCPnL0vlNdO+nwkt2vYxU35cqllK8AVwew0P1D
24 | X0c5NjiUC1L7g6kVnjCy25AWUmUwZNR4lS04EeivAoGAR+kG9I3kcm915yUDSFx7
25 | slkThh9ZR+y4rXaN8CMFyr/GXvtYjQOAZwkqch9JjZqhzEYeY8i8QqUexbAE2v3B
26 | MHCPAQC4o2WFQSHpWODUm00hGpibdMkJYE6V6YkoWuSV/pQx1v4N0F424Ng6aDuF
27 | gYzU7fbV8gfbrm9OhrkM7H8=
28 | -----END PRIVATE KEY-----
29 |
--------------------------------------------------------------------------------
/tests/internal/testupstreamlib/testupstream.go:
--------------------------------------------------------------------------------
1 | // Copyright Envoy AI Gateway Authors
2 | // SPDX-License-Identifier: Apache-2.0
3 | // The full text of the Apache license is available in the LICENSE file at
4 | // the root of the repo.
5 |
6 | package testupstreamlib
7 |
8 | const (
9 | // ResponseTypeKey is the key for the response type in the request.
10 | // This can be either empty, "sse", or "aws-event-stream".
11 | // * If this is "sse", the response body is expected to be a Server-Sent Event stream.
12 | // Each line in x-response-body is treated as a separate [data] payload.
13 | // * If this is "aws-event-stream", the response body is expected to be an AWS Event Stream.
14 | // Each line in x-response-body is treated as a separate event payload.
15 | // * If this is empty, the response body is expected to be a regular JSON response.
16 | ResponseTypeKey = "x-response-type"
17 | // ExpectedHeadersKey is the key for the expected headers in the request.
18 | // The value is a base64 encoded string of comma separated key-value pairs.
19 | // E.g. "key1:value1,key2:value2".
20 | ExpectedHeadersKey = "x-expected-headers"
21 | // ExpectedPathHeaderKey is the key for the expected path in the request.
22 | // The value is a base64 encoded.
23 | ExpectedPathHeaderKey = "x-expected-path"
24 | // ExpectedRequestBodyHeaderKey is the key for the expected request body in the request.
25 | // The value is a base64 encoded.
26 | ExpectedRequestBodyHeaderKey = "x-expected-request-body"
27 | // ResponseStatusKey is the key for the response status in the response, default is 200 if not set.
28 | ResponseStatusKey = "x-response-status"
29 | // ResponseHeadersKey is the key for the response headers in the response.
30 | // The value is a base64 encoded string of comma separated key-value pairs.
31 | // E.g. "key1:value1,key2:value2".
32 | ResponseHeadersKey = "x-response-headers"
33 | // ResponseBodyHeaderKey is the key for the response body in the response.
34 | // The value is a base64 encoded.
35 | ResponseBodyHeaderKey = "x-response-body"
36 | // NonExpectedRequestHeadersKey is the key for the non-expected request headers.
37 | // The value is a base64 encoded string of comma separated header keys expected to be absent.
38 | NonExpectedRequestHeadersKey = "x-non-expected-request-headers"
39 | // ExpectedTestUpstreamIDKey is the key for the expected testupstream-id in the request,
40 | // and the value will be compared with the TESTUPSTREAM_ID environment variable.
41 | // If the values do not match, the request will be rejected, meaning that the request
42 | // was routed to the wrong upstream.
43 | ExpectedTestUpstreamIDKey = "x-expected-testupstream-id"
44 | // ExpectedHostKey is the key for the expected host in the request.
45 | ExpectedHostKey = "x-expected-host"
46 | )
47 |
--------------------------------------------------------------------------------