Instructions to use Kavic/LFM3-VL-2B-litertlm with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- LiteRT
How to use Kavic/LFM3-VL-2B-litertlm with LiteRT:
# 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
- LiteRT-LM
How to use Kavic/LFM3-VL-2B-litertlm with LiteRT-LM:
# LiteRT-LM runs on various platforms (Android, iOS, Windows, Linux, macOS, IoT, Web/WASM) # and supports many APIs (C++, Python, Kotlin, Swift, JavaScript, Flutter). # For platform-specific integration guides, please refer to the official developer website: # https://ai.google.dev/edge/litert-lm # To try LiteRT-LM, the easiest way is to use our CLI tool. # 1. Install the LiteRT-LM CLI tool: pip install -U litert-lm # 2. Download and run this model locally: # See: https://ai.google.dev/edge/litert-lm/cli # A single .litertlm file in the repo is picked automatically; otherwise the CLI asks which one to run # (or pass its name right after the repo id). litert-lm run \ --from-huggingface-repo=Kavic/LFM3-VL-2B-litertlm \ --prompt="Write me a poem"
- Notebooks
- Google Colab
- Kaggle
LFM3-2B & LFM3-VL-2B (32k Context LiteRT-LM Bundles)
Official Google AI Edge LiteRT-LM (.litertlm) model bundles of LiquidAI/LFM3-VL-2B with 32,768 (32k) max context length, optimized for on-device deployment across Google AI Edge Gallery, Android, iOS, Linux, and edge accelerators.
Built for the Fulkrum Reports on-device AI intelligence agent.
Bundles Provided
| File | Type | Max Context | Quantization | Size | Target Environment |
|---|---|---|---|---|---|
LFM3-2B_text_int4_32k.litertlm |
Text LLM | 32,768 (32k) | dynamic_wi4_afp32 |
~970 MB | Google AI Edge Gallery & Fulkrum Reports (Runs flawlessly on both GPU & CPU with zero vision delegate errors) |
LFM3-VL-2B_int4_32k.litertlm |
Multimodal VLM | 32,768 (32k) | dynamic_wi4_afp32 + FP32 Vision |
~1.65 GB | Fulkrum Reports & Multimodal runtimes (Dual GPU Language Model + CPU Vision Encoder) |
LFM3-VL-2B_int4.litertlm |
Multimodal VLM | 4,096 (4k) | dynamic_wi4_afp32 |
1.2 GB | Fulkrum Reports mobile devices |
LFM3-VL-2B_int8.litertlm |
Multimodal VLM | 4,096 (4k) | dynamic_wi8_afp32 |
2.1 GB | High precision evaluation |
Why is 32k context so lightweight on LFM3?
LiquidAI's tri-hybrid architecture consists of:
- 12 ShortConv layers: Fixed 6-step circular state buffers (~24 KB each, constant memory regardless of sequence length).
- 6 Sliding-Window attention layers: Constrained window size (
window=256, ~2 MB each). - Only 6 Full Attention layers: Only 6 layers accumulate KV cache!
For 32,768 tokens, the entire KV cache requires only: This enables full 32k context on mobile phones with 6β8 GB of RAM without OOM!
π± Google AI Edge Gallery Setup Guide
Which model file should I import in Edge Gallery?
For chatting and text evaluation in Google AI Edge Gallery, always use
LFM3-2B_text_int4_32k.litertlm.Why? Like Gemma-4-E2B-it, Edge Gallery's LLM Chat mode compiles the transformer decoder with the device's OpenCL GPU or XNNPACK CPU delegate. When a multimodal
.litertlmbundle is imported into Edge Gallery, LiteRT-LM attempts to initialize a vision encoder delegate which fails compilation (vision_litert_compiled_model_executor.cc:357: Failed to modify graph with delegate). The pure text bundle bypasses the vision executor entirely and runs with complete hardware acceleration on both GPU and CPU!
Step 1: Download the Model to Your Phone
- Download
LFM3-2B_text_int4_32k.litertlmfrom the Files and versions tab. - Transfer or save it into your Android device's Downloads or internal storage folder.
Step 2: Import into Google AI Edge Gallery
- Open the Google AI Edge Gallery app.
- Tap the
+(Add Custom Model) button. - Select your downloaded
LFM3-2B_text_int4_32k.litertlmfile. - On the Import Model configuration screen, set:
- Name:
LFM3-2B_text_int4_32k.litertlm - Model type:
LLM - Default max tokens:
4000(or up to32000) - Default TopK:
64 - Default TopP:
0.95 - Default temperature:
1.00 - Support image:
OFF(Disabled) - Support audio:
OFF(Disabled) - Support tiny garden:
OFF - Support mobile actions:
OFF - Support thinking:
ON(Optional: Enables collapsible<think>chain-of-thought blocks) - Support speculative decoding:
OFF - Compatible accelerators: Select
[ CPU ]or[ GPU ]
- Name:
- Tap Import.
Step 3: Chat Settings Configuration
Once imported, tap on the model in Edge Gallery to open the chat:
- Tap the settings gear icon (top right) to open Configure settings:
- Max tokens:
4000β32000(Supports full 32k context!) - TopK:
64 - TopP:
0.95 - Temperature:
1.00 - Accelerator:
GPU(Recommended for fast generation)CPU(For maximum stability across all Android chipsets)
- Enable thinking:
ONorOFF - Enable speculative decoding:
OFF(LFM3 is a standalone hybrid model) - Automatically compress context:
OFF
- Max tokens:
- Tap OK and start chatting!
π€ Using in Fulkrum Reports (Android)
In Fulkrum Reports, both pure text and multimodal vision modes are supported natively:
// Hybrid Execution: Decoupled GPU text generation + CPU vision encoder
val engineConfig = EngineConfig(
modelPath = modelFile.absolutePath,
backend = if (useGpu) Backend.GPU() else Backend.CPU(threadCount = 4),
visionBackend = Backend.CPU(threadCount = 4),
maxNumTokens = 32768
)
val engine = Engine(context)
engine.initialize(engineConfig)
val conversation = engine.createConversation()
Conversion Pipeline
Reproduce or export custom variants using scripts/convert_lfm3_vl_to_litertlm.py:
python scripts/convert_lfm3_vl_to_litertlm.py \
--model_id LiquidAI/LFM3-VL-2B \
--output_dir out/lfm3_32k \
--prefill_length 128 \
--cache_length 32768
- Downloads last month
- -