Skip to content

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
helm install chiron-hello ./chart -f values.yaml

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)
  1. 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:

python hello.py
# → hello, human — replies with model output

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:

import azure.functions as func
# E0 placeholder — E1 lands the concrete function handler.

Verify:

func azure functionapp publish chiron-demo-func
curl "$FUNC_URL/api/hello"

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:

helm install chiron-hello ./chart --values values-gcp.yaml

Python:

from vertexai.generative_models import GenerativeModel

model = GenerativeModel("gemini-1.5-flash")
resp = model.generate_content("hello, model")
print(resp.text)

Verify:

python hello.py

Terraform — Cloud Run service:

resource "google_cloud_run_v2_service" "demo" {
  name     = "chiron-demo-cr"
  location = "us-central1"

  template {
    containers {
      image = "us-docker.pkg.dev/cloudrun/container/hello"
    }
  }
}

Helm — not applicable to Cloud Run; skip.

Python:

# E0 placeholder — E1 lands the concrete Cloud Run handler.

Verify:

gcloud run services describe chiron-demo-cr \
  --region us-central1 --format='value(status.url)'

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:

helm install chiron-hello ./chart --values values-aws.yaml

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:

python hello.py

Terraform — Lambda function:

resource "aws_lambda_function" "demo" {
  function_name = "chiron-demo-fn"
  role          = aws_iam_role.demo.arn
  handler       = "index.handler"
  runtime       = "python3.12"
  filename      = "hello.zip"
}

Helm — not applicable to Lambda; skip.

Python:

# E0 placeholder — E1 lands the concrete Lambda handler.

Verify:

aws lambda invoke --function-name chiron-demo-fn out.json
cat out.json

Reusing this pattern in E1+

To add a new page that uses linked provider tabs:

  1. Start the file with # Some page.
  2. Open the outer tab set with === "Azure", === "GCP", === "AWS".
  3. Inside each provider, open the compute tab set with === "Kubernetes" / === "Serverless".
  4. Inside each compute tab, put the four blocks in the same order: Terraform, Helm (skip on serverless with a one-line note), Python, Verify.
  5. Do NOT change the tab labels — the linked-tabs feature keys on the label string, so Azure/GCP/AWS and Kubernetes/Serverless must 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.