Instructions to use CharlZKP/LFM3-1.7B-MLC with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLC-LLM
How to use CharlZKP/LFM3-1.7B-MLC with MLC-LLM:
# No code snippets available yet for this library. # To use this model, check the repository files and the library's documentation. # Want to help? PRs adding snippets are welcome at: # https://github.com/huggingface/huggingface.js
- Notebooks
- Google Colab
- Kaggle
LFM3-1.7B-MLC
LiquidAI/LFM3-1.7B converted to MLC format so it runs in the
browser with WebLLM on WebGPU. Weights, model libraries
(.wasm) and the chat/tokenizer config are all in this repo, so WebLLM can load everything
straight from here.
Built with mlc-llm for web-llm 0.2.85 (model library ABI v0_2_84).
Variants
| quantization | folder | model library | needs | download |
|---|---|---|---|---|
q6f16_a |
LFM3-1.7B-q6f16_a-MLC/ |
libs/LFM3-1.7B-q6f16_a_cs1k-webgpu.wasm |
WebGPU shader-f16 |
1458 MB |
q6f16_aβ asym (K-quant-like) int6 everywhere
Use with WebLLM
import * as webllm from "@mlc-ai/web-llm";
const appConfig: webllm.AppConfig = {
model_list: [
{
"model": "https://huggingface.co/CharlZKP/LFM3-1.7B-MLC/resolve/main/LFM3-1.7B-q6f16_a-MLC",
"model_id": "LFM3-1.7B-q6f16_a-MLC",
"model_lib": "https://huggingface.co/CharlZKP/LFM3-1.7B-MLC/resolve/main/libs/LFM3-1.7B-q6f16_a_cs1k-webgpu.wasm",
"vram_required_MB": 3202.54,
"low_resource_required": true,
"overrides": {
"context_window_size": 32768
},
"required_features": [
"shader-f16"
]
}
]
};
const engine = await webllm.CreateMLCEngine("LFM3-1.7B-q6f16_a-MLC", { appConfig });
const reply = await engine.chat.completions.create({
messages: [{ role: "user", content: "Hello!" }],
});
console.log(reply.choices[0].message.content);
The same records are in webllm-model-records.json. model points
at the folder of one quantization and model_lib at its .wasm; nothing else has to be hosted.
Files
LFM3-1.7B-q6f16_a-MLC/ weights (params_shard_*.bin), tensor-cache.json, mlc-chat-config.json, tokenizer
libs/ model libraries (.wasm), one per quantization
webllm-model-records.json ready-to-paste WebLLM ModelRecords
About the model
LiquidAI/LFM3-1.7B is a 1.73B-parameter foundational language model developed by Liquid AI featuring an innovative tri-hybrid architecture:
- 13 Gated Short-Convolution Layers ($k=7$) capturing local context with low compute and recurrent conv cache state.
- 5 Sliding-Window Attention (SWA) Layers ($W=256$) for efficient semi-local attention.
- 6 Full Global Attention Layers with zero-tail partial RoPE ($\theta=1,000,000$, partial rotary factor 0.5) supporting up to 256K native context.
- Sandwich RMSNorm (4 RMSNorms per layer) and head-wise gated attention suppressing activation outliers.
This model is also distributed in GGUF format as LiquidAI/LFM3-1.7B-GGUF.
This repository provides WebLLM / MLC weights and compiled WebGPU WGSL model libraries (.wasm), enabling real-time client-side browser execution via WebGPU with zero cloud dependencies.
Quantization Variants
q6f16_a (GGUF Q6_K Equivalent)
- Base Bit-width: 6-bit asymmetric quantization (6.625 bpw, ~1.43 GB).
- Format: 32 weights per sub-block (8-bit scale + 8-bit min), 256 weights per super-block (bf16 $d, dm$ scales).
- Precision Preservation: The 1D causal convolution weights (
conv.conv.weight, shape $2048 \times 1 \times 7$) and attention head gating projections (self_attn.gate_proj, shape $16 \times 2048$) are strictly preserved in high-precision unquantized fp16 (no_quantization = True). - WebGPU Buffer Compliance: Slices large embedding and vocabulary dequantization operations into 32,000-token chunks, strictly complying with the 128 MiB WebGPU
maxStorageBufferBindingSizelimit across desktop and mobile devices.
Use with WebLLM
import * as webllm from "@mlc-ai/web-llm";
const appConfig: webllm.AppConfig = {
model_list: [
{
model: "https://huggingface.co/CharlZKP/LFM3-1.7B-MLC/resolve/main/LFM3-1.7B-q6f16_a-MLC",
model_id: "LFM3-1.7B-q6f16_a-MLC",
model_lib: "https://huggingface.co/CharlZKP/LFM3-1.7B-MLC/resolve/main/libs/LFM3-1.7B-q6f16_a_cs1k-webgpu.wasm",
required_features: ["shader-f16"],
vram_required_MB: 2150,
low_resource_required: true,
overrides: { context_window_size: 32768 }
}
]
};
const engine = await webllm.CreateMLCEngine("LFM3-1.7B-q6f16_a-MLC", { appConfig });
const reply = await engine.chat.completions.create({
messages: [{ role: "user", content: "Explain the benefits of hybrid convolution-attention models." }]
});
console.log(reply.choices[0].message.content);
Attribution & License
- Base Model: LiquidAI/LFM3-1.7B
- GGUF Reference: LiquidAI/LFM3-1.7B-GGUF
- Developer: Liquid AI
- License: LFM1.0 (
license: other,license_name: lfm1.0)
How this was built
mlc_llm convert_weight / gen_config / compile (WebGPU) from a conversion pipeline with
custom quantization presets, using an importance matrix from calibration text. The .wasm
libraries contain the model's compiled kernels, including the custom dequantization kernel, and
are checked against an official WebLLM library for ABI compatibility.
License
apache-2.0, inherited from LiquidAI/LFM3-1.7B.
- Downloads last month
- -