# multimodal-art-projection/yue architecture

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

- Interactive diagram: https://gitdiagram.com/multimodal-art-projection/yue
- Repository: https://github.com/multimodal-art-projection/yue

## Overview

YuE2 is a local music-generation runtime and agent skill: users provide lyrics and style, receive an editable symbolic plan, then generate and decode audio. Covers start from a transcribed score; the instrumental skill prepares or adapts scores before generation. The graph reflects README-documented stages and indexed source references; unsampled implementation details and editing internals are not expanded into speculative call paths.

Main entry points: [`src/yue2/pipeline.py`](https://github.com/multimodal-art-projection/yue/blob/main/src/yue2/pipeline.py) (Generation Pipeline), [`skills/yue2-music/instrumental/scripts/instrumental.py`](https://github.com/multimodal-art-projection/yue/blob/main/skills/yue2-music/instrumental/scripts/instrumental.py) (Instrumental Workflow), [`src/yue2/cli.py`](https://github.com/multimodal-art-projection/yue/blob/main/src/yue2/cli.py) (Python CLI), [`skills/yue2-music`](https://github.com/multimodal-art-projection/yue/tree/main/skills/yue2-music) (Music Agent Skill)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["User Interfaces"]
  node_cli["Python CLI<br/>[cli.py]"]
  node_music_skill["Music Agent Skill"]
end

subgraph group_composition["Composition Workflows"]
  node_instrumental["Instrumental Workflow<br/>[instrumental.py]"]
  node_score_transcription["Cover Transcription"]
  node_score_compile["Event Compiler<br/>[compile_score.py]"]
end

subgraph group_generation["Generation Runtime"]
  node_pipeline["Generation Pipeline<br/>[pipeline.py]"]
  node_protocol["Request Protocol<br/>[protocol.py]"]
  node_sampling["Token Sampling<br/>[sampling.py]"]
  node_nar["Acoustic Synthesis<br/>[nar.py]"]
  node_device["Device Selection<br/>[devices.py]"]
  node_placement["Model Placement<br/>[placement.py]"]
  node_progress["Progress Reporting<br/>[progress.py]"]
  node_tokenizer["YuE2 Tokenizer"]
end

subgraph group_models["Models and Acceleration"]
  node_ar_model["AR-NAR Transformer<br/>[modeling_yue2.py]"]
  node_vae["Audio VAE<br/>[modeling_vae.py]"]
  node_vllm["Optional vLLM Worker<br/>[fast.py]"]
  node_cuda_graph["CUDA Graph Support<br/>[cuda_graph.py]"]
end

subgraph group_artifacts["Artifacts and Scores"]
  node_abc_tools["ABC Score Tools<br/>[abc_tools.py]"]
  node_storage[("Model and Result Storage<br/>[storage.py]")]
  node_score["Editable ABC Score<br/>[abc_tools.py]"]
  node_audio["Generated Audio"]
end

node_user(("Creator or Agent"))

node_user -->|"submits request"| node_cli
node_user -->|"requests music"| node_music_skill
node_cli -->|"invokes generation"| node_pipeline
node_pipeline -->|"validates request"| node_protocol
node_pipeline -->|"configures sampling"| node_sampling
node_pipeline -->|"encodes prompts"| node_tokenizer
node_pipeline -->|"plans and generates"| node_ar_model
node_pipeline -->|"synthesizes latents"| node_nar
node_pipeline -->|"decodes latents"| node_vae
node_pipeline -->|"selects device"| node_device
node_pipeline -->|"places models"| node_placement
node_pipeline -->|"reports progress"| node_progress
node_pipeline -->|"loads and saves"| node_storage
node_sampling -->|"may use graphs"| node_cuda_graph
node_pipeline -.->|"may select backend"| node_vllm
node_pipeline -->|"returns audio"| node_audio
node_pipeline -->|"produces plan"| node_score
node_music_skill -.->|"runs workflow"| node_instrumental
node_instrumental -->|"transcribes references"| node_score_transcription
node_instrumental -->|"compiles events"| node_score_compile
node_instrumental -->|"validates score"| node_abc_tools
node_score_compile -->|"checks chord symbols"| node_abc_tools
node_instrumental -.->|"submits generation"| node_cli

click node_cli "https://github.com/multimodal-art-projection/yue/blob/main/src/yue2/cli.py"
click node_music_skill "https://github.com/multimodal-art-projection/yue/tree/main/skills/yue2-music"
click node_instrumental "https://github.com/multimodal-art-projection/yue/blob/main/skills/yue2-music/instrumental/scripts/instrumental.py"
click node_score_transcription "https://github.com/multimodal-art-projection/yue/blob/main/skills/yue2-music/instrumental/scripts/transcribe_cover.py"
click node_score_compile "https://github.com/multimodal-art-projection/yue/blob/main/skills/yue2-music/instrumental/scripts/compile_score.py"
click node_abc_tools "https://github.com/multimodal-art-projection/yue/blob/main/skills/yue2-music/scripts/abc_tools.py"
click node_pipeline "https://github.com/multimodal-art-projection/yue/blob/main/src/yue2/pipeline.py"
click node_protocol "https://github.com/multimodal-art-projection/yue/blob/main/src/yue2/protocol.py"
click node_sampling "https://github.com/multimodal-art-projection/yue/blob/main/src/yue2/sampling.py"
click node_nar "https://github.com/multimodal-art-projection/yue/blob/main/src/yue2/nar.py"
click node_ar_model "https://github.com/multimodal-art-projection/yue/blob/main/src/yue2/modeling_yue2.py"
click node_vae "https://github.com/multimodal-art-projection/yue/blob/main/src/yue2/modeling_vae.py"
click node_vllm "https://github.com/multimodal-art-projection/yue/blob/main/src/yue2/fast.py"
click node_cuda_graph "https://github.com/multimodal-art-projection/yue/blob/main/src/yue2/cuda_graph.py"
click node_device "https://github.com/multimodal-art-projection/yue/blob/main/src/yue2/devices.py"
click node_placement "https://github.com/multimodal-art-projection/yue/blob/main/src/yue2/placement.py"
click node_progress "https://github.com/multimodal-art-projection/yue/blob/main/src/yue2/progress.py"
click node_storage "https://github.com/multimodal-art-projection/yue/blob/main/src/yue2/storage.py"
click node_tokenizer "https://github.com/multimodal-art-projection/yue/blob/main/src/yue2/tokenization_yue2.py"
click node_score "https://github.com/multimodal-art-projection/yue/blob/main/skills/yue2-music/scripts/abc_tools.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_music_skill toneBlue
class node_instrumental,node_score_transcription,node_score_compile toneAmber
class node_pipeline,node_protocol,node_sampling,node_nar,node_device,node_placement,node_progress,node_tokenizer toneMint
class node_ar_model,node_vae,node_vllm,node_cuda_graph toneRose
class node_abc_tools,node_storage,node_score,node_audio,node_user toneIndigo
```

## Components

### User Interfaces

- [Python CLI](https://github.com/multimodal-art-projection/yue/blob/main/src/yue2/cli.py): `src/yue2/cli.py`
- [Music Agent Skill](https://github.com/multimodal-art-projection/yue/tree/main/skills/yue2-music): `skills/yue2-music`

### Composition Workflows

- [Instrumental Workflow](https://github.com/multimodal-art-projection/yue/blob/main/skills/yue2-music/instrumental/scripts/instrumental.py): `skills/yue2-music/instrumental/scripts/instrumental.py`
- [Cover Transcription](https://github.com/multimodal-art-projection/yue/blob/main/skills/yue2-music/instrumental/scripts/transcribe_cover.py): `skills/yue2-music/instrumental/scripts/transcribe_cover.py`
- [Event Compiler](https://github.com/multimodal-art-projection/yue/blob/main/skills/yue2-music/instrumental/scripts/compile_score.py): `skills/yue2-music/instrumental/scripts/compile_score.py`

### Generation Runtime

- [Generation Pipeline](https://github.com/multimodal-art-projection/yue/blob/main/src/yue2/pipeline.py): `src/yue2/pipeline.py`
- [Request Protocol](https://github.com/multimodal-art-projection/yue/blob/main/src/yue2/protocol.py): `src/yue2/protocol.py`
- [Token Sampling](https://github.com/multimodal-art-projection/yue/blob/main/src/yue2/sampling.py): `src/yue2/sampling.py`
- [Acoustic Synthesis](https://github.com/multimodal-art-projection/yue/blob/main/src/yue2/nar.py): `src/yue2/nar.py`
- [Device Selection](https://github.com/multimodal-art-projection/yue/blob/main/src/yue2/devices.py): `src/yue2/devices.py`
- [Model Placement](https://github.com/multimodal-art-projection/yue/blob/main/src/yue2/placement.py): `src/yue2/placement.py`
- [Progress Reporting](https://github.com/multimodal-art-projection/yue/blob/main/src/yue2/progress.py): `src/yue2/progress.py`
- [YuE2 Tokenizer](https://github.com/multimodal-art-projection/yue/blob/main/src/yue2/tokenization_yue2.py): `src/yue2/tokenization_yue2.py`

### Models and Acceleration

- [AR-NAR Transformer](https://github.com/multimodal-art-projection/yue/blob/main/src/yue2/modeling_yue2.py): `src/yue2/modeling_yue2.py`
- [Audio VAE](https://github.com/multimodal-art-projection/yue/blob/main/src/yue2/modeling_vae.py): `src/yue2/modeling_vae.py`
- [Optional vLLM Worker](https://github.com/multimodal-art-projection/yue/blob/main/src/yue2/fast.py): `src/yue2/fast.py`
- [CUDA Graph Support](https://github.com/multimodal-art-projection/yue/blob/main/src/yue2/cuda_graph.py): `src/yue2/cuda_graph.py`

### Artifacts and Scores

- [ABC Score Tools](https://github.com/multimodal-art-projection/yue/blob/main/skills/yue2-music/scripts/abc_tools.py): `skills/yue2-music/scripts/abc_tools.py`
- [Model and Result Storage](https://github.com/multimodal-art-projection/yue/blob/main/src/yue2/storage.py): `src/yue2/storage.py`
- [Editable ABC Score](https://github.com/multimodal-art-projection/yue/blob/main/skills/yue2-music/scripts/abc_tools.py): `skills/yue2-music/scripts/abc_tools.py`
- **Generated Audio**

### Other components

- **Creator or Agent**

## Connections

- Creator or Agent → Python CLI: submits request (evidence: `README.md`)
- Creator or Agent → Music Agent Skill: requests music (evidence: `README.md`)
- Python CLI → Generation Pipeline: invokes generation (evidence: `src/yue2/cli.py`)
- Generation Pipeline → Request Protocol: validates request (evidence: `src/yue2/pipeline.py`)
- Generation Pipeline → Token Sampling: configures sampling (evidence: `src/yue2/pipeline.py`)
- Generation Pipeline → YuE2 Tokenizer: encodes prompts (evidence: `src/yue2/pipeline.py`)
- Generation Pipeline → AR-NAR Transformer: plans and generates (evidence: `README.md`)
- Generation Pipeline → Acoustic Synthesis: synthesizes latents (evidence: `README.md`)
- Generation Pipeline → Audio VAE: decodes latents (evidence: `README.md`)
- Generation Pipeline → Device Selection: selects device (evidence: `src/yue2/pipeline.py`)
- Generation Pipeline → Model Placement: places models (evidence: `src/yue2/pipeline.py`)
- Generation Pipeline → Progress Reporting: reports progress (evidence: `src/yue2/pipeline.py`)
- Generation Pipeline → Model and Result Storage: loads and saves (evidence: `src/yue2/pipeline.py`)
- Token Sampling → CUDA Graph Support: may use graphs (evidence: `src/yue2/sampling.py`)
- Generation Pipeline → Optional vLLM Worker: may select backend (evidence: `src/yue2/pipeline.py`)
- Generation Pipeline → Generated Audio: returns audio (evidence: `README.md`)
- Generation Pipeline → Editable ABC Score: produces plan (evidence: `README.md`)
- Music Agent Skill → Instrumental Workflow: runs workflow (evidence: `README.md`)
- Instrumental Workflow → Cover Transcription: transcribes references (evidence: `skills/yue2-music/instrumental/scripts/instrumental.py`)
- Instrumental Workflow → Event Compiler: compiles events (evidence: `skills/yue2-music/instrumental/scripts/instrumental.py`)
- Instrumental Workflow → ABC Score Tools: validates score (evidence: `skills/yue2-music/instrumental/scripts/instrumental.py`)
- Event Compiler → ABC Score Tools: checks chord symbols (evidence: `skills/yue2-music/instrumental/scripts/compile_score.py`)
- Instrumental Workflow → Python CLI: submits generation
