# ixi-enki/vllm-omni architecture

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

- Interactive diagram: https://gitdiagram.com/ixi-enki/vllm-omni
- Repository: https://github.com/ixi-enki/vllm-omni

## Overview

1. **Overall shape**
   - This repository is a multimodal serving framework built around the `vllm_omni` Python package.
   - It supports two major execution families: **autoregressive (AR)** models and **diffusion / DiT-style** models, with shared serving, scheduling, and deployment concepts across both.

2. **User-facing entrypoints**
   - Requests typically enter through `vllm_omni/entrypoints`, especially the **OpenAI-compatible API server** and the **CLI serve/benchmark commands**.
   - The repository also includes many offline and online example clients under `examples/`, plus ComfyUI integration under `apps/ComfyUI-vLLM-Omni`.

3. **Core orchestration layer**
   - The `vllm_omni/engine` package is the control plane for request lifecycle, stage startup, stage pools, output processing, and orchestrating multi-stage execution.
   - This layer is where the system decides how a request is split, routed, resumed, streamed, or completed across one or more model stages.

4. **Autoregressive serving path**
   - AR serving is centered in `vllm_omni/worker`, `vllm_omni/model_executor`, `vllm_omni/core/sched`, and `vllm_omni/inputs`.
   - `model_executor` contains model implementations and pipelines for audio/text/omni models such as Qwen3-Omni, Qwen3-TTS, GLM-TTS, Fish-Speech, Voxtral, CosyVoice, Mimo-Audio, and others.
   - `stage_input_processors` convert high-level requests into stage-specific tensors or tokens before execution.

5. **Diffusion serving path**
   - Diffusion workloads are handled separately under `vllm_omni/diffusion`.
   - This subtree contains its own request objects, scheduler, engine, worker, model loader, model registry, and many model-specific pipelines for image/video/audio generation.
   - It is not just “another model family”; it has its own execution model for step-based generation, batching, caching, and optional distributed VAE/parallel decoding.

6. **Distributed and disaggregated execution**
   - A major architectural boundary is `vllm_omni/distributed`, which implements **OmniConnector**-based disaggregation and cross-stage data transfer.
   - `omni_coordinator` manages coordination and load balancing, while `omni_connectors` provides connector implementations such as shared memory, Mooncake, and Yuanrong transfer backends.
   - This is the layer that enables fully disaggregated stage placement and dynamic resource allocation across hubs/stages.

7. **Pipeline and model composition**
   - Model-specific pipelines live in `vllm_omni/model_executor/models` and `vllm_omni/diffusion/models`.
   - These pipelines encode the exact dataflow for each supported model family: tokenizer/preprocess → model inference → decoder/vocoder/renderer → output packaging.
   - The architecture is intentionally plugin-like: the common runtime stays generic while model logic is isolated per pipeline and per modality.

8. **Cross-cutting model features**
   - `vllm_omni/lora` and diffusion LoRA code provide adapter-style fine-tuning support.
   - `vllm_omni/quantization` and diffusion quantization modules handle multiple quantization formats and adapters.
   - `vllm_omni/utils/speaker_cache.py`, media utilities, and output templates support shared multimodal concerns such as speaker identity, audio handling, and output normalization.

9. **Platform and hardware boundaries**
   - Hardware-specific adaptations are isolated under `vllm_omni/platforms`, with distinct support for **CUDA, ROCm, MUSA, NPU, and XPU**.
   - These platform packages provide specialized workers, profiling, quantization hooks, and in some cases connector or model patches.
   - This makes platform support a first-class architectural boundary rather than a thin compatibility layer.

10. **Deployment and configuration**
   - Deployment manifests live in `vllm_omni/deploy/`, with YAMLs tailored to specific model families and replica/topology choices.
   - `stage_configs`, `config`, and `transformers_utils` define how model/stage behavior is parameterized and mapped from external configs.
   - Example shell scripts and YAMLs in `.buildkite/`, `docker/`, and `recipes/` reflect the supported deployment matrix and production test setups.

11. **Serving API surface**
   - The OpenAI-compatible server exposes multimodal endpoints for chat, audio generation, speech, image generation/editing, and video streaming.
   - Under `vllm_omni/entrypoints/openai`, protocol definitions and endpoint handlers translate HTTP/WebSocket requests into internal stage requests and streaming responses.

