# awslabs/ai-on-eks architecture

> Architecture diagram of the GitHub repository awslabs/ai-on-eks, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-27). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/awslabs/ai-on-eks
- Repository: https://github.com/awslabs/ai-on-eks

## Overview

AI on EKS is a collection of deployment blueprints and examples for running AI/ML workloads on Amazon EKS, rather than one integrated application. Users select a blueprint, deploy a workload pattern, and interact with its training or inference example; the README also highlights gateway routing and rate limiting. The graph preserves the major documented capabilities and sampled runtime examples. Several blueprints are unsampled, so their internal wiring is not inferred; dashed links mark only unverified relationships.

Main entry points: [`blueprints/inference`](https://github.com/awslabs/ai-on-eks/tree/main/blueprints/inference) (Inference Clients), [`blueprints/training/raytrain-llama2-pretrain-trn1/llama2_pretrain/tp_zero1_llama2_7b_hf_pretrain.py`](https://github.com/awslabs/ai-on-eks/blob/main/blueprints/training/raytrain-llama2-pretrain-trn1/llama2_pretrain/tp_zero1_llama2_7b_hf_pretrain.py) (Llama Pretraining), [`blueprints`](https://github.com/awslabs/ai-on-eks/tree/main/blueprints) (Blueprint Collection), [`infra/jark-stack/src/app/streamlit.py`](https://github.com/awslabs/ai-on-eks/blob/main/infra/jark-stack/src/app/streamlit.py) (JARK Streamlit UI)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_blueprints["Blueprint Patterns"]
  node_blueprint_collection["Blueprint Collection"]
  node_agent_sandbox["Agent Sandbox<br/>[agent.py]"]
end

subgraph group_inference["Inference"]
  node_rayserve_llama["Ray Serve LLMs"]
  node_rayserve_llama3["Ray Serve Llama 3"]
  node_rayserve_mistral["Ray Serve Mistral"]
  node_rayserve_diffusion["Ray Serve Diffusion"]
  node_rayserve_sdxl["Ray Serve SDXL"]
  node_vllm_serve["vLLM Ray Serve<br/>[vllm_serve.py]"]
  node_triton_models["Triton Model Backends"]
  node_triton_client["Triton Client<br/>[triton-client.py]"]
  node_nim_client["NVIDIA NIM Client<br/>[client.py]"]
  node_neuron_runner["Trainium Runner"]
  node_inference_clients["Inference Clients"]
end

subgraph group_training["Training"]
  node_training_entry["Ray Training Entry"]
  node_pretrain_loop["Llama Pretraining"]
  node_llama_model["Neuron Llama Model"]
  node_dataset["Dataset Loader<br/>[get_dataset.py]"]
  node_training_logger["Training Logger<br/>[logger.py]"]
end

subgraph group_gateway["AI Gateway"]
  node_multi_route["Multi-Model Routing<br/>[client.py]"]
  node_rate_limit["Rate Limiting<br/>[client.py]"]
end

subgraph group_tools["User Tools"]
  node_gradio_llama["Gradio LLM UI"]
  node_gradio_diffusion["Gradio Diffusion UI"]
  node_jark_ui["JARK Streamlit UI<br/>[streamlit.py]"]
  node_dogbooth["Dogbooth Service<br/>[dogbooth.py]"]
end

node_user(("Platform User"))
node_eks{{"Amazon EKS"}}

node_user -->|"selects pattern"| node_blueprint_collection
node_blueprint_collection -->|"deploys workloads"| node_eks
node_training_entry -->|"configures trainer"| node_pretrain_loop
node_pretrain_loop -->|"uses model"| node_llama_model
node_pretrain_loop -->|"uses logging"| node_training_logger
node_pretrain_loop -.->|"loads data"| node_dataset
node_user -.->|"sends inference requests"| node_inference_clients
node_inference_clients -.->|"calls serving endpoint"| node_rayserve_llama
node_inference_clients -.->|"calls serving endpoint"| node_rayserve_llama3
node_inference_clients -.->|"calls serving endpoint"| node_rayserve_mistral
node_inference_clients -.->|"calls serving endpoint"| node_rayserve_diffusion
node_inference_clients -.->|"calls serving endpoint"| node_rayserve_sdxl
node_inference_clients -.->|"calls serving endpoint"| node_vllm_serve
node_triton_client -.->|"queries models"| node_triton_models
node_multi_route -.->|"routes workloads"| node_eks
node_rate_limit -.->|"limits usage"| node_eks
node_user -.->|"uses interface"| node_gradio_llama
node_user -.->|"uses interface"| node_gradio_diffusion
node_user -.->|"uses interface"| node_jark_ui
node_jark_ui -.->|"invokes service"| node_dogbooth

click node_blueprint_collection "https://github.com/awslabs/ai-on-eks/tree/main/blueprints"
click node_agent_sandbox "https://github.com/awslabs/ai-on-eks/blob/main/blueprints/agent-sandbox/agent.py"
click node_rayserve_llama "https://github.com/awslabs/ai-on-eks/blob/main/blueprints/inference/llama2-13b-chat-rayserve-inf2/ray_serve_llama2.py"
click node_rayserve_llama3 "https://github.com/awslabs/ai-on-eks/blob/main/blueprints/inference/llama3-8b-instruct-rayserve-inf2/ray_serve_llama3.py"
click node_rayserve_mistral "https://github.com/awslabs/ai-on-eks/blob/main/blueprints/inference/mistral-7b-rayserve-inf2/ray_serve_mistral.py"
click node_rayserve_diffusion "https://github.com/awslabs/ai-on-eks/blob/main/blueprints/inference/stable-diffusion-rayserve-gpu/ray_serve_stablediffusion.py"
click node_rayserve_sdxl "https://github.com/awslabs/ai-on-eks/blob/main/blueprints/inference/stable-diffusion-xl-base-rayserve-inf2/ray_serve_stablediffusion.py"
click node_vllm_serve "https://github.com/awslabs/ai-on-eks/blob/main/blueprints/inference/vllm-rayserve-gpu/vllm_serve.py"
click node_triton_models "https://github.com/awslabs/ai-on-eks/tree/main/blueprints/inference/vllm-nvidia-triton-server-gpu/model_repository"
click node_triton_client "https://github.com/awslabs/ai-on-eks/blob/main/blueprints/inference/vllm-nvidia-triton-server-gpu/triton-client/triton-client.py"
click node_nim_client "https://github.com/awslabs/ai-on-eks/blob/main/blueprints/inference/nvidia-nim/nim-client/client.py"
click node_neuron_runner "https://github.com/awslabs/ai-on-eks/blob/main/blueprints/inference/vllm-llama3.1-405b-trn1/docker/neuron_multi_node_runner.py"
click node_inference_clients "https://github.com/awslabs/ai-on-eks/tree/main/blueprints/inference"
click node_training_entry "https://github.com/awslabs/ai-on-eks/blob/main/blueprints/training/raytrain-llama2-pretrain-trn1/llama2_pretrain/ray_train_llama2.py"
click node_pretrain_loop "https://github.com/awslabs/ai-on-eks/blob/main/blueprints/training/raytrain-llama2-pretrain-trn1/llama2_pretrain/tp_zero1_llama2_7b_hf_pretrain.py"
click node_llama_model "https://github.com/awslabs/ai-on-eks/blob/main/blueprints/training/raytrain-llama2-pretrain-trn1/llama2_pretrain/modeling_llama_nxd.py"
click node_dataset "https://github.com/awslabs/ai-on-eks/blob/main/blueprints/training/raytrain-llama2-pretrain-trn1/llama2_pretrain/get_dataset.py"
click node_training_logger "https://github.com/awslabs/ai-on-eks/blob/main/blueprints/training/raytrain-llama2-pretrain-trn1/llama2_pretrain/logger.py"
click node_multi_route "https://github.com/awslabs/ai-on-eks/blob/main/blueprints/gateways/envoy-ai-gateway/multi-model-routing/client.py"
click node_rate_limit "https://github.com/awslabs/ai-on-eks/blob/main/blueprints/gateways/envoy-ai-gateway/rate-limiting/client.py"
click node_gradio_llama "https://github.com/awslabs/ai-on-eks/blob/main/blueprints/inference/gradio-ui/gradio-app-llama.py"
click node_gradio_diffusion "https://github.com/awslabs/ai-on-eks/blob/main/blueprints/inference/gradio-ui/gradio-app-stable-diffusion.py"
click node_jark_ui "https://github.com/awslabs/ai-on-eks/blob/main/infra/jark-stack/src/app/streamlit.py"
click node_dogbooth "https://github.com/awslabs/ai-on-eks/blob/main/infra/jark-stack/src/service/dogbooth.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_blueprint_collection,node_agent_sandbox,node_user toneBlue
class node_rayserve_llama,node_rayserve_llama3,node_rayserve_mistral,node_rayserve_diffusion,node_rayserve_sdxl,node_vllm_serve,node_triton_models,node_triton_client,node_nim_client,node_neuron_runner,node_inference_clients toneAmber
class node_training_entry,node_pretrain_loop,node_llama_model,node_dataset,node_training_logger toneMint
class node_multi_route,node_rate_limit toneRose
class node_gradio_llama,node_gradio_diffusion,node_jark_ui,node_dogbooth,node_eks toneIndigo
```

## Components

### Blueprint Patterns

- [Blueprint Collection](https://github.com/awslabs/ai-on-eks/tree/main/blueprints): `blueprints`
- [Agent Sandbox](https://github.com/awslabs/ai-on-eks/blob/main/blueprints/agent-sandbox/agent.py): `blueprints/agent-sandbox/agent.py`

### Inference

- [Ray Serve LLMs](https://github.com/awslabs/ai-on-eks/blob/main/blueprints/inference/llama2-13b-chat-rayserve-inf2/ray_serve_llama2.py): `blueprints/inference/llama2-13b-chat-rayserve-inf2/ray_serve_llama2.py`
- [Ray Serve Llama 3](https://github.com/awslabs/ai-on-eks/blob/main/blueprints/inference/llama3-8b-instruct-rayserve-inf2/ray_serve_llama3.py): `blueprints/inference/llama3-8b-instruct-rayserve-inf2/ray_serve_llama3.py`
- [Ray Serve Mistral](https://github.com/awslabs/ai-on-eks/blob/main/blueprints/inference/mistral-7b-rayserve-inf2/ray_serve_mistral.py): `blueprints/inference/mistral-7b-rayserve-inf2/ray_serve_mistral.py`
- [Ray Serve Diffusion](https://github.com/awslabs/ai-on-eks/blob/main/blueprints/inference/stable-diffusion-rayserve-gpu/ray_serve_stablediffusion.py): `blueprints/inference/stable-diffusion-rayserve-gpu/ray_serve_stablediffusion.py`
- [Ray Serve SDXL](https://github.com/awslabs/ai-on-eks/blob/main/blueprints/inference/stable-diffusion-xl-base-rayserve-inf2/ray_serve_stablediffusion.py): `blueprints/inference/stable-diffusion-xl-base-rayserve-inf2/ray_serve_stablediffusion.py`
- [vLLM Ray Serve](https://github.com/awslabs/ai-on-eks/blob/main/blueprints/inference/vllm-rayserve-gpu/vllm_serve.py): `blueprints/inference/vllm-rayserve-gpu/vllm_serve.py`
- [Triton Model Backends](https://github.com/awslabs/ai-on-eks/tree/main/blueprints/inference/vllm-nvidia-triton-server-gpu/model_repository): `blueprints/inference/vllm-nvidia-triton-server-gpu/model_repository`
- [Triton Client](https://github.com/awslabs/ai-on-eks/blob/main/blueprints/inference/vllm-nvidia-triton-server-gpu/triton-client/triton-client.py): `blueprints/inference/vllm-nvidia-triton-server-gpu/triton-client/triton-client.py`
- [NVIDIA NIM Client](https://github.com/awslabs/ai-on-eks/blob/main/blueprints/inference/nvidia-nim/nim-client/client.py): `blueprints/inference/nvidia-nim/nim-client/client.py`
- [Trainium Runner](https://github.com/awslabs/ai-on-eks/blob/main/blueprints/inference/vllm-llama3.1-405b-trn1/docker/neuron_multi_node_runner.py): `blueprints/inference/vllm-llama3.1-405b-trn1/docker/neuron_multi_node_runner.py`
- [Inference Clients](https://github.com/awslabs/ai-on-eks/tree/main/blueprints/inference): `blueprints/inference`

### Training

- [Ray Training Entry](https://github.com/awslabs/ai-on-eks/blob/main/blueprints/training/raytrain-llama2-pretrain-trn1/llama2_pretrain/ray_train_llama2.py): `blueprints/training/raytrain-llama2-pretrain-trn1/llama2_pretrain/ray_train_llama2.py`
- [Llama Pretraining](https://github.com/awslabs/ai-on-eks/blob/main/blueprints/training/raytrain-llama2-pretrain-trn1/llama2_pretrain/tp_zero1_llama2_7b_hf_pretrain.py): `blueprints/training/raytrain-llama2-pretrain-trn1/llama2_pretrain/tp_zero1_llama2_7b_hf_pretrain.py`
- [Neuron Llama Model](https://github.com/awslabs/ai-on-eks/blob/main/blueprints/training/raytrain-llama2-pretrain-trn1/llama2_pretrain/modeling_llama_nxd.py): `blueprints/training/raytrain-llama2-pretrain-trn1/llama2_pretrain/modeling_llama_nxd.py`
- [Dataset Loader](https://github.com/awslabs/ai-on-eks/blob/main/blueprints/training/raytrain-llama2-pretrain-trn1/llama2_pretrain/get_dataset.py): `blueprints/training/raytrain-llama2-pretrain-trn1/llama2_pretrain/get_dataset.py`
- [Training Logger](https://github.com/awslabs/ai-on-eks/blob/main/blueprints/training/raytrain-llama2-pretrain-trn1/llama2_pretrain/logger.py): `blueprints/training/raytrain-llama2-pretrain-trn1/llama2_pretrain/logger.py`

### AI Gateway

- [Multi-Model Routing](https://github.com/awslabs/ai-on-eks/blob/main/blueprints/gateways/envoy-ai-gateway/multi-model-routing/client.py): `blueprints/gateways/envoy-ai-gateway/multi-model-routing/client.py`
- [Rate Limiting](https://github.com/awslabs/ai-on-eks/blob/main/blueprints/gateways/envoy-ai-gateway/rate-limiting/client.py): `blueprints/gateways/envoy-ai-gateway/rate-limiting/client.py`

### User Tools

- [Gradio LLM UI](https://github.com/awslabs/ai-on-eks/blob/main/blueprints/inference/gradio-ui/gradio-app-llama.py): `blueprints/inference/gradio-ui/gradio-app-llama.py`
- [Gradio Diffusion UI](https://github.com/awslabs/ai-on-eks/blob/main/blueprints/inference/gradio-ui/gradio-app-stable-diffusion.py): `blueprints/inference/gradio-ui/gradio-app-stable-diffusion.py`
- [JARK Streamlit UI](https://github.com/awslabs/ai-on-eks/blob/main/infra/jark-stack/src/app/streamlit.py): `infra/jark-stack/src/app/streamlit.py`
- [Dogbooth Service](https://github.com/awslabs/ai-on-eks/blob/main/infra/jark-stack/src/service/dogbooth.py): `infra/jark-stack/src/service/dogbooth.py`

### Other components

- **Platform User**
- **Amazon EKS**

## Connections

- Platform User → Blueprint Collection: selects pattern
- Blueprint Collection → Amazon EKS: deploys workloads
- Ray Training Entry → Llama Pretraining: configures trainer (evidence: `blueprints/training/raytrain-llama2-pretrain-trn1/llama2_pretrain/ray_train_llama2.py`)
- Llama Pretraining → Neuron Llama Model: uses model (evidence: `blueprints/training/raytrain-llama2-pretrain-trn1/llama2_pretrain/tp_zero1_llama2_7b_hf_pretrain.py`)
- Llama Pretraining → Training Logger: uses logging (evidence: `blueprints/training/raytrain-llama2-pretrain-trn1/llama2_pretrain/tp_zero1_llama2_7b_hf_pretrain.py`)
- Llama Pretraining → Dataset Loader: loads data
- Platform User → Inference Clients: sends inference requests
- Inference Clients → Ray Serve LLMs: calls serving endpoint
- Inference Clients → Ray Serve Llama 3: calls serving endpoint
- Inference Clients → Ray Serve Mistral: calls serving endpoint
- Inference Clients → Ray Serve Diffusion: calls serving endpoint
- Inference Clients → Ray Serve SDXL: calls serving endpoint
- Inference Clients → vLLM Ray Serve: calls serving endpoint
- Triton Client → Triton Model Backends: queries models
- Multi-Model Routing → Amazon EKS: routes workloads
- Rate Limiting → Amazon EKS: limits usage
- Platform User → Gradio LLM UI: uses interface
- Platform User → Gradio Diffusion UI: uses interface
- Platform User → JARK Streamlit UI: uses interface
- JARK Streamlit UI → Dogbooth Service: invokes service
