### Shao: High-Fidelity Music Generation With a Unified Acoustic-Token Pipeline
English | [中文](/Shao/README_zh.html)
Rename Notice
This project was formerly known as Khala and has been officially renamed to Shao. The model, codebase, and research direction remain unchanged; the rename is intended to unify the project’s long-term identity across papers, GitHub, demos, and future releases.
Shao is the English name of 韶元. “韶” is associated with beautiful music and also evokes classical court music and cultural continuity, while “元” refers to origin, foundation, and first principle.
Shao is an open-source system for high-fidelity music generation, capable of generating complete musical works from text descriptions and lyric conditions. Unlike approaches built around semantic tokens, diffusion models, or multi-stage audio generation stacks, Shao follows a unified acoustic-token route and generates both coarse musical structure and fine acoustic detail within the same discrete audio representation space.
The core characteristics of Shao include:
⚠️ [2026-06-16] Inference quality is highly sensitive to the GPU architecture, CUDA stack, container image, and Megatron/TransformerEngine versions. After repeated testing, we found that bit-identical generation across different GPU types is not guaranteed, even with the same prompt and similar CUDA/container settings. The best and most reproducible results are obtained by strictly following the provided NGC-based environment and setup instructions. In particular, the released pipeline has been verified to produce normal results on H800 with the reference image, and can also work on RTX 4090 when the provided environment is followed. Using other containers, CUDA/PyTorch/TransformerEngine combinations, or Megatron versions may lead to severely degraded output, including noise-like audio. We are keeping this notice here to be transparent about the current limitation, and we welcome help from experienced users who are willing to investigate the underlying numerical/runtime differences with us.[2026-05-16] The online audio demo page is now available: Shao Demo[2026-05-11] Backend inference launch now supports single-GPU safe startup by default, plus multi-GPU and runtime-mode overrides for deployment compatibility.[2026-05-05] The arXiv paper is now available: Shao: Scaling Acoustic Token Language Models Toward High-Fidelity Music Generation[2026-05-01] The codebase, environment documentation, and Dockerfile have been cleaned up for release.[Coming Soon] A full deployment guide for musicians and beginner users.[Coming Soon] Discord community server.

Listen to generated samples on the online demo page: Shao Demo
The current release is mainly intended for researchers and developers who are already familiar with GPU servers.
checkpoints/ directory at the repository root.This section is intended for researchers and developers who are already comfortable with basic Docker and CUDA workflows, and provides the shortest path to running the system.
If you want to configure the environment step by step from a clean NGC container, please read:
If you want to understand the backend structure and runtime logic, please read:
The currently available prebuilt image is:
docker pull ghcr.io/davidliujiafeng/khala-env:ngc25.02-node24
docker run --gpus all -it --rm \
--name shao \
-p 30869:30869 \
-p 8889:8889 \
ghcr.io/davidliujiafeng/khala-env:ngc25.02-node24
Note: the command above uses
--rm, so files created inside the container will be removed after the container exits. If you want a long-lived development container or want to keep downloaded model weights, use a mounted directory or remove--rm.
After entering the container, run:
cd /workspace
git clone https://github.com/Shao-Music-AI/Shao.git
cd Shao
Model repository:
From the repository root, run:
mkdir -p checkpoints
hf download liujiafeng/Shao-MusicGeneration-v1.0 --local-dir checkpoints
This command downloads the model repository contents into the local checkpoints/ directory.
cd /workspace/Shao/backend
bash run_backend.sh
The default launcher now starts in a single-GPU safe mode. Advanced users can also select specific GPU ids and switch between one_shot and keep_loaded runtime modes from the same script; see backend/README_backend.md for details.
In another terminal, run:
cd /workspace/Shao/frontend
npm install
npm run dev
Default URL:
The current system has three layers:
The request path is:
flowchart LR
A["Frontend UI"] --> B["backend_api.py"]
B --> C["backend_worker.py"]
C --> D["Backbone"]
D --> E["Super-resolution"]
E --> F["Decoder"]
F --> G["Generated Audio"]
G --> B
B --> A
Shao/
├── backend/
├── frontend/
├── core/
├── models/
├── checkpoints/
├── assets/
├── Dockerfile
├── requirements.txt
├── ENVIRONMENT_SETUP.md
└── ENVIRONMENT_SETUP_zh.md
Main directories:
frontend/: frontend pages and the Vite project.backend/: backend API, worker, and launcher scripts.core/: project-specific core modules.models/: Megatron, decoder, and tokenizer related code.checkpoints/: model checkpoint directory.assets/: images used by the README and demo materials.If this project is helpful to your research or development work, you are welcome to cite our paper:
The final BibTeX information will be added later to both the paper page and the repository documentation.
The current implementation builds on a number of excellent open-source projects and tools, including but not limited to:
The model weights are currently intended to be released under CC BY-NC 4.0 (Creative Commons Attribution-NonCommercial 4.0 International).
Feel free to join the WeChat group for discussion, usage questions, and future updates: