# runtime-weekly/runtime-tutorials architecture

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

- Interactive diagram: https://gitdiagram.com/runtime-weekly/runtime-tutorials
- Repository: https://github.com/runtime-weekly/runtime-tutorials

## Overview

RUNTIME tutorials is a collection of four independent, runnable guides—not a shared application. A reader chooses a guide, supplies or inspects synthetic examples, and gets classifications, proposed tool calls, or recomputed research summaries. Laya adds an optional local drafting step; the research guides compare saved model decisions and resource measurements, with Tev1 also documenting optional local inference. Sampled code supports the Laya and Needle runtime links; research-guide wiring is based on their documented workflows and sampled verification scripts, so uncertain internal call paths are omitted.

Main entry points: [`kev-laya/analyze.py`](https://github.com/runtime-weekly/runtime-tutorials/blob/main/kev-laya/analyze.py) (Recompute comparison), [`needle/demo.py`](https://github.com/runtime-weekly/runtime-tutorials/blob/main/needle/demo.py) (Propose tool calls), [`tev1/verify.py`](https://github.com/runtime-weekly/runtime-tutorials/blob/main/tev1/verify.py) (Verify findings), [`laya/examples.py`](https://github.com/runtime-weekly/runtime-tutorials/blob/main/laya/examples.py) (Classify and gate)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_laya["Laya classification"]
  node_laya_examples["Classify and gate<br/>[examples.py]"]
  node_laya_custom["Custom categories<br/>[custom_notes.py]"]
  node_laya_download["Fetch checkpoint<br/>[download_model.py]"]
  node_laya_model[("Laya checkpoint")]
end

subgraph group_needle["Needle tool proposals"]
  node_needle_demo["Propose tool calls<br/>[demo.py]"]
  node_needle_cases["Tools and queries<br/>[cases.json]"]
  node_needle_results["Saved demo results"]
end

subgraph group_tev1["Tev1 research"]
  node_tev_verify["Verify findings<br/>[verify.py]"]
  node_tev_cases["Frozen cases<br/>[cases.json]"]
  node_tev_results["Recorded decisions<br/>[results.json]"]
  node_tev_environment["Environment evidence"]
  node_tev_download["Fetch checkpoints<br/>[download.py]"]
  node_tev_infer["Optional inference<br/>[infer.py]"]
end

subgraph group_kev["Kev Laya research"]
  node_kev_analyze["Recompute comparison<br/>[analyze.py]"]
  node_kev_cases["Frozen cases<br/>[cases.json]"]
  node_kev_results["Saved decisions<br/>[results.json]"]
  node_kev_measurements["Resource measurements<br/>[measurements.json]"]
  node_kev_summary["Expected summary"]
end

node_reader(("Guide reader"))
node_local_llm["Local LLM server"]
node_needle_package["Needle runtime"]
node_model_hub["Hugging Face"]

node_reader -->|"runs demo"| node_laya_examples
node_reader -->|"runs example"| node_laya_custom
node_laya_examples -->|"loads"| node_laya_model
node_laya_custom -->|"loads"| node_laya_model
node_laya_download -->|"downloads"| node_model_hub
node_laya_download -->|"writes checkpoint"| node_laya_model
node_laya_examples -.->|"requests draft"| node_local_llm
node_reader -->|"runs or inspects"| node_needle_demo
node_needle_demo -->|"reads"| node_needle_cases
node_needle_demo -->|"calls"| node_needle_package
node_needle_demo -->|"reads saved output"| node_needle_results
node_reader -->|"verifies findings"| node_tev_verify
node_tev_verify -->|"reads"| node_tev_cases
node_tev_verify -->|"reads"| node_tev_results
node_tev_verify -->|"reads"| node_tev_environment
node_reader -.->|"requests checkpoints"| node_tev_download
node_tev_download -.->|"downloads"| node_model_hub
node_reader -.->|"runs optional rerun"| node_tev_infer
node_tev_infer -.->|"reads"| node_tev_cases
node_tev_infer -.->|"uses downloaded assets"| node_model_hub
node_reader -->|"recomputes findings"| node_kev_analyze
node_kev_analyze -->|"reads"| node_kev_cases
node_kev_analyze -->|"reads"| node_kev_results
node_kev_analyze -->|"reads"| node_kev_measurements
node_kev_analyze -.->|"checks optional"| node_kev_summary

click node_laya_examples "https://github.com/runtime-weekly/runtime-tutorials/blob/main/laya/examples.py"
click node_laya_custom "https://github.com/runtime-weekly/runtime-tutorials/blob/main/laya/custom_notes.py"
click node_laya_download "https://github.com/runtime-weekly/runtime-tutorials/blob/main/laya/download_model.py"
click node_needle_demo "https://github.com/runtime-weekly/runtime-tutorials/blob/main/needle/demo.py"
click node_needle_cases "https://github.com/runtime-weekly/runtime-tutorials/blob/main/needle/cases.json"
click node_needle_results "https://github.com/runtime-weekly/runtime-tutorials/blob/main/needle/example-results.json"
click node_tev_verify "https://github.com/runtime-weekly/runtime-tutorials/blob/main/tev1/verify.py"
click node_tev_cases "https://github.com/runtime-weekly/runtime-tutorials/blob/main/tev1/data/cases.json"
click node_tev_results "https://github.com/runtime-weekly/runtime-tutorials/blob/main/tev1/data/results.json"
click node_tev_environment "https://github.com/runtime-weekly/runtime-tutorials/blob/main/tev1/data/tested-environment.json"
click node_tev_download "https://github.com/runtime-weekly/runtime-tutorials/blob/main/tev1/download.py"
click node_tev_infer "https://github.com/runtime-weekly/runtime-tutorials/blob/main/tev1/infer.py"
click node_kev_analyze "https://github.com/runtime-weekly/runtime-tutorials/blob/main/kev-laya/analyze.py"
click node_kev_cases "https://github.com/runtime-weekly/runtime-tutorials/blob/main/kev-laya/cases.json"
click node_kev_results "https://github.com/runtime-weekly/runtime-tutorials/blob/main/kev-laya/results.json"
click node_kev_measurements "https://github.com/runtime-weekly/runtime-tutorials/blob/main/kev-laya/measurements.json"
click node_kev_summary "https://github.com/runtime-weekly/runtime-tutorials/blob/main/kev-laya/expected-summary.json"

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_laya_examples,node_laya_custom,node_laya_download,node_laya_model toneBlue
class node_needle_demo,node_needle_cases,node_needle_results toneAmber
class node_tev_verify,node_tev_cases,node_tev_results,node_tev_environment,node_tev_download,node_tev_infer,node_local_llm toneMint
class node_kev_analyze,node_kev_cases,node_kev_results,node_kev_measurements,node_kev_summary toneRose
class node_reader,node_needle_package,node_model_hub toneIndigo
```

## Components

### Laya classification

- [Classify and gate](https://github.com/runtime-weekly/runtime-tutorials/blob/main/laya/examples.py): `laya/examples.py`
- [Custom categories](https://github.com/runtime-weekly/runtime-tutorials/blob/main/laya/custom_notes.py): `laya/custom_notes.py`
- [Fetch checkpoint](https://github.com/runtime-weekly/runtime-tutorials/blob/main/laya/download_model.py): `laya/download_model.py`
- **Laya checkpoint**

### Needle tool proposals

- [Propose tool calls](https://github.com/runtime-weekly/runtime-tutorials/blob/main/needle/demo.py): `needle/demo.py`
- [Tools and queries](https://github.com/runtime-weekly/runtime-tutorials/blob/main/needle/cases.json): `needle/cases.json`
- [Saved demo results](https://github.com/runtime-weekly/runtime-tutorials/blob/main/needle/example-results.json): `needle/example-results.json`

### Tev1 research

- [Verify findings](https://github.com/runtime-weekly/runtime-tutorials/blob/main/tev1/verify.py): `tev1/verify.py`
- [Frozen cases](https://github.com/runtime-weekly/runtime-tutorials/blob/main/tev1/data/cases.json): `tev1/data/cases.json`
- [Recorded decisions](https://github.com/runtime-weekly/runtime-tutorials/blob/main/tev1/data/results.json): `tev1/data/results.json`
- [Environment evidence](https://github.com/runtime-weekly/runtime-tutorials/blob/main/tev1/data/tested-environment.json): `tev1/data/tested-environment.json`
- [Fetch checkpoints](https://github.com/runtime-weekly/runtime-tutorials/blob/main/tev1/download.py): `tev1/download.py`
- [Optional inference](https://github.com/runtime-weekly/runtime-tutorials/blob/main/tev1/infer.py): `tev1/infer.py`

### Kev Laya research

- [Recompute comparison](https://github.com/runtime-weekly/runtime-tutorials/blob/main/kev-laya/analyze.py): `kev-laya/analyze.py`
- [Frozen cases](https://github.com/runtime-weekly/runtime-tutorials/blob/main/kev-laya/cases.json): `kev-laya/cases.json`
- [Saved decisions](https://github.com/runtime-weekly/runtime-tutorials/blob/main/kev-laya/results.json): `kev-laya/results.json`
- [Resource measurements](https://github.com/runtime-weekly/runtime-tutorials/blob/main/kev-laya/measurements.json): `kev-laya/measurements.json`
- [Expected summary](https://github.com/runtime-weekly/runtime-tutorials/blob/main/kev-laya/expected-summary.json): `kev-laya/expected-summary.json`

### Other components

- **Guide reader**
- **Local LLM server**
- **Needle runtime**
- **Hugging Face**

## Connections

- Guide reader → Classify and gate: runs demo
- Guide reader → Custom categories: runs example
- Classify and gate → Laya checkpoint: loads
- Custom categories → Laya checkpoint: loads
- Fetch checkpoint → Hugging Face: downloads
- Fetch checkpoint → Laya checkpoint: writes checkpoint
- Classify and gate → Local LLM server: requests draft
- Guide reader → Propose tool calls: runs or inspects
- Propose tool calls → Tools and queries: reads
- Propose tool calls → Needle runtime: calls
- Propose tool calls → Saved demo results: reads saved output
- Guide reader → Verify findings: verifies findings
- Verify findings → Frozen cases: reads
- Verify findings → Recorded decisions: reads
- Verify findings → Environment evidence: reads
- Guide reader → Fetch checkpoints: requests checkpoints
- Fetch checkpoints → Hugging Face: downloads
- Guide reader → Optional inference: runs optional rerun
- Optional inference → Frozen cases: reads
- Optional inference → Hugging Face: uses downloaded assets
- Guide reader → Recompute comparison: recomputes findings
- Recompute comparison → Frozen cases: reads
- Recompute comparison → Saved decisions: reads
- Recompute comparison → Resource measurements: reads
- Recompute comparison → Expected summary: checks optional
