# akkshattshah/mokshavideoediting architecture

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

- Interactive diagram: https://gitdiagram.com/akkshattshah/mokshavideoediting
- Repository: https://github.com/akkshattshah/mokshavideoediting

## Overview

VRE’s implemented core analyzes a reference video into a structured Blueprint, then recommends a costed editing route. The principal workflow runs from CLI input through probing and shot, motion, frame, and audio analysis to the Blueprint and router. The repository also has a browser workflow for uploading references and planning edits, plus experimental generation integrations; README explicitly says the full recompile pipeline is not yet built. The UI excerpt is partial, so uncertain planning and generation internals are not expanded.

Main entry points: [`src/vre/decompile/pipeline.py`](https://github.com/akkshattshah/mokshavideoediting/blob/main/src/vre/decompile/pipeline.py) (Decompile orchestration), [`ui/server.py`](https://github.com/akkshattshah/mokshavideoediting/blob/main/ui/server.py) (Browser UI), [`src/vre/cli.py`](https://github.com/akkshattshah/mokshavideoediting/blob/main/src/vre/cli.py) (CLI commands), [`src/vre/router.py`](https://github.com/akkshattshah/mokshavideoediting/blob/main/src/vre/router.py) (Route selection)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["User entry"]
  node_cli["CLI commands<br/>[cli.py]"]
  node_webui["Browser UI<br/>[server.py]"]
end

subgraph group_analysis["Reference analysis"]
  node_pipeline["Decompile orchestration<br/>[pipeline.py]"]
  node_probe["Video probing<br/>[probe.py]"]
  node_backends["Backend registry<br/>[backends.py]"]
  node_shots["Shot detection<br/>[shots.py]"]
  node_motion["Motion analysis<br/>[motion.py]"]
  node_frames["Keyframe extraction<br/>[frames.py]"]
  node_audio["Audio analysis<br/>[audio.py]"]
end

subgraph group_decision["Blueprint and routing"]
  node_blueprint["Blueprint schema<br/>[schema.py]"]
  node_router["Route selection<br/>[router.py]"]
  node_pricing["Model pricing<br/>[pricing.py]"]
  node_costing["Cost profiles<br/>[costing.py]"]
  node_blueprint_file["blueprint.json<br/>[pipeline.py]"]
end

subgraph group_planning["Edit planning and integrations"]
  node_planner["Edit planning<br/>[planner.py]"]
  node_providers["Model API client<br/>[providers.py]"]
  node_tunnel["Public file tunnel<br/>[tunnel.py]"]
end

node_user(("Video editor"))
node_openrouter{{"OpenRouter"}}

node_user -->|"runs analysis"| node_cli
node_cli -->|"decompiles video"| node_pipeline
node_pipeline -->|"probes source"| node_probe
node_pipeline -->|"records availability"| node_backends
node_pipeline -->|"detects shots"| node_shots
node_pipeline -->|"classifies motion"| node_motion
node_pipeline -->|"extracts frames"| node_frames
node_pipeline -->|"analyzes audio"| node_audio
node_pipeline -->|"assembles analysis"| node_blueprint
node_pipeline -->|"saves blueprint"| node_blueprint_file
node_cli -->|"routes blueprint"| node_router
node_router -->|"estimates models"| node_pricing
node_cli -->|"reports costs"| node_costing
node_user -->|"uploads reference"| node_webui
node_webui -->|"analyzes reference"| node_pipeline
node_webui -->|"builds or revises plan"| node_planner
node_webui -.->|"submits generation jobs"| node_providers
node_webui -.->|"stages public inputs"| node_tunnel
node_providers -.->|"calls model API"| node_openrouter

click node_cli "https://github.com/akkshattshah/mokshavideoediting/blob/main/src/vre/cli.py"
click node_webui "https://github.com/akkshattshah/mokshavideoediting/blob/main/ui/server.py"
click node_pipeline "https://github.com/akkshattshah/mokshavideoediting/blob/main/src/vre/decompile/pipeline.py"
click node_probe "https://github.com/akkshattshah/mokshavideoediting/blob/main/src/vre/probe.py"
click node_backends "https://github.com/akkshattshah/mokshavideoediting/blob/main/src/vre/backends.py"
click node_shots "https://github.com/akkshattshah/mokshavideoediting/blob/main/src/vre/decompile/shots.py"
click node_motion "https://github.com/akkshattshah/mokshavideoediting/blob/main/src/vre/decompile/motion.py"
click node_frames "https://github.com/akkshattshah/mokshavideoediting/blob/main/src/vre/decompile/frames.py"
click node_audio "https://github.com/akkshattshah/mokshavideoediting/blob/main/src/vre/decompile/audio.py"
click node_blueprint "https://github.com/akkshattshah/mokshavideoediting/blob/main/src/vre/schema.py"
click node_router "https://github.com/akkshattshah/mokshavideoediting/blob/main/src/vre/router.py"
click node_pricing "https://github.com/akkshattshah/mokshavideoediting/blob/main/src/vre/pricing.py"
click node_costing "https://github.com/akkshattshah/mokshavideoediting/blob/main/src/vre/costing.py"
click node_planner "https://github.com/akkshattshah/mokshavideoediting/blob/main/src/vre/planner.py"
click node_providers "https://github.com/akkshattshah/mokshavideoediting/blob/main/src/vre/providers.py"
click node_tunnel "https://github.com/akkshattshah/mokshavideoediting/blob/main/src/vre/tunnel.py"
click node_blueprint_file "https://github.com/akkshattshah/mokshavideoediting/blob/main/src/vre/decompile/pipeline.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_webui toneBlue
class node_pipeline,node_probe,node_backends,node_shots,node_motion,node_frames,node_audio toneAmber
class node_blueprint,node_router,node_pricing,node_costing,node_blueprint_file,node_openrouter toneMint
class node_planner,node_providers,node_tunnel toneRose
class node_user toneIndigo
```

## Components

### User entry

- [CLI commands](https://github.com/akkshattshah/mokshavideoediting/blob/main/src/vre/cli.py): `src/vre/cli.py`
- [Browser UI](https://github.com/akkshattshah/mokshavideoediting/blob/main/ui/server.py): `ui/server.py`

### Reference analysis

- [Decompile orchestration](https://github.com/akkshattshah/mokshavideoediting/blob/main/src/vre/decompile/pipeline.py): `src/vre/decompile/pipeline.py`
- [Video probing](https://github.com/akkshattshah/mokshavideoediting/blob/main/src/vre/probe.py): `src/vre/probe.py`
- [Backend registry](https://github.com/akkshattshah/mokshavideoediting/blob/main/src/vre/backends.py): `src/vre/backends.py`
- [Shot detection](https://github.com/akkshattshah/mokshavideoediting/blob/main/src/vre/decompile/shots.py): `src/vre/decompile/shots.py`
- [Motion analysis](https://github.com/akkshattshah/mokshavideoediting/blob/main/src/vre/decompile/motion.py): `src/vre/decompile/motion.py`
- [Keyframe extraction](https://github.com/akkshattshah/mokshavideoediting/blob/main/src/vre/decompile/frames.py): `src/vre/decompile/frames.py`
- [Audio analysis](https://github.com/akkshattshah/mokshavideoediting/blob/main/src/vre/decompile/audio.py): `src/vre/decompile/audio.py`

### Blueprint and routing

- [Blueprint schema](https://github.com/akkshattshah/mokshavideoediting/blob/main/src/vre/schema.py): `src/vre/schema.py`
- [Route selection](https://github.com/akkshattshah/mokshavideoediting/blob/main/src/vre/router.py): `src/vre/router.py`
- [Model pricing](https://github.com/akkshattshah/mokshavideoediting/blob/main/src/vre/pricing.py): `src/vre/pricing.py`
- [Cost profiles](https://github.com/akkshattshah/mokshavideoediting/blob/main/src/vre/costing.py): `src/vre/costing.py`
- [blueprint.json](https://github.com/akkshattshah/mokshavideoediting/blob/main/src/vre/decompile/pipeline.py): `src/vre/decompile/pipeline.py`

### Edit planning and integrations

- [Edit planning](https://github.com/akkshattshah/mokshavideoediting/blob/main/src/vre/planner.py): `src/vre/planner.py`
- [Model API client](https://github.com/akkshattshah/mokshavideoediting/blob/main/src/vre/providers.py): `src/vre/providers.py`
- [Public file tunnel](https://github.com/akkshattshah/mokshavideoediting/blob/main/src/vre/tunnel.py): `src/vre/tunnel.py`

### Other components

- **Video editor**
- **OpenRouter**

## Connections

- Video editor → CLI commands: runs analysis
- CLI commands → Decompile orchestration: decompiles video
- Decompile orchestration → Video probing: probes source
- Decompile orchestration → Backend registry: records availability
- Decompile orchestration → Shot detection: detects shots
- Decompile orchestration → Motion analysis: classifies motion
- Decompile orchestration → Keyframe extraction: extracts frames
- Decompile orchestration → Audio analysis: analyzes audio
- Decompile orchestration → Blueprint schema: assembles analysis
- Decompile orchestration → blueprint.json: saves blueprint
- CLI commands → Route selection: routes blueprint
- Route selection → Model pricing: estimates models
- CLI commands → Cost profiles: reports costs
- Video editor → Browser UI: uploads reference
- Browser UI → Decompile orchestration: analyzes reference
- Browser UI → Edit planning: builds or revises plan
- Browser UI → Model API client: submits generation jobs
- Browser UI → Public file tunnel: stages public inputs
- Model API client → OpenRouter: calls model API
