This demo showcases the Envoy AI Gateway using the LLM-D Inference Simulator as a mock backend. The LLM-D Inference Simulator provides a lightweight way to test AI workloads without running actual LLM inference, making it perfect for development and testing scenarios.
This demo sets up:
- Envoy AI Gateway with custom configuration for AI workloads
- LLM-D Inference Simulator as the AI backend (using
qwen3model in echo mode) - Kubernetes services and routes for AI API endpoints
- Automated tasks for easy deployment and testing
kubectlconfigured to access your clustertask(Taskfile) installed (installation guide)jqfor JSON pretty-printing (optional but recommended)
- Navigate to the demo directory:
cd demos/01-getting-started- Run the complete setup:
task setupThis will:
- Check prerequisites
- Deploy all components
- Wait for everything to be ready
- In a separate terminal, start port forwarding:
task port-forward- Test the gateway:
task testNext Steps: Once you've completed the setup and testing, check out the Envoy AI Gateway Basic Usage Guide to learn more about features and configuration options.
Run task to see all available tasks:
task setup- Complete setup of the demo environmenttask deploy- Deploy the configuration to Kubernetestask port-forward- Start port forwarding to access the gatewaytask test- Run all test endpointstask test-chat- Test chat completions endpointtask test-embeddings- Test embeddings endpointtask test-models- Test models endpointtask test-stream- Test streaming chat completionstask logs- Show logs from all componentstask status- Check status of all componentstask cleanup- Remove all demo resources
┌─────────────┐ ┌─────────────────┐ ┌──────────────────────┐
│ Client │────▶│ Envoy AI │────▶│ LLM-D Inference │
│ │ │ Gateway │ │ Simulator (qwen3) │
└─────────────┘ └─────────────────┘ └──────────────────────┘
│
▼
┌─────────────────┐
│ Route matching │
│ x-ai-eg-model │
└─────────────────┘
- Gateway Name:
envoy-ai-gateway - Listener: HTTP on port 80
- Namespace:
default - Buffer Limit: Configured for AI workloads
- Mode: Echo mode (returns the input text)
- Model:
qwen3 - Port: 8000
- Endpoints:
/v1/chat/completions,/v1/embeddings,/v1/models - Performance:
- Time to first token: 10ms
- Inter-token latency: 20ms
- Resources: 128Mi memory, 100m CPU
Routes are matched based on the x-ai-eg-model header:
- Value:
qwen3
curl -H "Content-Type: application/json" \
-H "x-ai-eg-model: qwen3" \
-d '{
"model": "qwen3",
"messages": [{"role": "user", "content": "Hello, world!"}]
}' \
http://localhost:8080/v1/chat/completionscurl -H "Content-Type: application/json" \
-H "x-ai-eg-model: qwen3" \
-d '{
"model": "qwen3",
"input": "Test embedding text"
}' \
http://localhost:8080/v1/embeddingscurl -H "Content-Type: application/json" \
-H "x-ai-eg-model: qwen3" \
-d '{
"model": "qwen3",
"messages": [{"role": "user", "content": "Stream this"}],
"stream": true
}' \
http://localhost:8080/v1/chat/completionsIf you can't connect to the gateway:
- Check that port-forward is running
- Verify the Envoy service exists:
task status - Check gateway logs:
task logs-gateway
- Check simulator logs:
task logs-simulator - Verify pod is running:
kubectl get pods -l app=llm-d-inference-sim - Restart if needed:
task restart
The gateway may take a few moments to become ready. You can:
- Check status:
kubectl get gateway -n default - View events:
kubectl describe gateway envoy-ai-gateway
To remove all demo resources:
task cleanupAfter getting familiar with this basic setup, you can:
- Modify the simulator configuration for different response modes
- Add additional routes and backends
- Configure authentication and rate limiting
- Replace the simulator with a real LLM backend