12. **Validation, benchmarking, and regression**
   - `benchmarks/` contains accuracy/performance tooling for TTS, diffusion, serving, and distributed scenarios.
   - `tests/` is extensive and mirrors the architecture: entrypoints, engine, diffusion, distributed connectors, model executors, platform overrides, and end-to-end serving.
   - This indicates the repo is designed as a production serving system with strong regression coverage across model families and hardware backends.

13. **Docs and operational knowledge**
   - `docs/` and `recipes/` are part of the architecture because they codify supported model flows, deployment patterns, and feature boundaries.
   - The docs are organized around serving APIs, configuration, examples, diffusion parallelism, omni connectors, and model onboarding, which closely match the code structure.

14. **Typical data flow**
   - A request enters the API/CLI layer, gets normalized into an internal request object, is routed by the engine/orchestrator into one or more stages, processed by model-specific executors, and then serialized back as text, audio, image, or video output.
   - For distributed runs, intermediate tensors or KV-like artifacts may cross process/node boundaries through OmniConnectors or stage-to-stage IPC.
   - For diffusion, the flow is step-oriented rather than token-oriented, but the same high-level pattern applies: request normalization → scheduler → worker/pipeline → postprocessing → streaming or final response.

Main entry points: [`vllm_omni/engine/orchestrator.py`](https://github.com/ixi-enki/vllm-omni/blob/main/vllm_omni/engine/orchestrator.py) (Engine core), [`vllm_omni/worker/gpu_ar_worker.py`](https://github.com/ixi-enki/vllm-omni/blob/main/vllm_omni/worker/gpu_ar_worker.py) (AR worker), [`vllm_omni/diffusion/diffusion_engine.py`](https://github.com/ixi-enki/vllm-omni/blob/main/vllm_omni/diffusion/diffusion_engine.py) (Diffusion engine), [`vllm_omni/diffusion/worker/diffusion_worker.py`](https://github.com/ixi-enki/vllm-omni/blob/main/vllm_omni/diffusion/worker/diffusion_worker.py) (Diffusion worker)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_g_entry["Serving entrypoints"]
  node_n_api["OpenAI API<br/>server/protocol<br/>[api_server.py]"]
  node_n_cli["CLI serve<br/>cli/benchmark<br/>[main.py]"]
  node_n_async["Async Omni<br/>runtime entrypoint<br/>[async_omni.py]"]
end

subgraph group_g_engine["Core orchestration"]
  node_n_engine["Engine core<br/>orchestrator<br/>[orchestrator.py]"]
  node_n_stagepool["Stage pool<br/>stage runtime<br/>[stage_pool.py]"]
  node_n_output["Output proc<br/>response shaping"]
end

subgraph group_g_ar["Autoregressive path"]
  node_n_ar_sched["AR scheduler<br/>token scheduler"]
  node_n_inputs["Stage inputs<br/>preprocess"]
  node_n_ar_models["AR pipelines<br/>model executor"]
  node_n_ar_worker["AR worker<br/>runtime worker<br/>[gpu_ar_worker.py]"]
end

subgraph group_g_dif["Diffusion path"]
  node_n_dif_req["Diffusion request<br/>request model<br/>[request.py]"]
  node_n_dif_sched["Diffusion scheduler<br/>step scheduler<br/>[step_scheduler.py]"]
  node_n_dif_engine["Diffusion engine<br/>diffusion runtime"]
  node_n_dif_worker["Diffusion worker"]
  node_n_dif_models["Diffusion models<br/>pipelines/models"]
end

subgraph group_g_dist["Distributed transport"]
  node_n_connect["Omni connectors<br/>disagg transport"]
  node_n_coord["Coordinator<br/>load balancer"]
end

subgraph group_g_hw["Platform support"]
  node_n_cuda["CUDA path<br/>platform backend<br/>[platform.py]"]
  node_n_npu["NPU path<br/>platform backend<br/>[platform.py]"]
  node_n_xpu["XPU path<br/>platform backend<br/>[platform.py]"]
end

subgraph group_g_ext["Extensions and ops"]
  node_n_deploy["Deploy configs<br/>manifests"]
  node_n_docs["Docs<br/>documentation"]
  node_n_examples["Examples<br/>samples"]
end

node_n_api -->|"submits requests"| node_n_engine
node_n_cli -->|"starts serve"| node_n_engine
node_n_async -->|"dispatches"| node_n_engine
node_n_engine -->|"spawns stages"| node_n_stagepool
node_n_engine -->|"formats outputs"| node_n_output
node_n_engine -->|"AR scheduling"| node_n_ar_sched
node_n_engine -->|"diffusion route"| node_n_dif_engine
node_n_ar_sched -->|"prepares stages"| node_n_inputs
node_n_inputs -->|"feeds pipelines"| node_n_ar_models
node_n_ar_models -->|"executes on"| node_n_ar_worker
node_n_dif_engine -->|"normalizes"| node_n_dif_req
node_n_dif_engine -->|"schedules steps"| node_n_dif_sched
node_n_dif_sched -->|"drives workers"| node_n_dif_worker
node_n_dif_worker -->|"runs pipelines"| node_n_dif_models
node_n_connect -->|"reports state"| node_n_coord
node_n_coord -->|"placement control"| node_n_engine
node_n_ar_worker -->|"GPU backend"| node_n_cuda
node_n_ar_worker -->|"NPU backend"| node_n_npu
node_n_ar_worker -->|"XPU backend"| node_n_xpu
node_n_dif_worker -->|"GPU backend"| node_n_cuda
node_n_docs -.->|"documents"| node_n_deploy
node_n_examples -.->|"exercises"| node_n_api

click node_n_api "https://github.com/ixi-enki/vllm-omni/blob/main/vllm_omni/entrypoints/openai/api_server.py"
click node_n_cli "https://github.com/ixi-enki/vllm-omni/blob/main/vllm_omni/entrypoints/cli/main.py"
click node_n_async "https://github.com/ixi-enki/vllm-omni/blob/main/vllm_omni/entrypoints/async_omni.py"
click node_n_engine "https://github.com/ixi-enki/vllm-omni/blob/main/vllm_omni/engine/orchestrator.py"
click node_n_stagepool "https://github.com/ixi-enki/vllm-omni/blob/main/vllm_omni/engine/stage_pool.py"
click node_n_output "https://github.com/ixi-enki/vllm-omni/blob/main/vllm_omni/engine/output_processor.py"
click node_n_ar_sched "https://github.com/ixi-enki/vllm-omni/blob/main/vllm_omni/core/sched/omni_ar_scheduler.py"
click node_n_inputs "https://github.com/ixi-enki/vllm-omni/tree/main/vllm_omni/model_executor/stage_input_processors"
click node_n_ar_models "https://github.com/ixi-enki/vllm-omni/tree/main/vllm_omni/model_executor/models"
click node_n_ar_worker "https://github.com/ixi-enki/vllm-omni/blob/main/vllm_omni/worker/gpu_ar_worker.py"
click node_n_dif_req "https://github.com/ixi-enki/vllm-omni/blob/main/vllm_omni/diffusion/request.py"
click node_n_dif_sched "https://github.com/ixi-enki/vllm-omni/blob/main/vllm_omni/diffusion/sched/step_scheduler.py"
click node_n_dif_engine "https://github.com/ixi-enki/vllm-omni/blob/main/vllm_omni/diffusion/diffusion_engine.py"
click node_n_dif_worker "https://github.com/ixi-enki/vllm-omni/blob/main/vllm_omni/diffusion/worker/diffusion_worker.py"
click node_n_dif_models "https://github.com/ixi-enki/vllm-omni/tree/main/vllm_omni/diffusion/models"
click node_n_connect "https://github.com/ixi-enki/vllm-omni/tree/main/vllm_omni/distributed/omni_connectors"
click node_n_coord "https://github.com/ixi-enki/vllm-omni/blob/main/vllm_omni/distributed/omni_coordinator/omni_coordinator.py"
click node_n_cuda "https://github.com/ixi-enki/vllm-omni/blob/main/vllm_omni/platforms/cuda/platform.py"
click node_n_npu "https://github.com/ixi-enki/vllm-omni/blob/main/vllm_omni/platforms/npu/platform.py"
click node_n_xpu "https://github.com/ixi-enki/vllm-omni/blob/main/vllm_omni/platforms/xpu/platform.py"
click node_n_deploy "https://github.com/ixi-enki/vllm-omni/tree/main/vllm_omni/deploy"
click node_n_docs "https://github.com/ixi-enki/vllm-omni/tree/main/docs"
click node_n_examples "https://github.com/ixi-enki/vllm-omni/tree/main/examples"

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_n_api,node_n_cli,node_n_async,node_n_deploy,node_n_docs,node_n_examples toneBlue
class node_n_engine,node_n_stagepool,node_n_output toneAmber
class node_n_ar_sched,node_n_inputs,node_n_ar_models,node_n_ar_worker toneMint
class node_n_dif_req,node_n_dif_sched,node_n_dif_engine,node_n_dif_worker,node_n_dif_models toneRose
class node_n_connect,node_n_coord toneIndigo
class node_n_cuda,node_n_npu,node_n_xpu toneTeal
```

## Components

### Serving entrypoints

Public API, CLI, and client-facing request entrypaths.

- [OpenAI API](https://github.com/ixi-enki/vllm-omni/blob/main/vllm_omni/entrypoints/openai/api_server.py): server/protocol · OpenAI-compatible HTTP/WebSocket server and multimodal endpoint handlers. · `vllm_omni/entrypoints/openai/api_server.py`
- [CLI serve](https://github.com/ixi-enki/vllm-omni/blob/main/vllm_omni/entrypoints/cli/main.py): cli/benchmark · Command-line serve and benchmark entrypoints. · `vllm_omni/entrypoints/cli/main.py`
- [Async Omni](https://github.com/ixi-enki/vllm-omni/blob/main/vllm_omni/entrypoints/async_omni.py): runtime entrypoint · Async request entry and top-level omni serving glue. · `vllm_omni/entrypoints/async_omni.py`

### Core orchestration

Lifecycle management, request routing, and stage coordination.

- [Engine core](https://github.com/ixi-enki/vllm-omni/blob/main/vllm_omni/engine/orchestrator.py): orchestrator · Request lifecycle, stage startup, output handling, and multi-stage execution. · `vllm_omni/engine/orchestrator.py`
- [Stage pool](https://github.com/ixi-enki/vllm-omni/blob/main/vllm_omni/engine/stage_pool.py): stage runtime · Stage process management and startup coordination. · `vllm_omni/engine/stage_pool.py`
- [Output proc](https://github.com/ixi-enki/vllm-omni/blob/main/vllm_omni/engine/output_processor.py): response shaping · Streaming, modality, and final response assembly. · `vllm_omni/engine/output_processor.py`

### Autoregressive path

AR serving stack for text, audio, and omni model families.

- [AR scheduler](https://github.com/ixi-enki/vllm-omni/blob/main/vllm_omni/core/sched/omni_ar_scheduler.py): token scheduler · Autoregressive scheduling and prefix-cache coordination. · `vllm_omni/core/sched/omni_ar_scheduler.py`
- [Stage inputs](https://github.com/ixi-enki/vllm-omni/tree/main/vllm_omni/model_executor/stage_input_processors): preprocess · Request-to-stage normalization and tensor/token preparation. · `vllm_omni/model_executor/stage_input_processors`
- [AR pipelines](https://github.com/ixi-enki/vllm-omni/tree/main/vllm_omni/model_executor/models): model executor · Autoregressive model families and their token/audio/text pipelines. · `vllm_omni/model_executor/models`
- [AR worker](https://github.com/ixi-enki/vllm-omni/blob/main/vllm_omni/worker/gpu_ar_worker.py): runtime worker · GPU/accelerator AR execution and model runner layer. · `vllm_omni/worker/gpu_ar_worker.py`

### Diffusion path

Step-based diffusion/DiT serving stack and model pipelines.

- [Diffusion request](https://github.com/ixi-enki/vllm-omni/blob/main/vllm_omni/diffusion/request.py): request model · Diffusion-specific request and batch structures. · `vllm_omni/diffusion/request.py`
- [Diffusion scheduler](https://github.com/ixi-enki/vllm-omni/blob/main/vllm_omni/diffusion/sched/step_scheduler.py): step scheduler · Step-oriented request and execution scheduling for diffusion workloads. · `vllm_omni/diffusion/sched/step_scheduler.py`
- [Diffusion engine](https://github.com/ixi-enki/vllm-omni/blob/main/vllm_omni/diffusion/diffusion_engine.py): diffusion runtime · Diffusion control plane for batching, stepping, and worker orchestration. · `vllm_omni/diffusion/diffusion_engine.py`
- [Diffusion worker](https://github.com/ixi-enki/vllm-omni/blob/main/vllm_omni/diffusion/worker/diffusion_worker.py): diffusion worker · Model runner, input batching, and execution backend for diffusion inference. · `vllm_omni/diffusion/worker/diffusion_worker.py`
- [Diffusion models](https://github.com/ixi-enki/vllm-omni/tree/main/vllm_omni/diffusion/models): pipelines/models · Model-specific diffusion pipelines, transformers, attention, caching, LoRA, and loaders. · `vllm_omni/diffusion/models`

### Distributed transport

Disaggregation, connectors, and coordinator for multi-stage placement.

- [Omni connectors](https://github.com/ixi-enki/vllm-omni/tree/main/vllm_omni/distributed/omni_connectors): disagg transport · Stage-to-stage transfer adapters and KV/data movement backends. · `vllm_omni/distributed/omni_connectors`
- [Coordinator](https://github.com/ixi-enki/vllm-omni/blob/main/vllm_omni/distributed/omni_coordinator/omni_coordinator.py): load balancer · Hub/stage coordination, placement, and load balancing for disaggregated runs. · `vllm_omni/distributed/omni_coordinator/omni_coordinator.py`

### Platform support

Hardware-specific workers, profiling, and backend adaptations.

- [CUDA path](https://github.com/ixi-enki/vllm-omni/blob/main/vllm_omni/platforms/cuda/platform.py): platform backend · CUDA platform integration and default GPU backend behavior. · `vllm_omni/platforms/cuda/platform.py`
- [NPU path](https://github.com/ixi-enki/vllm-omni/blob/main/vllm_omni/platforms/npu/platform.py): platform backend · NPU-specific workers, quantization hooks, and connector adaptations. · `vllm_omni/platforms/npu/platform.py`
- [XPU path](https://github.com/ixi-enki/vllm-omni/blob/main/vllm_omni/platforms/xpu/platform.py): platform backend · XPU-specific workers and profiler hooks. · `vllm_omni/platforms/xpu/platform.py`

### Extensions and ops

Deployment, configuration, docs, examples, and validation assets.

- [Deploy configs](https://github.com/ixi-enki/vllm-omni/tree/main/vllm_omni/deploy): manifests · Deployment YAMLs and stage topology presets for supported model families. · `vllm_omni/deploy`
- [Docs](https://github.com/ixi-enki/vllm-omni/tree/main/docs): documentation · Architecture, API, configuration, and model onboarding documentation. · `docs`
- [Examples](https://github.com/ixi-enki/vllm-omni/tree/main/examples): samples · Offline and online example clients, workflows, and integration demos. · `examples`

## Connections

- OpenAI API → Engine core: submits requests · HTTP/WebSocket requests are normalized into internal execution requests.
- CLI serve → Engine core: starts serve · CLI commands bootstrap the serving engine and benchmark flows.
- Async Omni → Engine core: dispatches · Async entrypoint hands control to the orchestration layer.
- Engine core → Stage pool: spawns stages · Engine manages stage process lifecycle and startup.
- Engine core → Output proc: formats outputs · Engine delegates response shaping and streaming assembly.
- Engine core → AR scheduler: AR scheduling · Autoregressive requests are scheduled through the token scheduler.
- Engine core → Diffusion engine: diffusion route · Diffusion requests follow the dedicated diffusion runtime.
- AR scheduler → Stage inputs: prepares stages · Scheduler cooperates with stage input processors for execution-ready inputs.
- Stage inputs → AR pipelines: feeds pipelines · Prepared inputs enter model-specific AR pipelines.
- AR pipelines → AR worker: executes on · AR model pipelines run inside worker/model-runner backends.
- Diffusion engine → Diffusion request: normalizes · Diffusion runtime uses diffusion-native request structures.
- Diffusion engine → Diffusion scheduler: schedules steps · Step scheduler coordinates batching and generation steps.
- Diffusion scheduler → Diffusion worker: drives workers · Scheduled steps are executed by diffusion workers.
- Diffusion worker → Diffusion models: runs pipelines · Workers invoke model-specific diffusion pipelines and loaders.
- Omni connectors → Coordinator: reports state · Connectors and transfer adapters are coordinated via the disaggregation control plane.
- Coordinator → Engine core: placement control · Coordinator influences stage placement and cross-stage execution.
- AR worker → CUDA path: GPU backend · Default GPU execution path is provided by CUDA platform support.
- AR worker → NPU path: NPU backend · NPU-specific worker implementations and kernels override the generic path.
- AR worker → XPU path: XPU backend · XPU-specific worker implementations and profiling hooks integrate here.
- Diffusion worker → CUDA path: GPU backend · Diffusion execution uses platform backends, commonly CUDA.
- Docs → Deploy configs: documents · Docs describe deployment matrices and stage topology presets.
- Examples → OpenAI API: exercises · Example clients and workflows target the public serving API.
