---
title: LFM3-Audio-2B-ONNX
canonical_url: "https://www.modelscope.cn/models/LiquidAI/LFM3-Audio-2B-ONNX"
md_url: "https://www.modelscope.cn/models/LiquidAI/LFM3-Audio-2B-ONNX.md"
repository: LiquidAI/LFM3-Audio-2B-ONNX
last_updated: 2026-10-28
license: other
pipeline_tag: any-to-any
tasks:
  - any-to-any
model_type:
  - lfm3_audio
architectures:
  - Lfm3AudioForConditionalGeneration
base_model:
  - LiquidAI/LFM3-Audio-2B
base_model_relation: quantized
library_name:
  - onnx
  - pytorch
frameworks:
  - pytorch
language:
  - en
  - ar
  - da
  - de
  - el
  - fi
  - fr
  - he
  - it
  - ja
  - ko
  - nl
  - pl
  - pt
  - es
  - sv
  - tr
  - zh
downloads: 0
stars: 0
tags:
  - liquid
  - lfm3
  - onnx
---

# LFM3-Audio-2B-ONNX

> LFM3-Audio-2B-ONNX - LiquidAI 在 ModelScope 开源的模型。ONNX version of LFM3-Audio-2B for cross-platform inference with ONNX Runtime.

LiquidAI/LFM3-Audio-2B-ONNX 是 ModelScope 魔搭社区上的any-to-any模型，采用 other 许可，基于 LiquidAI/LFM3-Audio-2B 构建。

- **Repository**: LiquidAI/LFM3-Audio-2B-ONNX
- **License**: other
- **Tasks**: any-to-any
- **Base model**: LiquidAI/LFM3-Audio-2B
- **Tags**: liquid, lfm3, onnx
- **Downloads**: 0
- **Stars**: 0
- **Last updated**: 2026-10-28

Source: https://www.modelscope.cn/models/LiquidAI/LFM3-Audio-2B-ONNX

---

<div align="center">
  <img
    src="https://huggingface.co/LiquidAI/LFM3-1.7B/resolve/main/assets/liquid-ai-banner.webp"
    alt="Liquid AI"
    style="width: 100%; max-width: 100%; height: auto; display: block; margin: 0;"
  />
  <div align="center" style="display: flex; justify-content: center; align-items: center; gap: 1.25em; margin: 8px 0 1.7rem; padding: 0; line-height: 1.3;">
    <a href="https://console.liquid.ai/dashboard" style="display: inline-flex; align-items: center; gap: 6px;"><img src="https://huggingface.co/LiquidAI/LFM3-1.7B/resolve/main/assets/icons/api.svg" width="16" height="16" alt="" aria-hidden="true" style="display: block; flex: 0 0 16px; width: 16px; height: 16px; margin: 0;" /><strong>API</strong></a>
    <a href="https://playground.liquid.ai/talk" style="display: inline-flex; align-items: center; gap: 6px;"><img src="https://huggingface.co/LiquidAI/LFM3-1.7B/resolve/main/assets/icons/try.svg" width="16" height="16" alt="" aria-hidden="true" style="display: block; flex: 0 0 16px; width: 16px; height: 16px; margin: 0;" /><strong>Try</strong></a>
    <a href="https://docs.liquid.ai/lfm/getting-started/welcome" style="display: inline-flex; align-items: center; gap: 6px;"><img src="https://huggingface.co/LiquidAI/LFM3-1.7B/resolve/main/assets/icons/docs.svg" width="16" height="16" alt="" aria-hidden="true" style="display: block; flex: 0 0 16px; width: 16px; height: 16px; margin: 0;" /><strong>Docs</strong></a>
    <a href="https://www.liquid.ai/blog/lfm3" style="display: inline-flex; align-items: center; gap: 6px;"><img src="https://huggingface.co/LiquidAI/LFM3-1.7B/resolve/main/assets/icons/blog.svg" width="16" height="16" alt="" aria-hidden="true" style="display: block; flex: 0 0 16px; width: 16px; height: 16px; margin: 0;" /><strong>Blog</strong></a>
  </div>
</div>

# LFM3-Audio-2B-ONNX

