# codecrafters-io/build-your-own-inference-engine architecture

> Architecture diagram of the GitHub repository codecrafters-io/build-your-own-inference-engine, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-20). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/codecrafters-io/build-your-own-inference-engine
- Repository: https://github.com/codecrafters-io/build-your-own-inference-engine

## Overview

This repository is challenge content for “Build your own Inference Engine,” not a standalone inference-engine service. The intended learner workflow is to work through staged requirements, implement the command-line tensor-inspection task in a language starter, and compare against provided solutions. The sampled implementations read safetensors data and emit tensor summaries; starter versions leave that command incomplete. Stage descriptions and most language assets were not sampled, so their detailed sequencing and wiring are not asserted.

Main entry points: [`stage_descriptions`](https://github.com/codecrafters-io/build-your-own-inference-engine/tree/main/stage_descriptions) (Stage Descriptions), [`README.md`](https://github.com/codecrafters-io/build-your-own-inference-engine/blob/main/README.md) (Challenge Overview), [`course-definition.yml`](https://github.com/codecrafters-io/build-your-own-inference-engine/blob/main/course-definition.yml) (Course Definition), [`starter_templates/go/code/app/main.go`](https://github.com/codecrafters-io/build-your-own-inference-engine/blob/main/starter_templates/go/code/app/main.go) (Go Starter)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_challenge["Challenge Content"]
  node_readme["Challenge Overview<br/>[README.md]"]
  node_definition["Course Definition"]
end

subgraph group_languages["Language Assets"]
  node_starter_all["Shared Starter Files"]
  node_starter_go["Go Starter<br/>[main.go]"]
  node_starter_python["Python Starter<br/>[main.py]"]
  node_starter_rust["Rust Starter<br/>[main.rs]"]
  node_compiled_go["Compiled Go Starter<br/>[main.go]"]
  node_compiled_python["Compiled Python Starter<br/>[main.py]"]
  node_compiled_rust["Compiled Rust Starter<br/>[main.rs]"]
  node_solution_go["Go Solution<br/>[main.go]"]
  node_solution_python["Python Solution<br/>[main.py]"]
  node_solution_rust["Rust Solution<br/>[main.rs]"]
end

subgraph group_progression["Learning Progression"]
  node_stages["Stage Descriptions"]
  node_stage_one["Initial Stage<br/>[base-01-zf8.md]"]
  node_later_stages["Later Stages"]
end

node_learner(("Learner"))

node_readme -->|"describes challenge"| node_definition
node_learner -.->|"implements"| node_starter_go
node_learner -.->|"implements"| node_starter_python
node_learner -.->|"implements"| node_starter_rust
node_learner -.->|"follows stages"| node_stages
node_learner -.->|"compares with"| node_solution_go
node_learner -.->|"compares with"| node_solution_python
node_learner -.->|"compares with"| node_solution_rust
node_stages -.->|"includes"| node_stage_one
node_stages -.->|"includes"| node_later_stages

click node_readme "https://github.com/codecrafters-io/build-your-own-inference-engine/blob/main/README.md"
click node_definition "https://github.com/codecrafters-io/build-your-own-inference-engine/blob/main/course-definition.yml"
click node_starter_all "https://github.com/codecrafters-io/build-your-own-inference-engine/tree/main/starter_templates/all/code"
click node_starter_go "https://github.com/codecrafters-io/build-your-own-inference-engine/blob/main/starter_templates/go/code/app/main.go"
click node_starter_python "https://github.com/codecrafters-io/build-your-own-inference-engine/blob/main/starter_templates/python/code/app/main.py"
click node_starter_rust "https://github.com/codecrafters-io/build-your-own-inference-engine/blob/main/starter_templates/rust/code/src/main.rs"
click node_compiled_go "https://github.com/codecrafters-io/build-your-own-inference-engine/blob/main/compiled_starters/go/app/main.go"
click node_compiled_python "https://github.com/codecrafters-io/build-your-own-inference-engine/blob/main/compiled_starters/python/app/main.py"
click node_compiled_rust "https://github.com/codecrafters-io/build-your-own-inference-engine/blob/main/compiled_starters/rust/src/main.rs"
click node_solution_go "https://github.com/codecrafters-io/build-your-own-inference-engine/blob/main/solutions/go/01-zf8/code/app/main.go"
click node_solution_python "https://github.com/codecrafters-io/build-your-own-inference-engine/blob/main/solutions/python/01-zf8/code/app/main.py"
click node_solution_rust "https://github.com/codecrafters-io/build-your-own-inference-engine/blob/main/solutions/rust/01-zf8/code/src/main.rs"
click node_stages "https://github.com/codecrafters-io/build-your-own-inference-engine/tree/main/stage_descriptions"
click node_stage_one "https://github.com/codecrafters-io/build-your-own-inference-engine/blob/main/stage_descriptions/base-01-zf8.md"
click node_later_stages "https://github.com/codecrafters-io/build-your-own-inference-engine/tree/main/stage_descriptions"

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_readme,node_definition toneBlue
class node_starter_all,node_starter_go,node_starter_python,node_starter_rust,node_compiled_go,node_compiled_python,node_compiled_rust,node_solution_go,node_solution_python,node_solution_rust toneAmber
class node_stages,node_stage_one,node_later_stages toneMint
class node_learner toneIndigo
```

## Components

### Challenge Content

- [Challenge Overview](https://github.com/codecrafters-io/build-your-own-inference-engine/blob/main/README.md): `README.md`
- [Course Definition](https://github.com/codecrafters-io/build-your-own-inference-engine/blob/main/course-definition.yml): `course-definition.yml`

### Language Assets

- [Shared Starter Files](https://github.com/codecrafters-io/build-your-own-inference-engine/tree/main/starter_templates/all/code): `starter_templates/all/code`
- [Go Starter](https://github.com/codecrafters-io/build-your-own-inference-engine/blob/main/starter_templates/go/code/app/main.go): `starter_templates/go/code/app/main.go`
- [Python Starter](https://github.com/codecrafters-io/build-your-own-inference-engine/blob/main/starter_templates/python/code/app/main.py): `starter_templates/python/code/app/main.py`
- [Rust Starter](https://github.com/codecrafters-io/build-your-own-inference-engine/blob/main/starter_templates/rust/code/src/main.rs): `starter_templates/rust/code/src/main.rs`
- [Compiled Go Starter](https://github.com/codecrafters-io/build-your-own-inference-engine/blob/main/compiled_starters/go/app/main.go): `compiled_starters/go/app/main.go`
- [Compiled Python Starter](https://github.com/codecrafters-io/build-your-own-inference-engine/blob/main/compiled_starters/python/app/main.py): `compiled_starters/python/app/main.py`
- [Compiled Rust Starter](https://github.com/codecrafters-io/build-your-own-inference-engine/blob/main/compiled_starters/rust/src/main.rs): `compiled_starters/rust/src/main.rs`
- [Go Solution](https://github.com/codecrafters-io/build-your-own-inference-engine/blob/main/solutions/go/01-zf8/code/app/main.go): `solutions/go/01-zf8/code/app/main.go`
- [Python Solution](https://github.com/codecrafters-io/build-your-own-inference-engine/blob/main/solutions/python/01-zf8/code/app/main.py): `solutions/python/01-zf8/code/app/main.py`
- [Rust Solution](https://github.com/codecrafters-io/build-your-own-inference-engine/blob/main/solutions/rust/01-zf8/code/src/main.rs): `solutions/rust/01-zf8/code/src/main.rs`

### Learning Progression

- [Stage Descriptions](https://github.com/codecrafters-io/build-your-own-inference-engine/tree/main/stage_descriptions): `stage_descriptions`
- [Initial Stage](https://github.com/codecrafters-io/build-your-own-inference-engine/blob/main/stage_descriptions/base-01-zf8.md): `stage_descriptions/base-01-zf8.md`
- [Later Stages](https://github.com/codecrafters-io/build-your-own-inference-engine/tree/main/stage_descriptions): `stage_descriptions`

### Other components

- **Learner**

## Connections

- Challenge Overview → Course Definition: describes challenge (evidence: `README.md`)
- Learner → Go Starter: implements
- Learner → Python Starter: implements
- Learner → Rust Starter: implements
- Learner → Stage Descriptions: follows stages
- Learner → Go Solution: compares with
- Learner → Python Solution: compares with
- Learner → Rust Solution: compares with
- Stage Descriptions → Initial Stage: includes
- Stage Descriptions → Later Stages: includes
