# rvc-project/retrieval-based-voice-conversion architecture

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

- Interactive diagram: https://gitdiagram.com/rvc-project/retrieval-based-voice-conversion
- Repository: https://github.com/rvc-project/retrieval-based-voice-conversion

## Overview

RVC is a VITS-based voice-conversion framework exposed as a Python library, CLI, and HTTP API. The principal workflow accepts audio and a voice model, extracts content and pitch features, performs indexed voice conversion, and returns or saves converted audio. Separate product branches support model training and checkpoint handling, vocal separation (UVR5), and ONNX export/inference. The excerpts directly show CLI/API calls into the VC facade and conversion internals; wiring in unsampled modules is represented only where their roles are clear from the documented entry points and paths.

Main entry points: [`rvc/modules/vc/pipeline.py`](https://github.com/rvc-project/retrieval-based-voice-conversion/blob/develop/rvc/modules/vc/pipeline.py) (Conversion pipeline), [`rvc/modules/vc/modules.py`](https://github.com/rvc-project/retrieval-based-voice-conversion/blob/develop/rvc/modules/vc/modules.py) (VC facade), [`rvc/wrapper/cli/handler/train.py`](https://github.com/rvc-project/retrieval-based-voice-conversion/blob/develop/rvc/wrapper/cli/handler/train.py) (Training command), [`rvc/wrapper/cli/handler/infer.py`](https://github.com/rvc-project/retrieval-based-voice-conversion/blob/develop/rvc/wrapper/cli/handler/infer.py) (CLI inference)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interfaces["User interfaces"]
  node_cli_infer["CLI inference<br/>[infer.py]"]
  node_api_infer["API inference<br/>[inference.py]"]
end

subgraph group_conversion["Voice conversion"]
  node_vc_facade["VC facade<br/>[modules.py]"]
  node_vc_pipeline["Conversion pipeline<br/>[pipeline.py]"]
  node_audio_utils["Audio processing<br/>[audio.py]"]
  node_hubert["Content features<br/>[get_hubert.py]"]
  node_pitch["Pitch extraction"]
  node_rmvpe["RMVPE predictor<br/>[rmvpe.py]"]
  node_synthesizer["VITS synthesizer<br/>[models.py]"]
  node_feature_index[("FAISS feature index<br/>[pipeline.py]")]
end

subgraph group_training["Training and models"]
  node_train_cli["Training command<br/>[train.py]"]
  node_train_data["Training data<br/>[data_utils.py]"]
  node_train_losses["Training losses<br/>[losses.py]"]
  node_checkpoint["Checkpoint processing<br/>[process_ckpt.py]"]
end

subgraph group_audio_tools["Audio tools"]
  node_uvr_cli["UVR command<br/>[uvr5.py]"]
  node_uvr_api["UVR endpoint<br/>[uvr.py]"]
  node_uvr_models["Vocal separation"]
  node_onnx_export["ONNX export<br/>[export.py]"]
  node_onnx_infer["ONNX inference<br/>[onnx_inference.py]"]
end

node_cli_user(("CLI user"))
node_api_client(("API client"))
node_library_caller(("Library caller"))
node_converted_audio["Converted audio"]
node_separated_audio["Separated audio"]

node_cli_user -->|"runs inference"| node_cli_infer
node_api_client -->|"posts audio"| node_api_infer
node_library_caller -->|"calls inference"| node_vc_facade
node_cli_infer -->|"calls inference"| node_vc_facade
node_api_infer -->|"calls inference"| node_vc_facade
node_vc_facade -->|"runs conversion"| node_vc_pipeline
node_vc_pipeline -->|"extracts features"| node_hubert
node_vc_pipeline -->|"computes pitch"| node_pitch
node_vc_pipeline -.->|"loads predictor"| node_rmvpe
node_vc_pipeline -->|"reads index"| node_feature_index
node_vc_pipeline -->|"synthesizes audio"| node_synthesizer
node_vc_pipeline -->|"processes audio"| node_audio_utils
node_vc_pipeline -->|"produces audio"| node_converted_audio
node_converted_audio -->|"writes WAV"| node_cli_infer
node_converted_audio -->|"returns audio"| node_api_infer
node_train_cli -->|"loads datasets"| node_train_data
node_train_cli -->|"uses losses"| node_train_losses
node_train_cli -->|"processes checkpoints"| node_checkpoint
node_uvr_cli -->|"runs separation"| node_uvr_models
node_uvr_api -->|"runs separation"| node_uvr_models
node_uvr_models -->|"produces stems"| node_separated_audio
node_onnx_export -->|"exports model"| node_synthesizer
node_onnx_infer -->|"returns audio"| node_converted_audio

click node_cli_infer "https://github.com/rvc-project/retrieval-based-voice-conversion/blob/develop/rvc/wrapper/cli/handler/infer.py"
click node_api_infer "https://github.com/rvc-project/retrieval-based-voice-conversion/blob/develop/rvc/wrapper/api/endpoints/inference.py"
click node_vc_facade "https://github.com/rvc-project/retrieval-based-voice-conversion/blob/develop/rvc/modules/vc/modules.py"
click node_vc_pipeline "https://github.com/rvc-project/retrieval-based-voice-conversion/blob/develop/rvc/modules/vc/pipeline.py"
click node_audio_utils "https://github.com/rvc-project/retrieval-based-voice-conversion/blob/develop/rvc/lib/audio.py"
click node_hubert "https://github.com/rvc-project/retrieval-based-voice-conversion/blob/develop/rvc/lib/jit/get_hubert.py"
click node_pitch "https://github.com/rvc-project/retrieval-based-voice-conversion/tree/develop/rvc/lib/infer_pack/modules/F0Predictor"
click node_rmvpe "https://github.com/rvc-project/retrieval-based-voice-conversion/blob/develop/rvc/lib/rmvpe.py"
click node_synthesizer "https://github.com/rvc-project/retrieval-based-voice-conversion/blob/develop/rvc/lib/infer_pack/models.py"
click node_feature_index "https://github.com/rvc-project/retrieval-based-voice-conversion/blob/develop/rvc/modules/vc/pipeline.py"
click node_train_cli "https://github.com/rvc-project/retrieval-based-voice-conversion/blob/develop/rvc/wrapper/cli/handler/train.py"
click node_train_data "https://github.com/rvc-project/retrieval-based-voice-conversion/blob/develop/rvc/lib/train/data_utils.py"
click node_train_losses "https://github.com/rvc-project/retrieval-based-voice-conversion/blob/develop/rvc/lib/train/losses.py"
click node_checkpoint "https://github.com/rvc-project/retrieval-based-voice-conversion/blob/develop/rvc/lib/train/process_ckpt.py"
click node_uvr_cli "https://github.com/rvc-project/retrieval-based-voice-conversion/blob/develop/rvc/wrapper/cli/handler/uvr5.py"
click node_uvr_api "https://github.com/rvc-project/retrieval-based-voice-conversion/blob/develop/rvc/wrapper/api/endpoints/uvr.py"
click node_uvr_models "https://github.com/rvc-project/retrieval-based-voice-conversion/tree/develop/rvc/modules/uvr5"
click node_onnx_export "https://github.com/rvc-project/retrieval-based-voice-conversion/blob/develop/rvc/modules/onnx/export.py"
click node_onnx_infer "https://github.com/rvc-project/retrieval-based-voice-conversion/blob/develop/rvc/lib/infer_pack/onnx_inference.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_infer,node_api_infer,node_cli_user,node_api_client toneBlue
class node_vc_facade,node_vc_pipeline,node_audio_utils,node_hubert,node_pitch,node_rmvpe,node_synthesizer,node_feature_index toneAmber
class node_train_cli,node_train_data,node_train_losses,node_checkpoint toneMint
class node_uvr_cli,node_uvr_api,node_uvr_models,node_onnx_export,node_onnx_infer toneRose
class node_library_caller,node_converted_audio,node_separated_audio toneIndigo
```

## Components

### User interfaces

- [CLI inference](https://github.com/rvc-project/retrieval-based-voice-conversion/blob/develop/rvc/wrapper/cli/handler/infer.py): `rvc/wrapper/cli/handler/infer.py`
- [API inference](https://github.com/rvc-project/retrieval-based-voice-conversion/blob/develop/rvc/wrapper/api/endpoints/inference.py): `rvc/wrapper/api/endpoints/inference.py`

### Voice conversion

- [VC facade](https://github.com/rvc-project/retrieval-based-voice-conversion/blob/develop/rvc/modules/vc/modules.py): `rvc/modules/vc/modules.py`
- [Conversion pipeline](https://github.com/rvc-project/retrieval-based-voice-conversion/blob/develop/rvc/modules/vc/pipeline.py): `rvc/modules/vc/pipeline.py`
- [Audio processing](https://github.com/rvc-project/retrieval-based-voice-conversion/blob/develop/rvc/lib/audio.py): `rvc/lib/audio.py`
- [Content features](https://github.com/rvc-project/retrieval-based-voice-conversion/blob/develop/rvc/lib/jit/get_hubert.py): `rvc/lib/jit/get_hubert.py`
- [Pitch extraction](https://github.com/rvc-project/retrieval-based-voice-conversion/tree/develop/rvc/lib/infer_pack/modules/F0Predictor): `rvc/lib/infer_pack/modules/F0Predictor`
- [RMVPE predictor](https://github.com/rvc-project/retrieval-based-voice-conversion/blob/develop/rvc/lib/rmvpe.py): `rvc/lib/rmvpe.py`
- [VITS synthesizer](https://github.com/rvc-project/retrieval-based-voice-conversion/blob/develop/rvc/lib/infer_pack/models.py): `rvc/lib/infer_pack/models.py`
- [FAISS feature index](https://github.com/rvc-project/retrieval-based-voice-conversion/blob/develop/rvc/modules/vc/pipeline.py): `rvc/modules/vc/pipeline.py`

### Training and models

- [Training command](https://github.com/rvc-project/retrieval-based-voice-conversion/blob/develop/rvc/wrapper/cli/handler/train.py): `rvc/wrapper/cli/handler/train.py`
- [Training data](https://github.com/rvc-project/retrieval-based-voice-conversion/blob/develop/rvc/lib/train/data_utils.py): `rvc/lib/train/data_utils.py`
- [Training losses](https://github.com/rvc-project/retrieval-based-voice-conversion/blob/develop/rvc/lib/train/losses.py): `rvc/lib/train/losses.py`
- [Checkpoint processing](https://github.com/rvc-project/retrieval-based-voice-conversion/blob/develop/rvc/lib/train/process_ckpt.py): `rvc/lib/train/process_ckpt.py`

### Audio tools

- [UVR command](https://github.com/rvc-project/retrieval-based-voice-conversion/blob/develop/rvc/wrapper/cli/handler/uvr5.py): `rvc/wrapper/cli/handler/uvr5.py`
- [UVR endpoint](https://github.com/rvc-project/retrieval-based-voice-conversion/blob/develop/rvc/wrapper/api/endpoints/uvr.py): `rvc/wrapper/api/endpoints/uvr.py`
- [Vocal separation](https://github.com/rvc-project/retrieval-based-voice-conversion/tree/develop/rvc/modules/uvr5): `rvc/modules/uvr5`
- [ONNX export](https://github.com/rvc-project/retrieval-based-voice-conversion/blob/develop/rvc/modules/onnx/export.py): `rvc/modules/onnx/export.py`
- [ONNX inference](https://github.com/rvc-project/retrieval-based-voice-conversion/blob/develop/rvc/lib/infer_pack/onnx_inference.py): `rvc/lib/infer_pack/onnx_inference.py`

### Other components

- **CLI user**
- **API client**
- **Library caller**
- **Converted audio**
- **Separated audio**

## Connections

- CLI user → CLI inference: runs inference
- API client → API inference: posts audio
- Library caller → VC facade: calls inference
- CLI inference → VC facade: calls inference
- API inference → VC facade: calls inference
- VC facade → Conversion pipeline: runs conversion
- Conversion pipeline → Content features: extracts features
- Conversion pipeline → Pitch extraction: computes pitch
- Conversion pipeline → RMVPE predictor: loads predictor
- Conversion pipeline → FAISS feature index: reads index
- Conversion pipeline → VITS synthesizer: synthesizes audio
- Conversion pipeline → Audio processing: processes audio
- Conversion pipeline → Converted audio: produces audio
- Converted audio → CLI inference: writes WAV
- Converted audio → API inference: returns audio
- Training command → Training data: loads datasets
- Training command → Training losses: uses losses
- Training command → Checkpoint processing: processes checkpoints
- UVR command → Vocal separation: runs separation
- UVR endpoint → Vocal separation: runs separation
- Vocal separation → Separated audio: produces stems
- ONNX export → VITS synthesizer: exports model
- ONNX inference → Converted audio: returns audio
