# materialczar50/automodel architecture

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

- Interactive diagram: https://gitdiagram.com/materialczar50/automodel
- Repository: https://github.com/materialczar50/automodel

## Overview

NeMo AutoModel is a PyTorch-native platform for fine-tuning and pretraining language, vision-language, retrieval, and diffusion models with distributed execution and specialized kernels. The main user workflow is to provide a YAML recipe to the CLI, load configuration, launch a recipe, prepare datasets and models, train, and checkpoint results. Other documented capabilities include retrieval, diffusion training, speculative decoding, and model-specific support. Some relationships below are supported by README statements or the source index; unsampled implementation details are represented at directory level rather than inferred.

Main entry points: [`nemo_automodel/recipes/base_recipe.py`](https://github.com/materialczar50/automodel/blob/main/nemo_automodel/recipes/base_recipe.py) (Recipe orchestration), [`nemo_automodel/recipes/llm/train_eagle3.py`](https://github.com/materialczar50/automodel/blob/main/nemo_automodel/recipes/llm/train_eagle3.py) (LLM training recipes), [`nemo_automodel/cli/app.py`](https://github.com/materialczar50/automodel/blob/main/nemo_automodel/cli/app.py) (Recipe CLI), [`nemo_automodel/components/models`](https://github.com/materialczar50/automodel/tree/main/nemo_automodel/components/models) (Model implementations)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Configuration and launch"]
  node_cli["Recipe CLI<br/>[app.py]"]
  node_config["Config loader<br/>[loader.py]"]
  node_launcher["Launchers"]
end

subgraph group_training["Training workflow"]
  node_recipe["Recipe orchestration<br/>[base_recipe.py]"]
  node_llm_recipe["LLM training recipes<br/>[train_eagle3.py]"]
  node_datasets["Training datasets"]
  node_loss["Training losses"]
end

subgraph group_runtime["Model and parallel runtime"]
  node_models["Model implementations"]
  node_distributed_config["Parallel config<br/>[config.py]"]
  node_mesh["Device mesh<br/>[mesh_utils.py]"]
  node_parallelizer["Model parallelizer<br/>[parallelizer.py]"]
  node_pipeline["Pipeline parallelism<br/>[autopipeline.py]"]
  node_lora["LoRA adaptation<br/>[lora.py]"]
end

subgraph group_capabilities["Specialized capabilities"]
  node_diffusion["Diffusion training<br/>[pipeline.py]"]
  node_diffusion_data["Diffusion datasets"]
  node_retrieval["Retrieval models<br/>[retrieval.py]"]
  node_retrieval_data["Retrieval datasets"]
  node_speculative["Speculative training<br/>[train_eagle3.py]"]
end

subgraph group_state["Checkpointing and output"]
  node_checkpoint["Checkpoint manager<br/>[checkpointing.py]"]
  node_hf_storage["HF checkpoint storage<br/>[hf_storage.py]"]
end

node_user(("Training user"))
node_external_model(("Model sources"))

node_user -->|"provides YAML"| node_cli
node_cli -->|"loads config"| node_config
node_cli -->|"selects launcher"| node_launcher
node_cli -.->|"runs recipe"| node_recipe
node_config -.->|"configures"| node_recipe
node_recipe -->|"saves state"| node_checkpoint
node_recipe -->|"sets up mesh"| node_mesh
node_llm_recipe -->|"uses data"| node_datasets
node_llm_recipe -->|"loads and saves"| node_checkpoint
node_recipe -->|"reads strategy"| node_distributed_config
node_distributed_config -->|"configures mesh"| node_mesh
node_mesh -.->|"supplies parallel layout"| node_parallelizer
node_parallelizer -.->|"parallelizes"| node_models
node_pipeline -.->|"pipelines model stages"| node_models
node_llm_recipe -->|"applies adapters"| node_lora
node_llm_recipe -.->|"computes training loss"| node_loss
node_external_model -.->|"loads pretrained weights"| node_models
node_diffusion -.->|"trains from batches"| node_diffusion_data
node_retrieval -->|"uses retrieval data"| node_retrieval_data
node_retrieval -->|"selects backbone"| node_models
node_speculative -->|"uses data"| node_datasets
node_checkpoint -->|"uses storage backend"| node_hf_storage

click node_cli "https://github.com/materialczar50/automodel/blob/main/nemo_automodel/cli/app.py"
click node_config "https://github.com/materialczar50/automodel/blob/main/nemo_automodel/components/config/loader.py"
click node_launcher "https://github.com/materialczar50/automodel/tree/main/nemo_automodel/components/launcher"
click node_recipe "https://github.com/materialczar50/automodel/blob/main/nemo_automodel/recipes/base_recipe.py"
click node_llm_recipe "https://github.com/materialczar50/automodel/blob/main/nemo_automodel/recipes/llm/train_eagle3.py"
click node_datasets "https://github.com/materialczar50/automodel/tree/main/nemo_automodel/components/datasets"
click node_loss "https://github.com/materialczar50/automodel/tree/main/nemo_automodel/components/loss"
click node_models "https://github.com/materialczar50/automodel/tree/main/nemo_automodel/components/models"
click node_distributed_config "https://github.com/materialczar50/automodel/blob/main/nemo_automodel/components/distributed/config.py"
click node_mesh "https://github.com/materialczar50/automodel/blob/main/nemo_automodel/components/distributed/mesh_utils.py"
click node_parallelizer "https://github.com/materialczar50/automodel/blob/main/nemo_automodel/components/distributed/parallelizer.py"
click node_pipeline "https://github.com/materialczar50/automodel/blob/main/nemo_automodel/components/distributed/pipelining/autopipeline.py"
click node_lora "https://github.com/materialczar50/automodel/blob/main/nemo_automodel/components/_peft/lora.py"
click node_diffusion "https://github.com/materialczar50/automodel/blob/main/nemo_automodel/components/flow_matching/pipeline.py"
click node_diffusion_data "https://github.com/materialczar50/automodel/tree/main/nemo_automodel/components/datasets/diffusion"
click node_retrieval "https://github.com/materialczar50/automodel/blob/main/nemo_automodel/_transformers/retrieval.py"
click node_retrieval_data "https://github.com/materialczar50/automodel/blob/main/nemo_automodel/components/datasets/llm/retrieval_dataset.py"
click node_speculative "https://github.com/materialczar50/automodel/blob/main/nemo_automodel/recipes/llm/train_eagle3.py"
click node_checkpoint "https://github.com/materialczar50/automodel/blob/main/nemo_automodel/components/checkpoint/checkpointing.py"
click node_hf_storage "https://github.com/materialczar50/automodel/blob/main/nemo_automodel/components/checkpoint/_backports/hf_storage.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_cli,node_config,node_launcher,node_user toneBlue
class node_recipe,node_llm_recipe,node_datasets,node_loss toneAmber
class node_models,node_distributed_config,node_mesh,node_parallelizer,node_pipeline,node_lora toneMint
class node_diffusion,node_diffusion_data,node_retrieval,node_retrieval_data,node_speculative toneRose
class node_checkpoint,node_hf_storage,node_external_model toneIndigo
```

## Components

### Configuration and launch

- [Recipe CLI](https://github.com/materialczar50/automodel/blob/main/nemo_automodel/cli/app.py): `nemo_automodel/cli/app.py`
- [Config loader](https://github.com/materialczar50/automodel/blob/main/nemo_automodel/components/config/loader.py): `nemo_automodel/components/config/loader.py`
- [Launchers](https://github.com/materialczar50/automodel/tree/main/nemo_automodel/components/launcher): `nemo_automodel/components/launcher`

### Training workflow

- [Recipe orchestration](https://github.com/materialczar50/automodel/blob/main/nemo_automodel/recipes/base_recipe.py): `nemo_automodel/recipes/base_recipe.py`
- [LLM training recipes](https://github.com/materialczar50/automodel/blob/main/nemo_automodel/recipes/llm/train_eagle3.py): `nemo_automodel/recipes/llm/train_eagle3.py`
- [Training datasets](https://github.com/materialczar50/automodel/tree/main/nemo_automodel/components/datasets): `nemo_automodel/components/datasets`
- [Training losses](https://github.com/materialczar50/automodel/tree/main/nemo_automodel/components/loss): `nemo_automodel/components/loss`

### Model and parallel runtime

- [Model implementations](https://github.com/materialczar50/automodel/tree/main/nemo_automodel/components/models): `nemo_automodel/components/models`
- [Parallel config](https://github.com/materialczar50/automodel/blob/main/nemo_automodel/components/distributed/config.py): `nemo_automodel/components/distributed/config.py`
- [Device mesh](https://github.com/materialczar50/automodel/blob/main/nemo_automodel/components/distributed/mesh_utils.py): `nemo_automodel/components/distributed/mesh_utils.py`
- [Model parallelizer](https://github.com/materialczar50/automodel/blob/main/nemo_automodel/components/distributed/parallelizer.py): `nemo_automodel/components/distributed/parallelizer.py`
- [Pipeline parallelism](https://github.com/materialczar50/automodel/blob/main/nemo_automodel/components/distributed/pipelining/autopipeline.py): `nemo_automodel/components/distributed/pipelining/autopipeline.py`
- [LoRA adaptation](https://github.com/materialczar50/automodel/blob/main/nemo_automodel/components/_peft/lora.py): `nemo_automodel/components/_peft/lora.py`

### Specialized capabilities

- [Diffusion training](https://github.com/materialczar50/automodel/blob/main/nemo_automodel/components/flow_matching/pipeline.py): `nemo_automodel/components/flow_matching/pipeline.py`
- [Diffusion datasets](https://github.com/materialczar50/automodel/tree/main/nemo_automodel/components/datasets/diffusion): `nemo_automodel/components/datasets/diffusion`
- [Retrieval models](https://github.com/materialczar50/automodel/blob/main/nemo_automodel/_transformers/retrieval.py): `nemo_automodel/_transformers/retrieval.py`
- [Retrieval datasets](https://github.com/materialczar50/automodel/blob/main/nemo_automodel/components/datasets/llm/retrieval_dataset.py): `nemo_automodel/components/datasets/llm/retrieval_dataset.py`
- [Speculative training](https://github.com/materialczar50/automodel/blob/main/nemo_automodel/recipes/llm/train_eagle3.py): `nemo_automodel/recipes/llm/train_eagle3.py`

### Checkpointing and output

- [Checkpoint manager](https://github.com/materialczar50/automodel/blob/main/nemo_automodel/components/checkpoint/checkpointing.py): `nemo_automodel/components/checkpoint/checkpointing.py`
- [HF checkpoint storage](https://github.com/materialczar50/automodel/blob/main/nemo_automodel/components/checkpoint/_backports/hf_storage.py): `nemo_automodel/components/checkpoint/_backports/hf_storage.py`

### Other components

- **Training user**
- **Model sources**

## Connections

- Training user → Recipe CLI: provides YAML (evidence: `nemo_automodel/cli/app.py`)
- Recipe CLI → Config loader: loads config (evidence: `nemo_automodel/cli/app.py`)
- Recipe CLI → Launchers: selects launcher (evidence: `nemo_automodel/cli/app.py`)
- Recipe CLI → Recipe orchestration: runs recipe
- Config loader → Recipe orchestration: configures (evidence: `nemo_automodel/recipes/base_recipe.py`)
- Recipe orchestration → Checkpoint manager: saves state (evidence: `nemo_automodel/recipes/base_recipe.py`)
- Recipe orchestration → Device mesh: sets up mesh (evidence: `nemo_automodel/recipes/base_recipe.py`)
- LLM training recipes → Training datasets: uses data (evidence: `nemo_automodel/recipes/llm/train_eagle3.py`)
- LLM training recipes → Checkpoint manager: loads and saves (evidence: `nemo_automodel/recipes/llm/train_eagle3.py`)
- Recipe orchestration → Parallel config: reads strategy (evidence: `nemo_automodel/recipes/base_recipe.py`)
- Parallel config → Device mesh: configures mesh (evidence: `nemo_automodel/components/distributed/mesh_utils.py`)
- Device mesh → Model parallelizer: supplies parallel layout
- Model parallelizer → Model implementations: parallelizes
- Pipeline parallelism → Model implementations: pipelines model stages
- LLM training recipes → LoRA adaptation: applies adapters (evidence: `nemo_automodel/recipes/llm/train_eagle3.py`)
- LLM training recipes → Training losses: computes training loss
- Model sources → Model implementations: loads pretrained weights
- Diffusion training → Diffusion datasets: trains from batches
- Retrieval models → Retrieval datasets: uses retrieval data (evidence: `nemo_automodel/components/datasets/llm/retrieval_dataset.py`)
- Retrieval models → Model implementations: selects backbone (evidence: `nemo_automodel/_transformers/retrieval.py`)
- Speculative training → Training datasets: uses data (evidence: `nemo_automodel/recipes/llm/train_eagle3.py`)
- Checkpoint manager → HF checkpoint storage: uses storage backend (evidence: `nemo_automodel/components/checkpoint/checkpointing.py`)
