LFM3-1.7B GGUF for the web

A smaller 4-bit GGUF of LFM3-1.7B by Liquid AI, made for in-browser use with wllama (llama.cpp in WebAssembly) on the CPU, where phones without WebGPU run it. It's the GGUF counterpart of daveycodez/LFM3-1.7B-Web-ONNX and uses the same vocabulary.

This is an unofficial community build. It is not made, reviewed or endorsed by Liquid AI.

Changes from the original

This repository contains modified files. Compared with LiquidAI/LFM3-1.7B-GGUF:

  • Smaller vocabulary: trimmed from 128,000 to 49,012 BPE tokens (plus the same 140 special tokens; 49,152 embedding rows), the same vocabulary as daveycodez/LFM3-1.7B-Web-ONNX. Every byte token and all special tokens (chat, tool-call and thinking tokens) are kept, and the merges stay consistent, so any text still tokenizes and decodes back exactly. The tied embedding / LM head, the tokenizer and the special token ids changed to match. Less common words split into more tokens, and non-English text needs many more tokens (see below).
  • Re-quantized weights: quantized from the BF16 GGUF to Q4_K with an importance matrix, with the tied embedding / LM head at Q6_K (90.7% of the file Q4_K, 9.1% Q6_K). The importance matrix came from about 36k tokens of WikiText-2 training text plus chat replies generated by the BF16 model, and covers the output layer too. No calibration text is included in the file.

The chat template and sampling settings in the file are unchanged.

Q4_K_M (original) This build
File 1,099,627,808 bytes 911,948,864 bytes (โˆ’188 MB)
WikiText-2 test perplexity, per original token (BF16: 19.79) 20.36 20.15
Perplexity on chat replies written by the trimmed BF16 model (BF16: 2.639) 2.773 2.770
Perplexity on chat replies written by the original BF16 model (BF16: 2.615) 2.746 3.260
Prompts answered with a direct tool call (BF16: 20/20) 20/20 20/20

Perplexity is scored per original token so the two vocabularies compare fairly. On replies written by the original model, this build scores worse mostly on the words the smaller vocabulary splits, which the model never saw split in training; on its own replies it matches the original, since it picks words that tokenize well.

Tokens: English prompts take about 1โ€“2% more tokens than with the original vocabulary. Other languages take far more: German about 1.75ร—, Spanish 1.6ร—, Japanese 2.5ร—, Chinese 3ร—, Russian 2.8ร— and Arabic 4.2ร— as many, which makes prompts slower to read and replies slower to write. For non-English use, prefer the original.

Speed: in headless Chromium on a Mac with wllama at 4 threads, it loads about 27% faster and writes about 6% faster than the original Q4_K_M; prompt reading is the same.

Usage

Use it like the original GGUF, with a llama.cpp build that supports LFM3 (commit 19cce69 or later), in the browser with wllama or natively. Thinking is switched with the chat template's enable_thinking.

License

LFM3 is released under the LFM Open License v1.0, which also covers this build. Commercial use is licensed only for entities with annual revenue under $10 million. Original model ยฉ Liquid AI, Inc.

Downloads last month
77
GGUF
Model size
2B params
Architecture
lfm3
Hardware compatibility
Log In to add your hardware
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support

Model tree for daveycodez/LFM3-1.7B-Web-GGUF

Quantized
(79)
this model