Provider × Compute tabs¶
This page demonstrates — and documents — the tab pattern every Chiron recipe uses. The outer set is the provider (Azure / GCP / AWS) and the inner set is the compute model (Kubernetes / Serverless).
The outer tabs are linked: pick Azure once and every provider tab on the page (and every other page you visit) follows. Pick GCP and the whole site follows. That means a reader visiting Chiron once and choosing AWS reads a version of the guide with AWS-native snippets end to end.
The inner Kubernetes / Serverless tabs are not linked — different sections make different compute choices, and forcing them to move together would be misleading.
The demo — "hello, model" for E0¶
Every real recipe follows the same four-block shape. E0 ships one placeholder set so E1+ can extend it verbatim.
Prereqs
Azure CLI ≥ 2.60, an Azure subscription with permission to create a resource group + an AI service endpoint.
Terraform — provision an AKS cluster + workspace:
resource "azurerm_resource_group" "chiron_demo" {
name = "chiron-demo"
location = "eastus"
}
resource "azurerm_kubernetes_cluster" "demo" {
name = "chiron-demo-aks"
location = azurerm_resource_group.chiron_demo.location
resource_group_name = azurerm_resource_group.chiron_demo.name
dns_prefix = "chiron-demo"
default_node_pool {
name = "default"
node_count = 1
vm_size = "Standard_D2s_v5"
}
identity { type = "SystemAssigned" }
}
Helm — deploy the sample workload:
# values.yaml
image:
repository: mcr.microsoft.com/oss/nginx/nginx
tag: 1.25-alpine
service:
type: ClusterIP
port: 80
Python — call the model:
import os
from openai import AzureOpenAI # (1)
client = AzureOpenAI(
api_key=os.environ["AZURE_OPENAI_API_KEY"],
api_version="2024-06-01",
azure_endpoint=os.environ["AZURE_OPENAI_ENDPOINT"],
)
resp = client.chat.completions.create(
model=os.environ["AZURE_OPENAI_DEPLOYMENT"],
messages=[{"role": "user", "content": "hello, model"}],
)
print(resp.choices[0].message.content)
openai>=1.0— the SDK abstracts the OpenAI-on-Azure endpoint surface. Credential-free via managed identity when running in the cluster; env-var-driven from a laptop.
Verify:
Terraform — provision an Azure Container Apps environment + Function App:
resource "azurerm_container_app_environment" "demo" {
name = "chiron-demo-cae"
location = azurerm_resource_group.chiron_demo.location
resource_group_name = azurerm_resource_group.chiron_demo.name
}
Helm — not applicable to Container Apps; skip to the app code.
Python:
Verify:
Prereqs
gcloud ≥ 480, a GCP project with billing enabled, Vertex AI
API enabled.
Terraform — provision a GKE Autopilot cluster:
resource "google_container_cluster" "demo" {
name = "chiron-demo-gke"
location = "us-central1"
enable_autopilot = true
}
Helm:
Python:
from vertexai.generative_models import GenerativeModel
model = GenerativeModel("gemini-1.5-flash")
resp = model.generate_content("hello, model")
print(resp.text)
Verify:
Prereqs
AWS CLI ≥ 2.15, an AWS account with permission to create IAM roles + Bedrock model access enabled in your region.
Terraform — provision an EKS cluster:
module "eks" {
source = "terraform-aws-modules/eks/aws"
version = "~> 20.0"
cluster_name = "chiron-demo-eks"
cluster_version = "1.30"
# ... subnet/vpc wiring elided for the demo.
}
Helm:
Python:
import boto3, json
client = boto3.client("bedrock-runtime", region_name="us-east-1")
resp = client.invoke_model(
modelId="anthropic.claude-3-haiku-20240307-v1:0",
body=json.dumps({
"anthropic_version": "bedrock-2023-05-31",
"max_tokens": 128,
"messages": [{"role": "user", "content": "hello, model"}],
}),
)
print(json.loads(resp["body"].read())["content"][0]["text"])
Verify:
Reusing this pattern in E1+¶
To add a new page that uses linked provider tabs:
- Start the file with
# Some page. - Open the outer tab set with
=== "Azure",=== "GCP",=== "AWS". - Inside each provider, open the compute tab set with
=== "Kubernetes"/=== "Serverless". - Inside each compute tab, put the four blocks in the same order: Terraform, Helm (skip on serverless with a one-line note), Python, Verify.
- Do NOT change the tab labels — the linked-tabs feature keys on the
label string, so
Azure/GCP/AWSandKubernetes/Serverlessmust match verbatim across every page for the reader's choice to follow.
Why linked tabs¶
Reading a cross-cloud guide with unlinked tabs is exhausting: every page starts back at "Azure" and the reader has to re-click their way back to their provider. Linked tabs turn a one-time choice on page 1 into the default for every subsequent read.