# hrithikvikas/trainium-agent-labs architecture

> Architecture diagram of the GitHub repository hrithikvikas/trainium-agent-labs, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-13). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/hrithikvikas/trainium-agent-labs
- Repository: https://github.com/hrithikvikas/trainium-agent-labs

## Overview

Hack the Chip is a hands-on Trainium workshop built around model–checker iteration. Participants start a model endpoint in their seat pod, then run either a heat-equation agent that proposes answers and receives diagnostic grades, or a kernel agent that iterates on NKI kernels against a simulator harness. The heat project separates problem generation, optional symbolic calculation, and grading; the kernel project centers on its agent and simulator. The README establishes the deployment and workflows; links between components are limited to those shown in excerpts or documented there.

Main entry points: [`projects/01-heat-rod-pde/agent.py`](https://github.com/hrithikvikas/trainium-agent-labs/blob/master/projects/01-heat-rod-pde/agent.py) (Heat agent), [`projects/02-kernel-agent/agent.py`](https://github.com/hrithikvikas/trainium-agent-labs/blob/master/projects/02-kernel-agent/agent.py) (Kernel agent), [`serve.sh`](https://github.com/hrithikvikas/trainium-agent-labs/blob/master/serve.sh) (Model launcher), [`projects/02-kernel-agent/kernelbench.py`](https://github.com/hrithikvikas/trainium-agent-labs/blob/master/projects/02-kernel-agent/kernelbench.py) (Kernel verifier)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workshop["Workshop runtime"]
  node_seat["Seat pod"]
  node_serve["Model launcher<br/>[serve.sh]"]
  node_endpoint["Model endpoint"]
end

subgraph group_heat["Heat PDE agent"]
  node_heat_agent["Heat agent<br/>[agent.py]"]
  node_heat_levels["Problem levels<br/>[level0_heatrod.py]"]
  node_insulated_level["Insulated problems<br/>[level1_heatrod.py]"]
  node_heat_checker["PDE checker<br/>[pdecheck.py]"]
  node_calc_tool["Symbolic calculator<br/>[tool_calc.py]"]
end

subgraph group_kernel["Kernel agent"]
  node_kernel_agent["Kernel agent<br/>[agent.py]"]
  node_kernel_harness["Kernel simulator<br/>[nkibench.py]"]
  node_kernelbench["Kernel verifier<br/>[kernelbench.py]"]
  node_kernel_refs["Reference kernels"]
end

node_participant(("Participant"))

node_participant -->|"enters"| node_seat
node_participant -->|"starts"| node_serve
node_serve -->|"serves model"| node_endpoint
node_participant -->|"runs"| node_heat_agent
node_heat_agent -->|"requests answers"| node_endpoint
node_heat_agent -->|"selects problems"| node_heat_levels
node_heat_agent -->|"selects problems"| node_insulated_level
node_heat_agent -->|"grades answers"| node_heat_checker
node_heat_agent -->|"evaluates requests"| node_calc_tool
node_participant -->|"runs"| node_kernel_agent
node_kernel_agent -->|"requests kernels"| node_endpoint
node_kernel_agent -->|"checks candidates"| node_kernel_harness
node_participant -->|"inspects challenge"| node_kernelbench
node_kernelbench -.->|"loads reference"| node_kernel_refs

click node_serve "https://github.com/hrithikvikas/trainium-agent-labs/blob/master/serve.sh"
click node_heat_agent "https://github.com/hrithikvikas/trainium-agent-labs/blob/master/projects/01-heat-rod-pde/agent.py"
click node_heat_levels "https://github.com/hrithikvikas/trainium-agent-labs/blob/master/projects/01-heat-rod-pde/level0_heatrod.py"
click node_insulated_level "https://github.com/hrithikvikas/trainium-agent-labs/blob/master/projects/01-heat-rod-pde/level1_heatrod.py"
click node_heat_checker "https://github.com/hrithikvikas/trainium-agent-labs/blob/master/projects/01-heat-rod-pde/pdecheck.py"
click node_calc_tool "https://github.com/hrithikvikas/trainium-agent-labs/blob/master/projects/01-heat-rod-pde/tool_calc.py"
click node_kernel_agent "https://github.com/hrithikvikas/trainium-agent-labs/blob/master/projects/02-kernel-agent/agent.py"
click node_kernel_harness "https://github.com/hrithikvikas/trainium-agent-labs/blob/master/projects/02-kernel-agent/nkibench.py"
click node_kernelbench "https://github.com/hrithikvikas/trainium-agent-labs/blob/master/projects/02-kernel-agent/kernelbench.py"
click node_kernel_refs "https://github.com/hrithikvikas/trainium-agent-labs/blob/master/projects/02-kernel-agent/reference_level1.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_seat,node_serve,node_endpoint toneBlue
class node_heat_agent,node_heat_levels,node_insulated_level,node_heat_checker,node_calc_tool toneAmber
class node_kernel_agent,node_kernel_harness,node_kernelbench,node_kernel_refs toneMint
class node_participant toneIndigo
```

## Components

### Workshop runtime

- **Seat pod**
- [Model launcher](https://github.com/hrithikvikas/trainium-agent-labs/blob/master/serve.sh): `serve.sh`
- **Model endpoint**

### Heat PDE agent

- [Heat agent](https://github.com/hrithikvikas/trainium-agent-labs/blob/master/projects/01-heat-rod-pde/agent.py): `projects/01-heat-rod-pde/agent.py`
- [Problem levels](https://github.com/hrithikvikas/trainium-agent-labs/blob/master/projects/01-heat-rod-pde/level0_heatrod.py): `projects/01-heat-rod-pde/level0_heatrod.py`
- [Insulated problems](https://github.com/hrithikvikas/trainium-agent-labs/blob/master/projects/01-heat-rod-pde/level1_heatrod.py): `projects/01-heat-rod-pde/level1_heatrod.py`
- [PDE checker](https://github.com/hrithikvikas/trainium-agent-labs/blob/master/projects/01-heat-rod-pde/pdecheck.py): `projects/01-heat-rod-pde/pdecheck.py`
- [Symbolic calculator](https://github.com/hrithikvikas/trainium-agent-labs/blob/master/projects/01-heat-rod-pde/tool_calc.py): `projects/01-heat-rod-pde/tool_calc.py`

### Kernel agent

- [Kernel agent](https://github.com/hrithikvikas/trainium-agent-labs/blob/master/projects/02-kernel-agent/agent.py): `projects/02-kernel-agent/agent.py`
- [Kernel simulator](https://github.com/hrithikvikas/trainium-agent-labs/blob/master/projects/02-kernel-agent/nkibench.py): `projects/02-kernel-agent/nkibench.py`
- [Kernel verifier](https://github.com/hrithikvikas/trainium-agent-labs/blob/master/projects/02-kernel-agent/kernelbench.py): `projects/02-kernel-agent/kernelbench.py`
- [Reference kernels](https://github.com/hrithikvikas/trainium-agent-labs/blob/master/projects/02-kernel-agent/reference_level1.py): `projects/02-kernel-agent/reference_level1.py`

### Other components

- **Participant**

## Connections

- Participant → Seat pod: enters (evidence: `README.md`)
- Participant → Model launcher: starts (evidence: `README.md`)
- Model launcher → Model endpoint: serves model (evidence: `README.md`)
- Participant → Heat agent: runs (evidence: `README.md`)
- Heat agent → Model endpoint: requests answers (evidence: `projects/01-heat-rod-pde/agent.py`)
- Heat agent → Problem levels: selects problems (evidence: `projects/01-heat-rod-pde/agent.py`)
- Heat agent → Insulated problems: selects problems (evidence: `projects/01-heat-rod-pde/agent.py`)
- Heat agent → PDE checker: grades answers (evidence: `projects/01-heat-rod-pde/agent.py`)
- Heat agent → Symbolic calculator: evaluates requests (evidence: `projects/01-heat-rod-pde/agent.py`)
- Participant → Kernel agent: runs (evidence: `README.md`)
- Kernel agent → Model endpoint: requests kernels (evidence: `projects/02-kernel-agent/agent.py`)
- Kernel agent → Kernel simulator: checks candidates (evidence: `projects/02-kernel-agent/agent.py`)
- Participant → Kernel verifier: inspects challenge (evidence: `projects/02-kernel-agent/kernelbench.py`)
- Kernel verifier → Reference kernels: loads reference
