nvidia/NVIDIA-Nemotron-Labs-Dory1.0-4B-BF16 converted to the LiteRT-LM (.litertlm) format for Google's LiteRT-LM runtime: an int4 file for the GPU and an int8 file for the CPU, plus a one-loop int4 file: the int4 file's weights in a graph that runs the shared block of layers once per token instead of twice (faster on the GPU, lower on GSM8K; Loops). Built with hf-to-litertlm (dory_work/) on litert-torch 0.9.4 and tested on litert-lm 0.18.0. On a Galaxy S26 the int4 file decodes at 12.09 tok/s on the GPU (measured 2026-10-22); in runs that alternated the two int4 files on that phone, the one-loop file decoded at 17.32 tok/s against the int4 file's 11.08 (2026-10-23).
NVIDIA describes Dory1.0-4B as "a looped (latent-recurrent) large language model (LLM) trained by NVIDIA": a normalized-GPT (nGPT) model whose middle block of layers runs several times per token ("By repeatedly applying a shared block of layers, Dory1.0-4B can spend more compute per token"), with interleaved sliding-window and full attention. NVIDIA states that the model "is ready for commercial or non-commercial use", lists English, and recommends two loops as the default; its benchmark table (on the source card) compares 1, 2 and 4 loops. The int4 and int8 files run two loops and the _int4_1loop file one (Loops).
The checkpoint has 72 blocks, each either an attention or an MLP block: 8 input, 20 recurrent and 8 output pairs, the 20 recurrent pairs run twice per token. Hidden size 2560, 16 query heads and 4 KV heads of 256, 27 sliding-window (1,024 tokens) and 9 full-attention layers, MLP 7168, a 131,072-token vocabulary with untied embeddings; 3,975,229,440 parameters. There is no RMSNorm: every hidden vector, query and key is L2-normalized (nGPT), and each block mixes its output into the residual with a learned step. These files keep one KV cache per attention layer and loop (NVIDIA's "per-loop" mode: 56 caches, 36 in the one-loop file) with a 2048-token budget.
| File | Recipe | Size | sha256 |
|---|---|---|---|
NVIDIA-Nemotron-Labs-Dory1.0-4B_int4.litertlm |
int4 blockwise-32 on the linear layers, codes chosen by GPTQ (Conversion notes), block scales floored at 2^-14; int8 embedding in its own section; the KV-cache writes and attention matmuls as the runtime's GPU composites (fused GPU ops; Conversion notes); no activation type declared: on the GPU it runs with the runtime's default fp16 activations | 2.40 GB (2,403,893,248 bytes) | 0cb4687b88da2bdc3460e0ef8f280dfffc88487e566e07774c7a7db5b42d33c1 |
NVIDIA-Nemotron-Labs-Dory1.0-4B_int8.litertlm |
int8 dynamic (channelwise int8 weights, float activations) on the linear layers; int8 embedding in its own section | 4.05 GB (4,046,733,312 bytes) | 66ca6b2ba6512dd3d9f2b8959f6fa55ccb2fc95bd6f80db443a1658cab71c68c |
NVIDIA-Nemotron-Labs-Dory1.0-4B_int4_1loop.litertlm |
the int4 file's weights, embedding, tokenizer and LlmMetadata section (template, stop tokens, thought channel) byte for byte, in a graph that runs the 20 recurrent pairs once per token (its executor metadata lists 36 KV caches; Loops); the GPU composites; no activation type declared | 2.40 GB (2,400,616,448 bytes) | bfc771603b59ca3191cfe6874d3840772b5794ea9f163c28c7b6c58939885e5a |
Use the int4 file on a GPU and the int8 file on a CPU; the one-loop file is faster on a GPU and scored lower on GSM8K (Loops). On GSM8K (thinking off, Accuracy) the int4 file scored 90 and the one-loop file 86 on the Mac GPU, and the int8 file 93 on the Mac CPU, against 95 for the BF16 model in llama.cpp with two loops (86 with one). On a CPU the int4 file is the wrong choice: an earlier int4 build of this model prefilled at a third of the int8 rate on the Galaxy S26 CPU (29.0 against 92.1 tok/s), and the int4 weights' greedy answers change from one CPU to another (Correctness). Time for a 1024-token prefill plus 256 decoded tokens at context 2048, from the rates in Performance:
| Seconds | Mac M4 Max | Galaxy S26 | Pixel 8a |
|---|---|---|---|
| int4 GPU | 5.43 | 24.78 | not run (Performance) |
| int8 CPU | 19.70 | 62.93 | 298.9 |
| int4 one loop, GPU | 3.54 | 17.11 | not run |
The one-loop row was measured on 2026-10-23 in runs that alternated it with the int4 file, which took 5.37 s on the Mac and 26.84 s on the Galaxy S26 in those runs (on the phone the int4 file's GPU clock was under its thermal cap in more of the samples than on 2026-10-22; Performance).
8-question check (the questions with " Answer briefly." appended, thinking on, rendered with NVIDIA's template, one fresh session each, greedy, up to 2,048 tokens): the int4 file 8/8 on the Mac GPU with the default fp16 activations (every thought closed, no repeated text) and 8/8 with fp32 activations, where its streamed text equals that of the same weights without the GPU composites on all eight, piece by piece as the runtime streams it, with the same number of decoded tokens; the int8 file 8/8 on the Mac CPU, and "Complete the rhyme: Roses are red, violets are ___" answered "blue" in 3 more fresh processes. On the phones (LiteRT-LM v0.18.0's litert_lm_advanced_main, one process per question): the int4 file 8/8 on the Galaxy S26 GPU with every node of the four graphs on the OpenCL delegate, the int8 file 8/8 on the Galaxy S26 CPU and 8/8 on the Pixel 8a CPU.
On a CPU the int4 weights answer the rhyme question differently from process to process and from CPU to CPU: without the GPU composites they answered "purple" in 3 of 4 processes on the Mac CPU, in 4 of 4 on the Pixel 8a CPU and in 1 of 1 on the Galaxy S26 CPU (on the Mac and the Pixel 8a the other seven questions were right; on the Galaxy S26 only the rhyme question was run with these weights), and this file answered all eight right in its one Mac CPU process. That is one reason the CPU file is the int8 one.
The one-loop file answered 7 of 8 on the Mac GPU with fp16 activations and 7 of 8 on the Mac CPU (every thought closed, no repeated text): the rhyme question came out "red" on the GPU (with fp32 activations too) and "purple" on the CPU. On the Galaxy S26 GPU it answered 8 of 8, "blue" included, with every node of the four graphs on the OpenCL delegate. The PyTorch reference with the same one-loop int4 weights answers "blue"; re-reading the Mac GPU's fp32-activation text token by token, the reference would have chosen the same next token at 932 of its 935 steps; at the other three its own choice led the file's by at most 0.021 logits, the first time at the 39th token of the thought, where the reference's own two best tokens were 0.016 apart. Re-reading the two-loop int4 file's fp32-activation text the same way, the two-loop reference chose the same next token at every step.
The graph was checked against a PyTorch implementation of NVIDIA's formulas (the vLLM pull request that adds Dory), itself checked against NVIDIA's llama.cpp implementation: over 9 prompts of 26 to 1,911 tokens the largest difference between the two references among the top-20 first-step logits is 2.04e-4, and a float LiteRT export of the same model definition generated the same 64-token texts as the PyTorch reference on the Mac GPU with fp32 activations and on the Mac CPU with one thread (9 of 9 each).
GSM8K: test questions 0–99 with a step-by-step instruction and a final #### <number> line, thinking off (the prompt ends with <think></think>), the prompt rendered with NVIDIA's template, greedy, at most 2,048 tokens of prompt and reply together, a fresh session per question (litert-lm 0.18.0 Python API, Mac M4 Max). The reference is the BF16 checkpoint in llama.cpp with NVIDIA's Dory support (ggml-org/llama.cpp#30306 at 43e865ec), two loops, greedy, the same prompts and the same budget. It was also run with one loop (the model's num_loops overridden to 1 at load; nothing else changed).
| Configuration | GSM8K |
|---|---|
| BF16 reference, two loops (llama.cpp, Metal) | 95 / 100 |
| BF16 reference, one loop (llama.cpp, Metal) | 86 / 100 |
| int4 file, Mac GPU (fp16 activations) | 90 / 100 |
| one-loop int4 file, Mac GPU (fp16 activations) | 86 / 100 |
| int8 file, Mac CPU | 93 / 100 |
With thinking on, the 2048-token budget of these files is short for GSM8K: the two-loop BF16 reference left 29 of the first 32 questions with the thought still open at 2,048 tokens, and 11 of 32 at 4,096, so GSM8K was run with thinking off only.
NVIDIA's card: "Elastic Inference Compute: A single checkpoint serves different inference compute budgets. By changing how many times the shared block of layers is applied, you can trade inference compute for accuracy to suit each task, with no retraining and no model swap." It recommends two loops as the default and one loop "when minimizing compute per token is the priority".
The _int4_1loop file is that trade in LiteRT-LM. It holds the int4 file's weights, embedding, tokenizer and LlmMetadata section (template, stop tokens, thought channel) byte for byte; the graph and its executor metadata differ: it was exported with n_recurrent_loops set to 1, so every token goes through the 20 recurrent pairs once (the decode graph runs 289 fully-connected ops instead of 449) and the KV cache has 36 layers instead of 56. Against the int4 file, in runs that alternated the two (2026-10-23; Performance):
| int4 file (two loops) | one-loop file | One loop / two | |
|---|---|---|---|
| Mac M4 Max GPU: decode / prefill (tok/s) | 58.46 / 1034.8 | 88.18 / 1619.6 | × 1.51 / × 1.57 |
| Galaxy S26 GPU: decode / prefill (tok/s) | 11.08 / 274.5 | 17.32 / 439.6 | × 1.56 / × 1.60 |
| Galaxy S26 GPU memory | 5.38 GB | 4.52 GB | |
| GSM8K, Mac GPU, thinking off | 90 / 100 | 86 / 100 |
On GSM8K the two files disagree on 10 of the 100 questions: 7 right with two loops only, 3 with one loop only. The BF16 reference shows the trade too: 86 with one loop against 95 with two, 10 questions right with two loops only and 1 with one loop only. One question's answer depended on where the one-loop file ran: asked "Complete the rhyme: Roses are red, violets are ___", it answered "red" on the Mac GPU, "purple" on the Mac CPU and "blue" on the Galaxy S26 GPU; the int4 file answers "blue" on all three, as does the PyTorch reference with the one-loop weights, whose text parts from the Mac GPU's at a near-tie early in the thought (Correctness). The loop count did not change the PyTorch reference's answer to the rhyme question. NVIDIA recommends two loops; the int4 file is the one to start with.
To try the trade on your own question, the loops sample of hfmodels for Android (an independent library, not affiliated with Google, Hugging Face or NVIDIA) runs both int4 files on the phone's GPU and shows their answers side by side, each with its time. It was run on a Galaxy S26; on the 8 GB Pixel 8a none of the GPU builds we ran fitted (Performance). Four of its eight examples are among the ten GSM8K questions on which the two files disagree. On one of them, question 75, the BF16 reference also answers wrong with one loop and right with two.
litert-lm run ./NVIDIA-Nemotron-Labs-Dory1.0-4B_int4.litertlm --prompt "Extract the dates from: The meeting moved from May 3 to May 17." --backend gpu --cache no
litert-lm run ./NVIDIA-Nemotron-Labs-Dory1.0-4B_int8.litertlm --prompt "Extract the dates from: The meeting moved from May 3 to May 17." --cache no
litert-lm run ./NVIDIA-Nemotron-Labs-Dory1.0-4B_int4_1loop.litertlm --prompt "Extract the dates from: The meeting moved from May 3 to May 17." --backend gpu --cache no
On the Mac M4 Max (litert-lm 0.18.0) the first two commands printed a [thought] … [/thought] block (1,469 and 1,330 characters) and then May 3 and May 17, in 11.2 s (int4, GPU) and 37.9 s (int8, CPU) including engine creation, at a peak memory footprint of 3.8 GB and 22.0 GB. The one-loop command printed a 1,621-character thought and the same answer in 8.0 s (GPU), at a peak memory footprint of 3.5 GB. Without --backend, run uses the CPU; without --cache no, the CLI can write a compiled cache file next to the model on its first run (--cache disk). For Android, see android-gpu.md; an Android app that runs the two int4 files is linked under Loops.
Thinking is on by default: the template ends the generation prompt with <think> and a newline, and the file declares the thought channel (<think> / </think>), so the runtime returns the reasoning separately. The template reads enable_thinking: rendered with it set to false, the prompt ends with <think></think> (the GSM8K prompts below were rendered that way). NVIDIA recommends temperature 1.0 and top-p 0.95; the file sets no sampler. No start token; stop tokens </s> (id 2) and <|im_end|> (id 11), plus 14 stop sequences that the exporter adds: <|im_end|> followed by a newline, alone and with one of 13 characters in front (12 punctuation marks and a space). An answer whose last mark is a token of its own, such as a ? or . after a word, arrives without that mark on LiteRT-LM 0.16.1, the runtime of the Android app under Loops, and on the earlier releases whose source we read (0.11.0 to 0.16.0): the runtime holds the mark back to see whether <|im_end|> and a newline follow, the answer ends on <|im_end|> alone, and the held mark is never written. A mark that the tokenizer merges with the text before it (**., ).) is kept. LiteRT-LM 0.17.0 and later write the held mark (StopTokenStreamFilter in runtime/core/tasks.cc, read in the source of 0.17.0 to 0.18.1). The tokenizer section is the repo's tokenizer.json byte for byte. Tool calling was not tested on these files; the file's model type is generic_model, for which the runtime does not parse tool calls out of the reply.
The chat template is NVIDIA's with three edits for the runtime: a macro that reads message content as a string or as text parts, that macro used at the seven places the template reads content, and the two history lines rewritten so that every earlier assistant turn is rendered in one form (<think></think> and the answer) and each new turn's prompt starts with the previous one, which the runtime requires. Its renders equal transformers' render of NVIDIA's template in 8 of 8 cases (4 conversations × thinking on / off).
With thinking off, from the second turn of a conversation on, LiteRT-LM puts the previous answer's stop token into the KV cache with a zero embedding, because these files hold the embedding table in its own section and the decoder takes embeddings (read in the source of LiteRT-LM 0.16.0 to 0.18.1; measured with 0.18.1 on WeVisOne-VL-2B and Qwen2.5-Coder-1.5B-Instruct, not on these files), so later answers in a conversation can differ from the answer the model gives to the same messages in one prompt. With thinking on, the runtime rebuilds the cache from the re-rendered history at each turn, so the second turn is free of it; the same source shows a zero embedding at another token from the third turn on (not measured). One question per conversation avoids both, as does a new conversation that starts with the earlier messages and the new question.
On litert-lm 0.18.x and 0.19.0, a blocking send_message that is still generating after 10 minutes fails with DEADLINE_EXCEEDED (a fixed timeout with no setting), and the generation it leaves running can crash the process. For long replies on a slow backend (long thinking in particular), lower max_output_tokens or use the streaming send_message_async, which has no such limit.
Mac Studio M4 Max, litert-lm 0.18.0: litert-lm benchmark <file> -p 1024 -d 256 --max-num-tokens 2048 --runs 3 --cache no --backend <cpu|gpu>; GPU is WebGPU on Metal. Each row is the mean of two benchmark processes (a warm-up and 3 runs each), measured 2026-10-22 in one quiet period on the Mac with no other heavy job, alternating with a comparison build in the order A B B A: the int4 file against the same weights without the GPU composites, the int8 file against the int4 weights on the CPU. The one-loop row was measured the same way on 2026-10-23, alternating with the int4 file, which ran at 1034.8 / 58.46 tok/s and 1.01 s there.
| Mac M4 Max | Prefill 1024 (tok/s) | Decode 256 (tok/s) | TTFT (s) |
|---|---|---|---|
| int4 GPU | 1033.9 | 57.71 | 1.01 |
| int8 CPU | 302.0 | 15.70 | 3.53 |
| int4 one loop, GPU | 1619.6 | 88.18 | 0.64 |
Phones (Android 16, LiteRT-LM v0.18.0's litert_lm_advanced_main, --benchmark_prefill_tokens=1024 --benchmark_decode_tokens=256 --num_iterations=3, measured 2026-10-21 to 23): two benchmark processes per row, each the mean of iterations 2–3, and the mean of the two.
| Phone | File, backend | Prefill 1024 (tok/s) | Decode 256 (tok/s) | TTFT (s) | Peak memory |
|---|---|---|---|---|---|
| Galaxy S26 (SM-S942Q, Adreno) | int4 GPU | 284.0 | 12.09 | 3.69 | process 1.90 GB, GPU 5.43 GB |
| Galaxy S26 | int8 CPU | 83.0 | 5.06 | 12.60 | 5.72 GB |
| Galaxy S26 | int4 one loop, GPU | 439.6 | 17.32 | 2.39 | process 1.52 GB, GPU 4.52 GB |
| Pixel 8a (Tensor G3, Mali-G715) | int8 CPU | 12.5 | 1.18 | 83.9 | 4.83 GB |
Phone rates follow the heat. Both Galaxy S26 GPU runs of the int4 file started cool (thermal status 0) and ended at status 1 and 2, with the GPU clock under its thermal cap in 3 and 23 of the 40 samples a 2-second sampler took; from a warmer start (status 1) the same file fell to 9.2–9.5 tok/s by the third iteration. The one-loop file's two runs (2026-10-23) also started cool and ended at status 2, with the GPU clock under its cap in 19 of 29 samples each; each was paired in one series of runs with a run of the int4 file, one in each order, and those two int4 runs (also started cool, GPU under its cap in 24 of 42 and 35 of 43 samples) gave 274.5 / 11.08 tok/s by the same rule. Of the two Galaxy S26 CPU runs one started at thermal status 0 and one at 1, and of the Pixel 8a runs one at 0 and one at 1 with the CPU already capped; the CPU was capped through almost every sample of every CPU run.
export_hf (transformers has no Dory class; the formulas follow NVIDIA's vLLM pull request), litert-torch 0.9.4, ai-edge-quantizer 0.9.0, litert-converter 0.4.0, torch 2.13.0, transformers 5.14.1; packed with litert-lm-builder 0.18.0. dory_work/convert_dory_4b.sh in hf-to-litertlm is the one command (REPRODUCE.md, "NVIDIA-Nemotron-Labs-Dory1.0-4B"); run as published on 2026-10-22, it rebuilt every weight of these two files byte for byte (the GPTQ codes included) and their tokenizer, executor and embedder sections; its decoder sections are the same computation with two constants and the operators in another order, and its metadata holds the same stop tokens in another order (Python's per-process string hashing; these files were exported without a fixed seed, the script fixes it), so compare sections, not files. Its GPU step, run alone on the graph the int4 file was made from, gave the int4 file's decoder section byte for byte, and a second run of the GPU step and the pack gave the same sections byte for byte.tools/gpu_graph/gpu_graph_retrofit.py, which dory_work/retrofit_gpu.py loads unchanged and extends to the sliding-window mask that Dory's graph derives from its mask input: the KV-cache writes become the runtime's odml.cache_update composites and the attention matmuls odml.runtime_bmm composites (666 in the four graphs), and every weight stays byte for byte. On the Mac GPU (fp16 activations) decode went from 45.27 to 57.71 tok/s (× 1.275) and prefill × 1.021, in one A B B A run against the graph without them. On the Galaxy S26 GPU decode was × 1.17 and prefill × 1.03 over one run in each order; in the first of the three iterations, before heat slowed either file, decode was × 1.20–1.24, and over iterations 2–3 the ratio moved between × 1.0 and × 1.4 with the temperature at the start; the GPU memory grew by 0.7 GB (5.43 against 4.71 GB). On the Mac CPU they do not help (decode × 0.967, prefill × 0.945). With fp32 activations the 8 questions' streamed text is that of the graph without them, piece by piece; with fp16 activations 4 of the 8 texts part from it midway with the same answers, and GSM8K is 90 against 91 (every question the graph without them missed, plus one).dory_work/convert_dory_4b_1loop.sh in hf-to-litertlm makes it from the checkpoint and this repository's int4 file (both downloaded at pinned commits and checked): it exports the graph again with n_recurrent_loops set to 1 in the config (the same arguments otherwise), quantizes it data-free with the int4 recipe, writes the int4 file's GPTQ codes into it weight by weight (each weight found by its block scales, which the data-free quantization reproduces; 289 of 289), adds the GPU composites (426 in its four graphs) and packs it with the int4 file's metadata and embedding sections. In an fp16 emulation of the one-loop graph over the same 25 prompts no row overflows with the fp16 rewrite, and without it every overflowing row is in one of the 11 rewritten blocks, so the same rewrite covers the one-loop graph. Run on 2026-10-23 as it is published there, twice, each time in a fresh directory with only the downloads carried over (REPRODUCE.md), the script rebuilt every section of this file byte for byte (the file's own sha256 changes from run to run with the packer's uuid and timestamp, so compare sections).generic_model.External weights (since 2026-11-09). In NVIDIA-Nemotron-Labs-Dory1.0-4B_int4.litertlm, NVIDIA-Nemotron-Labs-Dory1.0-4B_int4_1loop.litertlm and NVIDIA-Nemotron-Labs-Dory1.0-4B_int8.litertlm, the weights sit in TFLiteWeights sections at the end of the file (LiteRT's external weights) instead of inside the model graph. On a Pixel 8a, the GPU engine of the v0.18.0 and v0.18.1 Android builds crashes (SIGSEGV) on a Qwen3-0.6B file with external weights (LiteRT-LM#3986). The earlier files with the weights inside the graph stay at revision 3e2388e. Measurements of NVIDIA-Nemotron-Labs-Dory1.0-4B_int4.litertlm, NVIDIA-Nemotron-Labs-Dory1.0-4B_int4_1loop.litertlm and NVIDIA-Nemotron-Labs-Dory1.0-4B_int8.litertlm on this page made before 2026-11-09 used earlier files, not the current ones.
From a conversation preface (the system message, initial messages, tools and extra context a conversation is created with) that has tools and no messages, LiteRT-LM renders these files' chat template with an empty message list, and the template reads messages[0] without checking that the list is non-empty, so the render fails with Failed to apply template: undefined value. This happens in two places: when the preface is prefilled at creation (prefillPrefaceOnInit = true in Kotlin, prefillPrefaceOnInit: true on the web, SetPrefillPrefaceOnInit(true) in C++; the default is false), where creating the conversation fails with that error, and in the preface render (renderPrefaceIntoString() in Kotlin and Swift, RenderPrefaceIntoString() in C++, litert_lm_conversation_render_preface_to_string in the C API). The same happens with extra context (such as enable_thinking) and no messages, and in the preface render with an empty preface (run in the runtime on one Qwen3 template; the other templates rendered with minijinja 2.14 and jinja2). Read in the source of LiteRT-LM 0.17.0, 0.18.1 and main; measured with LiteRT-LM 0.18.1 (the litert-lm package from PyPI) through its C API on these files' template text. The default path, where the first message is rendered together with the preface, is not affected: the Python API and the CLI of 0.18.1 expose neither the flag nor the preface render, and Google AI Edge Gallery sets neither (its source as read on 2026-10-25). A system message or any initial message in the conversation config avoids it.
On LiteRT-LM 0.18.1 and 0.19.1, once a message fails because it does not fit in the context window, every later message in that conversation fails as well (the next one with Task failed with state: 7). Start a new conversation after such an error.
The model is released by NVIDIA under the OpenMDW License Agreement, version 1.1 (OpenMDW-1.1), which grants permission "to deal in the Model Materials without restriction" and asks that a distribution keep a copy of the agreement and the copyright notices and other notices of origin of the Model Materials. This repository carries the agreement as LICENSE; the model's origin is nvidia/NVIDIA-Nemotron-Labs-Dory1.0-4B-BF16 by NVIDIA. Changes from the original work: weights converted from safetensors BF16 to LiteRT flatbuffers and quantized as described above (int4 codes chosen by GPTQ, block scales floored at 2^-14); the MLP normalization of 11 blocks rewritten for fp16 activations (the same numbers in fp32); in the int4 files, the KV-cache writes and attention matmuls replaced by the runtime's GPU composites; in the one-loop file, the shared block of layers applied once per token instead of twice; the chat template edited for the runtime's template engine; a 2048-token KV budget declared. This repository is a community conversion and is not affiliated with NVIDIA.