Standalone GPT-SoVITS backend for Neiroha. This repository owns its own Pixi environment, FastAPI server, Gradio Admin, launcher scripts, and configuration semantics. It does not share a Python environment with other TTS engines.
Chinese documentation: README_zh.md
The current shape is intentionally small:
- OpenAI-style TTS API:
/v1/models,/v1/audio/voices,/v1/audio/speech modelmeans a voice set, not a low-level weight modelvoicemeans a concrete voice profile inside the selected voice set- low-level GPT-SoVITS runtime weights live in model presets
- only one default voice is exposed:
genshin-keqing - multi-role packs and shared community weights are not bundled as bulk download actions; download them yourself and register the weights in Admin
configs/
server.toml
model-presets/
default.toml
voice-sets/
default.toml
runtime/
voices/
genshin-keqing/
voice.toml
reference.wav
logs/
outputs/
models/
pretrained/
Neiroha-owned configuration is TOML. The only YAML file is the generated
GPT-SoVITS runtime cache at runtime/cache/tts_infer.yaml, because upstream
GPT-SoVITS expects that shape.
configs/voice-sets/default.toml maps to model=default in the Neiroha /
OpenAI-compatible API. runtime/voices/genshin-keqing/voice.toml maps to
voice=genshin-keqing. configs/model-presets/default.toml is the low-level
GPT-SoVITS runtime preset.
pixi install
pixi run install
pixi run install-sample-voiceinstall initializes the submodule, installs upstream GPT-SoVITS Python
dependencies, and downloads the official pretrained assets. install-sample-voice
downloads only one default sample reference voice; it does not download trained
multi-character packs.
start_portable.bat serveOr use Pixi tasks:
pixi run serve
pixi run api
pixi run admin
pixi run test
pixi run smokeDefault ports come from configs/server.toml:
FastAPI http://127.0.0.1:9880
Admin http://127.0.0.1:7860
serve reads configs/server.toml and uses [startup].surface plus
[startup].preload_model. Pixi tasks no longer hard-code host, port, surface
combinations, or preload policy. If a configured port is busy or Windows refuses
the bind, the launcher picks an available random port and prints the actual
FastAPI and Gradio Admin URLs in the terminal and runtime/logs/backend.log.
admin starts only the Gradio Admin and connects to an existing FastAPI server.
Set [startup].surface = "both" and run pixi run serve to start FastAPI and
Gradio Admin together. Gradio is not mounted into FastAPI.
Gradio does not automatically translate custom labels, but this Admin supports Chinese and English labels at launch time. Set:
# configs/server.toml
[ui]
default_language = "en" # zh | enOr set an environment variable:
$env:NEIROHA_GPT_SOVITS_UI_LANG="en"Then restart Admin.
The Admin Logs tab shows runtime/logs/backend.log, newest entries first, with
automatic refresh. Each top-level launcher start rotates the previous file to
runtime/logs/backend.previous.log and starts a fresh backend.log, so normal
use does not accumulate one endless log file. Download tasks still write fresh
per-run files:
runtime/logs/admin-download.out.log
runtime/logs/admin-download.err.log
List voice sets:
curl.exe http://127.0.0.1:9880/v1/modelsList voices:
curl.exe http://127.0.0.1:9880/v1/audio/voicesSynthesize speech:
curl.exe http://127.0.0.1:9880/v1/audio/speech `
-H "Content-Type: application/json" `
-d '{ "model":"default", "voice":"genshin-keqing", "input":"Hello, this is a voice cloning test.", "response_format":"wav" }' `
--output speech.wavResponses include X-Neiroha-Output-Path, X-Neiroha-Audio-Seconds,
X-Neiroha-Elapsed-Seconds, and X-Neiroha-RTF headers.
Use the Admin Voice Config tab to upload reference audio, enter the matching prompt text, set a voice id/name, and save it.
By default the new voice uses the selected model preset. For community-trained
GPT-SoVITS v2Pro/v2ProPlus weights, either add a reusable preset in the
Model Presets tab, or expand the per-voice override section and fill the .ckpt
and .pth paths directly.
Manual voice profile path:
runtime/voices/my_voice/voice.toml
Then add my_voice to:
configs/voice-sets/default.toml
Example:
schema_version = 1
id = "my_voice"
name = "My Voice"
mode = "prompt_clone"
model_preset = "v2proplus-clone"
reference_audio = "runtime/voices/my_voice/reference.wav"
prompt_audio = ""
prompt_text = "Transcript matching the reference audio."
text_lang = "zh"
prompt_lang = "zh"
instruction = ""
speed = 1.0
gpt_weights_path = "models/voices/my-trained/GPT_xxx.ckpt"
sovits_weights_path = "models/voices/my-trained/SV_xxx.pth"
[engine_options]gpt_weights_path and sovits_weights_path are optional per-voice overrides.
If omitted, the voice uses the weights from model_preset.