Find and choose GGUF and LiteRT-LM models
How to choose a model format, quantization, template diagnostic, and capability probe for LlamaEngine, plus where to find runnable app presets.
On this page
LlamaEngine (chat, text generation, embeddings, tool calling and multimodal
input) loads two model artifact formats:
-
GGUF (
.gguf), run throughllama.cppnatively and the WebGPU bridge in browsers. .litertlmbundles, run through LiteRT-LM.
LlamaEngine cannot load raw PyTorch (.bin) or generic .safetensors
LLM
checkpoints directly; convert them to a quantized GGUF or use a published
.litertlm bundle that matches the pinned runtime.
Other llamadart engines have their own format rules:
-
ImageGenerationEngine(Preview) loads compatible image GGUF and.safetensorsfiles directly (and explicit-role.ckpt/.pth/.ptcheckpoints in bounded recipes). -
DecisionEnginepairs a GGUF backbone with a.safetensorsdecision head. -
SpeechToTextEngineandTextToSpeechEngineuse GGUF or.litertlmartifacts depending on the adapter; check each guide for requirements.
Thousands of pre-converted GGUF models are available. LiteRT-LM bundles are more specialized; use them when your target model is distributed for LiteRT-LM or when you are intentionally targeting or benchmarking that runtime path.
Where to find models#
The best place to find GGUF models is
Hugging Face. Search for a
model name followed by gguf (for example, Llama-3-8B-Instruct-GGUF). To
learn more about the GGUF format and quantization:
For LiteRT-LM, look for repositories that publish .litertlm files and
document LiteRT-LM compatibility. If both GGUF and .litertlm variants exist,
see Choosing llama.cpp or LiteRT-LM
before
treating them as equivalent artifacts.
Understanding Quantization#
GGUF models usually ship at several quantization levels, denoted by tags like
Q4_K_M or Q8_0. Quantization reduces weight precision to save memory and
speed up inference, at a small cost to output quality (perplexity):
-
Q4_K_M: The recommended baseline. Balances small file size, fast generation, and model quality. -
Q5_K_M: Slightly larger and slower thanQ4_K_M, retaining more quality when you have RAM to spare. -
Q8_0: Close to unquantized quality, but requires roughly twice the RAM of 4-bit variants. -
Q2_K/Q3_K: Highly compressed for severely memory-constrained devices, with noticeable degradation on reasoning and instruction following.
Recommended constraints per platform#
Your target device needs enough free RAM (or VRAM for GPU offloading) to hold the downloaded artifact plus the KV cache/context window and runtime buffers. Check the file size on Hugging Face alongside your target device's available memory rather than relying on parameter counts alone.
After loading a model, probe what the active runtime and model actually support instead of branching on file names or device labels:
-
Call
await engine.capabilities(andengine.getBackendName()) to check tool calling, vision, thinking budget, and sampling support before exposing controls (Checking the loaded runtime). -
Call
await engine.chatTemplate(...)to inspect the rendered prompt and detected template format (Model compatibility). - For memory tuning and context sizing, see Performance tuning and the Support matrix.
Starting points#
Start with one small reproducible chat GGUF, then branch out to task guides or runnable app presets:
-
Small chat onboarding:
hf://unsloth/Qwen3.5-0.8B-GGUF/Qwen3.5-0.8B-Q4_K_M.gguf(about 533 MB). Used by the Basic app example. Addmmproj-F16.gguffrom the same repository when testing vision. (The Quickstart uses the 88 MBSmolLM2-135M-Instruct-Q2_K.ggufonly as a fast pipeline smoke test, not to judge model quality.)
Format-specific exceptions and specialist guides:
-
Multimodal GGUF vs
.litertlm: GGUF vision/audio models require a matchingmmprojprojector file;.litertlmmultimodal bundles package media weights inside the bundle (Multimodal input). - Other tasks: Embeddings, Speech to text, Text to speech, Decision models, and Image generation.
- Runnable presets and scoped receipts: See the Basic app and Chat app examples for curated presets, and the Support matrix and Feature validation evidence for qualified combinations.
Downloading a model#
Once you find a model on Hugging Face:
- Open the Files and versions tab of the model repository.
-
Pick a file ending in
.gguf(for example,model-q4_k_m.gguf) or.litertlm. -
Pass the exact repository path to
ModelSource.parse('hf://owner/repo/path/to/model.gguf')and load it withLlamaEngine.load(LlamaModel(...)). Keep the real file extension in the path soLlamaBackend()can route to the correct runtime.
ModelSource.path(...) takes a filesystem path on native targets; on web it is a
URL relative to the document. llamadart has no asset loader: to ship a model
as a Flutter asset on native, copy the asset to a file first (for example into
the app support directory) and pass that path.
Revisions, private repositories, mmproj projector files and sharded GGUFs:
see Download and cache models.