Skip to main content
Use ONNX for cross-platform deployment, edge devices, and browser-based inference with WebGPU and Transformers.js.
ONNX (Open Neural Network Exchange) is a portable format that enables LFM inference across diverse hardware and runtimes. ONNX models run on CPUs, GPUs, NPUs, and in browsers via WebGPU—making them ideal for edge deployment and web applications.

LiquidONNX

LiquidONNX is the official tool for exporting LFM models to ONNX and running inference.

Installation

Supported Models

Export

Inference

For complete documentation and advanced options, see the LiquidONNX GitHub repository.

Pre-exported Models

Many LFM models are available as pre-exported ONNX packages from LiquidAI and the onnx-community. Check the Model Library for a complete list of available formats.

Quantization Options

Each ONNX export includes multiple precision levels. Q4 is recommended for most deployments and supports WebGPU, CPU, and GPU. FP16 offers higher quality and works on WebGPU and GPU. Q8 provides a quality/size balance but is server-only (CPU/GPU). FP32 is the full precision baseline.

Hugging Face Spaces

These are fully deployed examples of WebGPU and ONNX inference with LFM models.

LFM2 WebGPU Chat

Run LFM2 text models directly in your browser with WebGPU acceleration.

LFM2.5 Audio

Speech-to-text and text-to-speech with LFM2.5 Audio in the browser.

LFM2.5 Vision

Vision-language inference with LFM2.5-VL in the browser.

WebGPU Inference

ONNX models run in browsers via Transformers.js with WebGPU acceleration. This enables fully client-side inference without server infrastructure.

Setup

  1. Install Transformers.js:
  1. Enable WebGPU in your browser:
    • Chrome/Edge: Navigate to chrome://flags/#enable-unsafe-webgpu, enable, and restart
    • Verify: Check chrome://gpu for WebGPU status

Usage

WebGPU supports Q4 and FP16 precision. Q8 quantization is not available in browser environments.

Python Inference

Install with pip: