NeuCodec Decoder (safetensors weights)
These are the NeuCodec decoder weights, extracted to safetensors for use with a pure-Rust CPU decoder (ndarray + rustfft) โ no native ONNX runtime, no PyTorch at inference.
The decoder converts the discrete speech codes produced by the NeuTTS backbone back into a 24 kHz audio waveform, completing the zero-shot voice cloning pipeline.
This artifact exists to enable voice cloning in Ragtag, a local-first desktop AI application, under strict architectural constraints: no native ONNX runtime (no onnxruntime / ort), no GPL dependencies. The companion encoder is ragtag-ai/neucodec-encoder-rten.
Model details
- Source model: neuphonic/neucodec (decoder portion only)
- Format:
safetensors(extracted from the originalpytorch_model.bin) - Runtime: a pure-Rust CPU decoder (ndarray + rustfft) โ the implementation in neutts-rs, vendored into Ragtag
- Precision: fp32
- File size: approximately 880 MB
- Input: NeuCodec speech codes (50 per second of audio)
- Output: 24 kHz mono audio waveform
Provenance and extraction process
Upstream distributes the decoder only as ONNX (neuphonic/neucodec-onnx-decoder); the pure-Rust decoder loads safetensors. These weights were extracted from the original PyTorch model:
- PyTorch source:
pytorch_model.binfrom neuphonic/neucodec - Extraction: the decoder sub-graph (VocosBackbone: FSQ projection, conv embed, ResNet + RoPE transformer blocks, ISTFT head) is filtered out and written to
safetensors(script:convert_weights.py, or the dependency-freeconvert_weights_nopytorch.py, in the Ragtag repo).
No weights are modified โ this is a format conversion only.
Quality verification
The pure-Rust decoder was verified against the reference implementations:
- Decoder parity: 0.99 correlation with the upstream Rust decoder on identical codes
- End-to-end: codes encoded from real audio, decoded through this path, produce an intelligible reconstruction of the speaker (ASR-confirmed)
NeuCodec is a generative (vocoder) decoder, so two valid implementations produce intelligible but not phase-identical waveforms; intelligibility, not waveform correlation, is the meaningful check.
Usage
This is not a standalone TTS system. It is the decoder stage of Ragtag's clone pipeline, used together with:
- The encoder ragtag-ai/neucodec-encoder-rten
- A NeuTTS backbone (e.g. neuphonic/neutts-nano-q4-gguf)
- A G2P frontend producing IPA phonemes (Ragtag uses piper-plus-g2p)
The decoder runs on CPU.
Licence and attribution
Licensed under Apache License 2.0, derived from the original NeuCodec which is also Apache 2.0 licensed. Please retain attribution to the original authors:
NeuCodec by Neuphonic
https://huggingface.co/neuphonic/neucodec
Licensed under Apache 2.0
The safetensors extraction is contributed by Ragtag / Captivated Ltd, also under Apache 2.0.
Related resources
- Original NeuCodec: neuphonic/neucodec
- Companion encoder: ragtag-ai/neucodec-encoder-rten
- NeuTTS backbone: neuphonic/neutts-air
- neutts-rs (Rust port reference): github.com/eugenehp/neutts-rs
- Ragtag: ragtag-ai.app
Citation
@misc{neucodec2024,
author = {Neuphonic},
title = {NeuCodec},
year = {2024},
publisher = {Hugging Face},
url = {https://huggingface.co/neuphonic/neucodec}
}
@misc{neucodec-decoder-safetensors,
author = {Mallett, Leon},
title = {NeuCodec Decoder (safetensors weights)},
year = {2026},
publisher = {Hugging Face},
url = {https://huggingface.co/ragtag-ai/neucodec-decoder}
}
Model tree for ragtag-ai/neucodec-decoder
Base model
neuphonic/neucodec