---
title: SongGeneration-v2-medium
canonical_url: "https://www.modelscope.cn/models/mlx-community/SongGeneration-v2-medium"
md_url: "https://www.modelscope.cn/models/mlx-community/SongGeneration-v2-medium.md"
repository: mlx-community/SongGeneration-v2-medium
last_updated: 2026-06-02
license: other
base_model:
  - tencent/SongGeneration
base_model_relation: finetune
parameters: 2.8B
tensor_type:
  - BF16
library_name:
  - mlx
  - safetensors
  - pytorch
frameworks:
  - pytorch
downloads: 65
stars: 0
tags:
  - mlx
  - apple-silicon
  - music-generation
  - song-generation
  - audiolm
---

# SongGeneration-v2-medium

> SongGeneration-v2-medium - mlx-community 在 ModelScope 开源的模型。Part of the SongGeneration MLX conversion set. Collection: https://huggingface.co/collections/mlx-community/songgeneration-v2-mlx-6a1bf9342dd0806419737229

mlx-community/SongGeneration-v2-medium 是 ModelScope 魔搭社区上的 2.8B 参数机器学习模型，采用 other 许可，基于 tencent/SongGeneration 构建。

- **Repository**: mlx-community/SongGeneration-v2-medium
- **License**: other
- **Parameters**: 2.8B
- **Base model**: tencent/SongGeneration
- **Tags**: mlx, apple-silicon, music-generation, song-generation, audiolm
- **Downloads**: 65
- **Stars**: 0
- **Last updated**: 2026-06-02

Source: https://www.modelscope.cn/models/mlx-community/SongGeneration-v2-medium

---

Part of the SongGeneration MLX conversion set. Collection: https://huggingface.co/collections/mlx-community/songgeneration-v2-mlx-6a1bf9342dd0806419737229

# SongGeneration-v2-medium

Apple MLX weights for the autoregressive `audiolm` token generator from Tencent SongGeneration v2-medium.

This default repository is the bf16 variant and is equivalent to [`mlx-community/SongGeneration-v2-medium-bf16`](https://huggingface.co/mlx-community/SongGeneration-v2-medium-bf16). Use this repo when you want the recommended default checkpoint.

This is not a full-stack pure MLX audio pipeline yet: token generation runs with MLX, while FLAC decoding currently uses the official PyTorch Flow1dVAE / separate-tokenizer bridge in [`ailuntx/SongGeneration-MLX`](https://github.com/ailuntx/SongGeneration-MLX).

## TL;DR

| | |
|---|---|
| **Variant** | `v2-medium` |
| **Precision** | `bf16` (`bfloat16`) |
| **Converted component** | SongGeneration `audiolm` token generator |
| **Runtime** | [`ailuntx/SongGeneration-MLX`](https://github.com/ailuntx/SongGeneration-MLX) |
| **Official model** | [`tencent/SongGeneration`](https://huggingface.co/tencent/SongGeneration) |
| **Official code** | [`tencent-ailab/songgeneration`](https://github.com/tencent-ailab/songgeneration) |

## Quick Start

```bash
git clone https://github.com/ailuntx/SongGeneration-MLX.git
cd SongGeneration-MLX
python -m venv .venv
.venv/bin/pip install -e .
.venv/bin/pip install -U huggingface_hub hf_transfer

HF_HUB_ENABLE_HF_TRANSFER=1 .venv/bin/hf download mlx-community/SongGeneration-v2-medium --local-dir ./models/SongGeneration-v2-medium

.venv/bin/python -m songgeneration_mlx.cli \
  --model ./models/SongGeneration-v2-medium \
  --lyrics '[verse] hello from mlx [chorus] sing it again' \
  --description 'Pop, female vocal, bright production, [Musicality-medium].' \
  --duration 2 \
  --top-k 50 \
  --temperature 0.9 \
  --output tokens_2s.npz
```

## Decode Tokens

The MLX runtime writes discrete song tokens. To create FLAC audio, use the official decoder bridge in [`ailuntx/SongGeneration-MLX`](https://github.com/ailuntx/SongGeneration-MLX). The bridge needs the official SongGeneration `runtime/` assets, but it does not need the original SongGeneration LM `model.pt` when `--mlx-model` is used.

```bash
python -m venv .venv-decoder
.venv-decoder/bin/pip install -U pip
.venv-decoder/bin/pip install \
  -r third_party/SongGeneration/requirements.txt \
  -r third_party/SongGeneration/requirements_nodeps.txt \
  soundfile

HF_HUB_ENABLE_HF_TRANSFER=1 .venv/bin/hf download tencent/SongGeneration \
  --include "runtime/*" \
  --local-dir ./third_party/SongGeneration

PYTORCH_ENABLE_MPS_FALLBACK=1 SONGGEN_DEVICE=mps \
.venv-decoder/bin/python scripts/decode_tokens_official.py \
  --mlx-model ./models/SongGeneration-v2-medium \
  --tokens ./tokens_2s.npz \
  --output ./output_2s.flac \
  --device mps
```

## Variants

| Variant | Disk | Notes |
|---|---:|---|
| `SongGeneration-v2-medium-fp32` | 10G | high-precision medium baseline |
| `SongGeneration-v2-medium` | 5.2G | default medium checkpoint, same weights as bf16 |
| `SongGeneration-v2-medium-bf16` | 5.2G | explicit medium bf16 quality baseline |
| `SongGeneration-v2-medium-8bit` | 2.8G | smaller medium checkpoint |
| `SongGeneration-v2-medium-4bit` | 1.5G | smallest medium checkpoint |
| `SongGeneration-v2-large-fp32` | 19G | high-precision large baseline |
| `SongGeneration-v2-large-bf16` | 9.5G | large bf16 quality baseline |
| `SongGeneration-v2-large-8bit` | 5.0G | smaller large checkpoint |
| `SongGeneration-v2-large-4bit` | 2.7G | smallest large checkpoint |
| `SongGeneration-v2-fast-*` | pending | upstream fast weights were not publicly available when checked on 2026-05-31 |

## Layout

```text
SongGeneration-v2-medium/
|-- model-00001-of-000xx.safetensors
|-- model.safetensors.index.json
|-- config.json
|-- mlx_manifest.json
|-- config.official.yaml
|-- vocab.yaml
`-- qwen2_tokenizer/
```

## Validation

Local Apple Silicon validation was run on the medium bf16 path:

| Test | Result |
|---|---|
| 12s MLX token generation | 550 pattern steps, about 1 minute wall time |
| 12s official decoder bridge | 73.27s wall time |
| 12s FLAC | 48kHz stereo, 12.000s, RMS about `0.163` |

The official recent-token repetition penalty is implemented in the MLX runtime. Without it, 12s generations collapse into repeated tokens and decode close to silence.

## License

License follows the upstream SongGeneration release. Check the official model card and repository for the authoritative model license.

## Citation

```bibtex
@misc{songgeneration-mlx,
  title  = {SongGeneration-MLX: Apple MLX port of SongGeneration},
  author = {ailuntx},
  year   = {2026},
  url    = {https://github.com/ailuntx/SongGeneration-MLX},
}

@article{lei2025levo,
  title   = {LeVo: High-Quality Song Generation with Multi-Preference Alignment},
  author  = {Lei, Shun and Xu, Yaoxun and Lin, Zhiwei and Zhang, Huaicheng and Tan, Wei and Chen, Hangting and Yu, Jianwei and Zhang, Yixuan and Yang, Chenyu and Zhu, Haina and Wang, Shuai and Wu, Zhiyong and Yu, Dong},
  journal = {arXiv preprint arXiv:2506.07520},
  year    = {2025},
}
```
