一键导入
aigw-route
Create an AIGatewayRoute to bind AI backends to a Gateway with model-based routing
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Create an AIGatewayRoute to bind AI backends to a Gateway with model-based routing
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
| name | aigw-route |
| description | Create an AIGatewayRoute to bind AI backends to a Gateway with model-based routing |
| arguments | [{"name":"GatewayName","description":"Name of the Gateway to attach the route to","required":true},{"name":"RouteName","description":"Name for the AIGatewayRoute resource","required":false},{"name":"ModelHeader","description":"Value for x-ai-eg-model header match (e.g., gpt-4o-mini)","required":false},{"name":"BackendNames","description":"Comma-separated list of AIServiceBackend names","required":true}] |
Create an AIGatewayRoute that attaches AI service backends to a Gateway. The route uses rules with matches (typically on x-ai-eg-model header) and backendRefs to route traffic. The AI Gateway ExtProc extracts the model name from the request body and injects it into x-ai-eg-model before routing—clients do not need to set this header. AI Gateway generates an HTTPRoute (same name) and HTTPRouteFilters (host rewrite, 404 fallback) from this.
Envoy Gateway defaults to 32KiB buffer limit, which is too small for AI requests. Attach a ClientTrafficPolicy to your Gateway:
apiVersion: gateway.envoyproxy.io/v1alpha1
kind: ClientTrafficPolicy
metadata:
name: client-buffer-limit
namespace: default # TODO: Match your Gateway namespace
spec:
targetRefs:
- group: gateway.networking.k8s.io
kind: Gateway
name: ${GatewayName} # TODO: Replace with your Gateway name
connection:
bufferLimit: 50Mi
apiVersion: aigateway.envoyproxy.io/v1alpha1
kind: AIGatewayRoute
metadata:
name: ${RouteName} # TODO: Replace with descriptive name (e.g., openai-route)
namespace: default # TODO: Match Gateway namespace
spec:
parentRefs:
- name: ${GatewayName}
kind: Gateway
group: gateway.networking.k8s.io
rules:
- matches:
- headers:
- type: Exact
name: x-ai-eg-model
value: ${ModelHeader} # TODO: e.g., gpt-4o-mini, claude-3-5-sonnet
backendRefs:
- name: ${BackendNames} # TODO: AIServiceBackend name(s)
Traffic splitting by weight:
rules:
- matches:
- headers:
- type: Exact
name: x-ai-eg-model
value: gpt-4o
backendRefs:
- name: openai-backend
weight: 80
- name: azure-openai-backend
weight: 20
Failover by priority (lower number = higher priority):
rules:
- matches:
- headers:
- type: Exact
name: x-ai-eg-model
value: gpt-4o
backendRefs:
- name: primary-openai
priority: 0
- name: fallback-openai
priority: 1
To route all models to a single backend:
rules:
- backendRefs:
- name: my-openai-backend
For streaming responses (e.g., chat completions with stream: true), increase the request timeout:
rules:
- matches:
- headers:
- type: Exact
name: x-ai-eg-model
value: gpt-4o
timeouts:
request: 300s # 5 minutes for long streaming
backendRefs:
- name: openai-backend
Override the model name sent to the backend:
backendRefs:
- name: azure-openai-backend
modelNameOverride: gpt-4o # Azure deployment name
For InferencePool backends (Gateway API Inference Extension; requires addon):
backendRefs:
- name: my-inference-pool
group: inference.networking.k8s.io
kind: InferencePool
Constraints: Only one InferencePool per rule; cannot mix InferencePool with AIServiceBackend in the same rule. Cross-namespace references require ReferenceGrant in the target namespace.
Configure client-facing traffic policies -- timeouts, connection limits, TLS settings, HTTP behavior
Production-grade Envoy Gateway setup with comprehensive security, observability, high availability, and operational best practices
Integrate Envoy Gateway with Istio ambient mesh or Cilium for unified ingress and service mesh
Envoy Gateway version information, compatibility matrix, and upgrade readiness checks
Envoy AI Gateway contribution orchestrator — interviews you about your contribution and guides you through the correct workflow using contributor skills
Envoy Gateway contribution orchestrator — interviews you about your contribution and guides you through the correct workflow using contributor skills