ONNX version of [LFM3-Audio-2B](https://huggingface.co/LiquidAI/LFM3-Audio-2B) for cross-platform inference with ONNX Runtime.

Find architecture and usage details in the [original model card](https://huggingface.co/LiquidAI/LFM3-Audio-2B).

## Files
<hr style="margin: -0.7em 0 1.2em 0; border: 0; border-top: 1px solid rgba(127, 127, 127, 0.3);" />

Each precision pairs a decoder with an audio encoder and a codec decoder. Every precision also runs the float32 [`depth_decoder`](https://huggingface.co/LiquidAI/LFM3-Audio-2B-ONNX/blob/main/onnx/depth_decoder.onnx), which the sizes include.

<table style="width: 100%; display: table; border: 0; border-radius: 0; border-collapse: collapse;">
<thead style="border: 0;">
<tr style="border: 0;">
<th scope="col" style="text-align: left; padding: 0.55em 0.75em; border: 0; border-bottom: 1px solid rgba(127, 127, 127, 0.55);">Precision</th>
<th scope="col" style="text-align: left; padding: 0.55em 0.75em; border: 0; border-bottom: 1px solid rgba(127, 127, 127, 0.55);">Decoder</th>
<th scope="col" style="text-align: left; padding: 0.55em 0.75em; border: 0; border-bottom: 1px solid rgba(127, 127, 127, 0.55);">Audio encoder</th>
<th scope="col" style="text-align: left; padding: 0.55em 0.75em; border: 0; border-bottom: 1px solid rgba(127, 127, 127, 0.55);">Codec decoder</th>
<th scope="col" style="text-align: left; padding: 0.55em 0.75em; border: 0; border-bottom: 1px solid rgba(127, 127, 127, 0.55);">Size</th>
<th scope="col" style="text-align: left; padding: 0.55em 0.75em; border: 0; border-bottom: 1px solid rgba(127, 127, 127, 0.55);">Device</th>
</tr>
</thead>
<tbody style="border: 0;">
<tr style="border: 0;">
<td style="border: 0; padding: 0.55em 0.75em;"><code>q4</code></td>
<td style="border: 0; padding: 0.55em 0.75em;"><a href="https://huggingface.co/LiquidAI/LFM3-Audio-2B-ONNX/blob/main/onnx/decoder_q4.onnx"><code>decoder_q4</code></a></td>
<td style="border: 0; padding: 0.55em 0.75em;"><a href="https://huggingface.co/LiquidAI/LFM3-Audio-2B-ONNX/blob/main/onnx/audio_encoder.onnx"><code>audio_encoder</code></a></td>
<td style="border: 0; padding: 0.55em 0.75em;"><a href="https://huggingface.co/LiquidAI/LFM3-Audio-2B-ONNX/blob/main/onnx/codec_decoder.onnx"><code>codec_decoder</code></a></td>
<td style="border: 0; padding: 0.55em 0.75em;">2.71 GB</td>
<td style="border: 0; padding: 0.55em 0.75em;">CPU</td>
</tr>
<tr style="border: 0;">
<td style="border: 0; padding: 0.55em 0.75em;"><code>q8</code></td>
<td style="border: 0; padding: 0.55em 0.75em;"><a href="https://huggingface.co/LiquidAI/LFM3-Audio-2B-ONNX/blob/main/onnx/decoder_q8.onnx"><code>decoder_q8</code></a></td>
<td style="border: 0; padding: 0.55em 0.75em;"><a href="https://huggingface.co/LiquidAI/LFM3-Audio-2B-ONNX/blob/main/onnx/audio_encoder.onnx"><code>audio_encoder</code></a></td>
<td style="border: 0; padding: 0.55em 0.75em;"><a href="https://huggingface.co/LiquidAI/LFM3-Audio-2B-ONNX/blob/main/onnx/codec_decoder.onnx"><code>codec_decoder</code></a></td>
<td style="border: 0; padding: 0.55em 0.75em;">3.36 GB</td>
<td style="border: 0; padding: 0.55em 0.75em;">CPU</td>
</tr>
<tr style="border: 0;">
<td style="border: 0; padding: 0.55em 0.75em;"><code>q4f16</code></td>
<td style="border: 0; padding: 0.55em 0.75em;"><a href="https://huggingface.co/LiquidAI/LFM3-Audio-2B-ONNX/blob/main/onnx/decoder_q4f16.onnx"><code>decoder_q4f16</code></a></td>
<td style="border: 0; padding: 0.55em 0.75em;"><a href="https://huggingface.co/LiquidAI/LFM3-Audio-2B-ONNX/blob/main/onnx/audio_encoder_fp16.onnx"><code>audio_encoder_fp16</code></a></td>
<td style="border: 0; padding: 0.55em 0.75em;"><a href="https://huggingface.co/LiquidAI/LFM3-Audio-2B-ONNX/blob/main/onnx/codec_decoder_fp16.onnx"><code>codec_decoder_fp16</code></a></td>
<td style="border: 0; padding: 0.55em 0.75em;">2.09 GB</td>
<td style="border: 0; padding: 0.55em 0.75em;">GPU</td>
</tr>
<tr style="border: 0;">
<td style="border: 0; padding: 0.55em 0.75em;"><code>q8f16</code></td>
<td style="border: 0; padding: 0.55em 0.75em;"><a href="https://huggingface.co/LiquidAI/LFM3-Audio-2B-ONNX/blob/main/onnx/decoder_q8f16.onnx"><code>decoder_q8f16</code></a></td>
<td style="border: 0; padding: 0.55em 0.75em;"><a href="https://huggingface.co/LiquidAI/LFM3-Audio-2B-ONNX/blob/main/onnx/audio_encoder_fp16.onnx"><code>audio_encoder_fp16</code></a></td>
<td style="border: 0; padding: 0.55em 0.75em;"><a href="https://huggingface.co/LiquidAI/LFM3-Audio-2B-ONNX/blob/main/onnx/codec_decoder_fp16.onnx"><code>codec_decoder_fp16</code></a></td>
<td style="border: 0; padding: 0.55em 0.75em;">2.74 GB</td>
<td style="border: 0; padding: 0.55em 0.75em;">GPU</td>
</tr>
<tr style="border: 0;">
<td style="border: 0; padding: 0.55em 0.75em;"><code>fp16</code></td>
<td style="border: 0; padding: 0.55em 0.75em;"><a href="https://huggingface.co/LiquidAI/LFM3-Audio-2B-ONNX/blob/main/onnx/decoder_fp16.onnx"><code>decoder_fp16</code></a></td>
<td style="border: 0; padding: 0.55em 0.75em;"><a href="https://huggingface.co/LiquidAI/LFM3-Audio-2B-ONNX/blob/main/onnx/audio_encoder_fp16.onnx"><code>audio_encoder_fp16</code></a></td>
<td style="border: 0; padding: 0.55em 0.75em;"><a href="https://huggingface.co/LiquidAI/LFM3-Audio-2B-ONNX/blob/main/onnx/codec_decoder_fp16.onnx"><code>codec_decoder_fp16</code></a></td>
<td style="border: 0; padding: 0.55em 0.75em;">4.30 GB</td>
<td style="border: 0; padding: 0.55em 0.75em;">GPU</td>
</tr>
<tr style="border: 0;">
<td style="border: 0; padding: 0.55em 0.75em;"><code>fp32</code></td>
<td style="border: 0; padding: 0.55em 0.75em;"><a href="https://huggingface.co/LiquidAI/LFM3-Audio-2B-ONNX/blob/main/onnx/decoder.onnx"><code>decoder</code></a></td>
<td style="border: 0; padding: 0.55em 0.75em;"><a href="https://huggingface.co/LiquidAI/LFM3-Audio-2B-ONNX/blob/main/onnx/audio_encoder.onnx"><code>audio_encoder</code></a></td>
<td style="border: 0; padding: 0.55em 0.75em;"><a href="https://huggingface.co/LiquidAI/LFM3-Audio-2B-ONNX/blob/main/onnx/codec_decoder.onnx"><code>codec_decoder</code></a></td>
<td style="border: 0; padding: 0.55em 0.75em;">8.27 GB</td>
<td style="border: 0; padding: 0.55em 0.75em;">Reference</td>
</tr>
</tbody>
</table>

The fp16, q4f16 and q8f16 decoders run with fp16 activations, the others with fp32. q4 and q4f16 keep the embedding, the LM head and 27 of the 153 layer projections in int8 and the rest in int4. Every decoder keeps the speech-frame codebook table in float.

## Use with ONNX Runtime
<hr style="margin: -0.7em 0 1.2em 0; border: 0; border-top: 1px solid rgba(127, 127, 127, 0.3);" />

The audio encoder maps the log-mel features of 16 kHz audio (`input_features`) to `audio_features`, which the decoder takes at the `<|audio|>` placeholders of `input_ids`. Each decoder step also takes `attention_mask`, `position_ids`, `logits_to_keep`, the codes of generated speech frames at the `<|audio_out|>` placeholders (`audio_out_codes`) and the convolution and attention caches (`past_conv.N`, `past_key_values.N.key` and `.value`). It returns `logits`, the final-norm `hidden_states` and the updated caches (`present_conv.N`, `present.N.key` and `.value`). The fp16, q4f16 and q8f16 decoders keep their caches in fp16.

For speech, the depth decoder predicts the 12 codes of each speech frame from the decoder's hidden state in 3 MaskGIT passes, and the codec decoder maps the codes to STFT features that an inverse STFT turns into 24 kHz audio. For the log-mel features and the inverse STFT, use the values in `processor_config.json` and `audio_tokenizer/config.json`.

On GPU, use fp16, q4f16 or q8f16. The CUDA execution provider has no fp32 GroupQueryAttention kernel, so the other graphs run attention on the CPU.

In the browser, use `import * as ort from 'onnxruntime-web/webgpu'`: the default `onnxruntime-web` import cannot run these graphs. On WebGPU, pair `decoder_q4f16` with the float32 side graphs of the q4 bundle (`audio_encoder`, `codec_decoder`), and prefill in chunks of at most 1,024 tokens.

Recommended sampling: greedy decoding for text, and `audio_temperature=1.0, audio_top_k=128, audio_repetition_penalty=1.1, audio_repetition_window=4096` for speech synthesis and interleaved text and speech. More options in the [ONNX guide](https://docs.liquid.ai/deployment/on-device/onnx).
