Instructions to use sairaph-official/OLMo-2-1B-Instruct-423cfd8 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- LiteRT-LM
How to use sairaph-official/OLMo-2-1B-Instruct-423cfd8 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=sairaph-official/OLMo-2-1B-Instruct-423cfd8 \ --prompt="Write me a poem"
- LiteRT
How to use sairaph-official/OLMo-2-1B-Instruct-423cfd8 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
- Notebooks
- Google Colab
- Kaggle
Sairaph mirror. Unmodified copy of the upstream files, hosted by Sairaph for the LLM Server app.
- Upstream repo: litert-community/OLMo-2-1B-Instruct
- Upstream commit:
423cfd834190797d0ca29725c0a1aee6508fabf0- Base model: allenai/OLMo-2-0425-1B-Instruct
- Kept files (byte-identical to the upstream commit; files the card below mentions that are not listed here are not mirrored):
OLMo-2-1B-Instruct_q4_block32_ekv4096.litertlm: 933543936 bytes, sha256aa3a27afd2ed3fe7d3870bf53dc6fa04a191f98d5d10028979524de9fb64b117- Licence and notice files added by Sairaph (the upstream repo has none):
LICENSE: verbatim copy of https://www.apache.org/licenses/LICENSE-2.0.txt (fetched 2026-11-23)- Licence statement of the base model card (allenai/OLMo-2-0425-1B-Instruct README at commit
48d788eca847d4d7548f375ad03d3c9312f6139e): "OLMo 2 is licensed under the Apache 2.0 license."The model card below is the upstream card at the upstream commit, unchanged.
LiteRT is Google's on-device runtime, the new name for TensorFlow Lite (Android: com.google.ai.edge.litert:litert), and litert-torch, the renamed ai-edge-torch, is its PyTorch converter: a PyTorch model converted unmodified with litert_torch.convert matched the original to 4e-7 on a Galaxy S26 (measured, LiteRT 2.2.0, Android 16, 2026-09-05).
OLMo-2-1B-Instruct β LiteRT-LM (blockwise int4)
This repository is a conversion of allenai/OLMo-2-0425-1B-Instruct to the LiteRT-LM (.litertlm) format, made with litert-torch (on 2026-11-14 a separate script rewrote its prefill/decode graph for the GPU; weights unchanged) for Google's LiteRT-LM runtime, for on-device text generation: on a Galaxy S26 GPU it decodes 48.8 tokens/s and prefills 1,024 tokens at 690 tokens/s (LiteRT-LM v0.19.0, 2026-11-14).
Try it in your browser: the LiteRT-LM Web chat demo loads OLMo-2-1B-Instruct_q4_block32_ekv4096.litertlm from this repo's web branch (931 MB download) and runs it with WebGPU. That branch keeps the file from before the 2026-11-15 entry below.
OLMo-2 is AllenAI's fully-open model family β open weights, open data, open training code, Apache-2.0. This 1B variant is small enough to run on a phone, and is converted with the official upstream litert-torch with no fork patches.
Model description
| File | OLMo-2-1B-Instruct_q4_block32_ekv4096.litertlm (0.93 GB) |
| Quantization | int4 weights β blockwise (block 32) + OCTAV optimal-clipping, symmetric; embedding int8 |
| Compute | integer |
| Context (KV cache) | 4096 |
| Base model | allenai/OLMo-2-0425-1B-Instruct |
The bundle carries the tokenizer and OLMo-2's native TΓΌlu prompt template (<|user|> / <|assistant|>, stop token <|endoftext|>), so no separate tokenizer files are needed.
How to use
1. Install the runtime
pip install litert-lm
2. Run it in one command β this downloads the model and answers the prompt:
litert-lm run --from-huggingface-repo litert-community/OLMo-2-1B-Instruct \
OLMo-2-1B-Instruct_q4_block32_ekv4096.litertlm \
--prompt "Explain on-device AI in one short sentence."
3. Keep it for repeated use β import once, then refer to it by name:
litert-lm import --from-huggingface-repo litert-community/OLMo-2-1B-Instruct \
OLMo-2-1B-Instruct_q4_block32_ekv4096.litertlm olmo-2-1b-instruct
litert-lm run olmo-2-1b-instruct # interactive chat
litert-lm serve # local OpenAI-compatible API server
If run stops with no error message from the CLI (a bus error; exit status 138 on a Mac) or with an error log that contains too large for file size, the downloaded file may be incomplete. The litert-lm CLI (0.14.0 to 0.19.2, and litert-lm-nightly 0.20.0.dev20261112) can keep an incomplete download in ~/.litert-lm/cache/huggingface/litert-community/OLMo-2-1B-Instruct/ and uses it again without checking its size, for run and for import. Delete that file and run the command again; if you imported the model, run import again, which also replaces the imported copy.
If you downloaded OLMo-2-1B-Instruct_q4_block32_ekv4096.litertlm with --from-huggingface-repo before it was replaced on 2026-11-15 (Japan time; 2026-11-14 23:10 UTC), delete ~/.litert-lm/cache/huggingface/litert-community/OLMo-2-1B-Instruct/OLMo-2-1B-Instruct_q4_block32_ekv4096.litertlm, then run again the command you used: the run command of step 2, the import command of step 3, or both. Without deleting it, the litert-lm CLI (0.14.0 to 0.19.2) keeps running the previous file: it uses a file it finds there without checking it against this repo.
The same bundle runs on macOS, Linux and Windows.
4. Run it on Android
Google AI Edge Gallery 1.0.16+ imports .litertlm models directly from Hugging Face β tap + (bottom-right) inside the app and pick this repository; no computer or adb needed. To sideload a local file instead:
adb push OLMo-2-1B-Instruct_q4_block32_ekv4096.litertlm /sdcard/Download/
then tap + and select the file. At 0.93 GB it fits comfortably on an 8 GB phone. To embed the model in your own Android app, use the LiteRT-LM Kotlin API (com.google.ai.edge.litertlm:litertlm-android).
Performance
litert-lm benchmark (litert-lm 0.15.0) on an Apple M4 Max, -p 256 -d 256 --runs 3 (the tool averages three iterations), max-num-tokens 4096, warm-up run discarded, otherwise idle machine:
| Device | Backend | Prefill (256) | Decode | TTFT |
|---|---|---|---|---|
| Apple M4 Max (macOS) | CPU | 347 tok/s | 33.3 tok/s | 0.87 s |
| Apple M4 Max (macOS) | GPU (Metal) | 3223 tok/s | 150.1 tok/s | 0.10 s |
Reproducibility: the GPU figures repeat to within about 1% across invocations; the CPU figures are noisier β six invocations of this model spread its CPU decode over 29.0β33.3 tok/s, so treat the CPU row as accurate to roughly Β±7%.
On device β iPhone 17 Pro (iOS 27.0), GPU/Metal backend, single cold run with no warm-up turn, prompt "Explain on-device AI in one short sentence.", max 512 tokens:
| Device | Backend | Prefill | Decode | TTFT | Load | Peak footprint |
|---|---|---|---|---|---|---|
| iPhone 17 Pro | GPU (Metal) | 27.6 tok/s | 24.4 tok/s | 0.95 s | 5.2 s | 1330 MB |
The iPhone prefill figure is measured on a short chat prompt, so it is dominated by fixed per-turn overhead rather than prefill throughput β it is not comparable to the 256-token desktop prefill column. The model also fits and runs on a Pixel 8a (8 GB) via Gallery; no timing was taken there, so none is quoted.
Accuracy note
GSM8K, n=100, greedy, 0-shot chain-of-thought, identical prompt and answer extraction for every row. The bf16 reference runs in PyTorch on CPU; the quantized rows run as .litertlm through the LiteRT-LM runtime.
| Configuration | GSM8K | Size |
|---|---|---|
| bf16 (reference) | 72.0% | β |
| int4, blockwise-32 + OCTAV β this model | 63.0% | 0.93 GB |
int8 (dynamic_wi8_afp32) |
65.0% | 1.50 GB |
63% is a coherent, non-degenerate score for a 1B: answers terminate cleanly at <|endoftext|> and do not degenerate. At this size 4-bit quantization costs about 9 points against bf16 β a 1B has less redundancy to absorb int4 rounding than a 3B+, where the same recipe lands at parity. int8 recovers only about 2 points for 60% more size (and the 2-point gap is within n=100 noise), so int4 is shipped as the size/quality trade-off for on-device use.
Galaxy S26 β GPU and CPU
Each run prefills 1,024 tokens (--benchmark_prefill_tokens=1024) and generates 256 tokens, three times (three iterations). The GPU row is the median of iterations 2β3 over two runs. On the CPU, iteration 1 runs faster than iterations 2 and 3, so each iteration has its own row: the median of that iteration over two runs.
| Backend | Prefill, 1,024 tokens | Decode | Time to first token | Peak (VmHWM) |
|---|---|---|---|---|
GPU (LiteRT GPU, every node of the prefill and decode graphs), iterations 2β3 |
690 tok/s | 48.8 tok/s | 1.50 s | 0.99 GB |
| CPU (XNNPACK), iteration 1 | 255 tok/s | 9.8 tok/s | 4.13 s | 2.82 GB |
| CPU (XNNPACK), iteration 2 | 126 tok/s | 9.6 tok/s | 8.23 s | 2.82 GB |
| CPU (XNNPACK), iteration 3 | 126 tok/s | 9.5 tok/s | 8.25 s | 2.82 GB |
Samsung Galaxy S26 (SM-S942Q / SM8850, Android 16), litert_lm_advanced_main built from the LiteRT-LM v0.19.0 source (commit 771b06e1; the v0.19.0 tag is on the next commit, which changes only Package.swift and README.md), --benchmark --benchmark_prefill_tokens=1024 --benchmark_decode_tokens=256 --max_num_tokens=2048; GPU runs on 2026-11-14, CPU runs on 2026-11-15. Each run is a new process.
In each of the four counted CPU runs, the phone lowers the clock caps of its two CPU clusters from 2β5 s in, to 1.56 / 1.50 GHz by 22β26 s in (and to 1.23 / 1.27 GHz in the last seconds of the run), so iterations 2 and 3 run at a lower clock than iteration 1. On the CPU, this file's 1,024-token prefill was 8.3β9.6 % faster than the previous file's (replaced on 2026-11-15, see the 2026-11-15 entry below) in each iteration, and its decode medians were between 0.4 % below and 0.4 % above the previous file's. Two counted runs of the same file differed by up to 1.6 %.
Peak is the process's VmHWM. On the CPU it was 2.81β2.82 GB in this file's two counted runs (2.84 GB in a warm-up run before them) and 2.26β2.34 GB in the previous file's two. VmHWM does not count memory the GPU driver holds: the phone's GPU allocation counter (kgsl_page_alloc) rose by 3.27β3.29 GB during this file's GPU runs and by 2.47 GB during those of the previous file.
On this phone the GPU decodes 5.0β5.1Γ as fast as the CPU and prefills 2.7β5.5Γ as fast, so this repo's litertlm_manifest.json recommends gpu for flagship-class Android. That recommendation rests on this phone alone: on the Pixel 11 Pro below, the CPU was not measured.
The runs behind each number, and the S26 section this card carried for an earlier file: MEASUREMENTS.md. GPU wiring, including the Gallery import toggle: GPU guide.
Pixel 11 Pro β GPU
On a Pixel 11 Pro GPU (PowerVR, Android 17, the same LiteRT-LM v0.19.0 build and workload as on the Galaxy S26), this file decodes 25.7 tok/s, 1.9 times the previous file's 13.5, and prefills 1,024 tokens at 689 tok/s, 1.8 times the previous file's 376. Of 8 short questions, both files answer 7 correctly (both say that 0.11 is larger than 0.9).
Conversion
Converted with the official upstream litert-torch export_hf (clean git worktree at upstream/main, dev-fork patches excluded). On 2026-11-14 the prefill/decode graph was rewritten with a public script (the 2026-11-15 entry below); the weights are still the ones this export wrote. Olmo2ForCausalLM rides the stock converter with no custom code: QK-norm and OLMo-2's reordered post-norm lower to generic ops. The int4 recipe is blockwise (block 32) + OCTAV with the embedding at int8. At 0.93 GB every section of the bundle is under 2 GiB (the largest, the weights, is 0.85 GB), so it needs no externalized embedder.
Training data & PII
This is a weights-exact format conversion of allenai/OLMo-2-0425-1B-Instruct; no new training was performed. OLMo-2 is fully open: pretrained on AllenAI's public Dolma-family corpus (web text, code, academic papers, encyclopedic and Q&A data) and post-trained with the public TΓΌlu 3 SFT + preference mix. Because the pretraining corpus is web-derived it may incidentally contain names and other PII; none was deliberately collected and this format conversion adds none. Apply your own content/PII filtering before deployment. See the base model card for full dataset and safety details.
2026-08-30 β tokenizer section replaced (weights unchanged)
The tokenizer.json embedded in OLMo-2-1B-Instruct_q4_block32_ekv4096.litertlm carried the GPT-2 default pre-tokenizer instead of the model's own regex, so digit groups and punctuation followed by a newline were split differently from the upstream tokenizer on every turn (each of the role markers <|user|>\n and <|assistant|>\n took one token more than with the upstream tokenizer). OLMo-2-1B-Instruct_q4_block32_ekv4096.litertlm now embeds the upstream tokenizer.json byte for byte.
Tokenizer-only change: every section of the bundle except the tokenizer is byte-identical to the previous file (verified by sha256 per section), so the weights, the graph and the chat template are unchanged and the speed and memory numbers on this card still describe this file per token β only the file's own sha256 differs. Verified on the LiteRT-LM runtime: one user message ("What is the capital of France?") as the chat template renders it, 7 test strings, the 223 standalone characters U+00A1βU+017F and every special token now tokenize identically to the upstream tokenizer. Every turn reaches the model differently from before (the role markers above), so answers can change: of the four ASCII-only test questions, one ("What is 17 + 25?") answered byte-identically to the previous file and three did not. Unless a row says otherwise, the accuracy figures on this card were measured on the previous file, and any on-device rows were measured on the previous file too β the on-device check has not been re-run on this one (the runtime's tokenizer code is the same on macOS and on device; the weights and graph are byte-identical). If you downloaded before 2026-08-30, re-download.
2026-11-15 β GPU graph and a 1,024-token prefill (weights unchanged)
The prefill/decode graph now has the GPU form litert-torch writes with --apply_gpu_composites, and a 1,024-token prefill signature next to the 128-token one. Every weight, and every section outside that graph, is byte-identical: sha256 bfd8c35eβ¦ (931,250,176 B) β aa3a27afβ¦ (933,543,936 B). On a Mac the two files give the same replies byte for byte on 4 prompts on the CPU (litert-lm 0.19.2, 1 thread, greedy decoding with top-k 1; one prompt is 1,435 tokens long with the chat template), and on one prompt on the CPU with litert-lm 0.19.0 to 0.19.2; on the Mac GPU both files answer that prompt, and their replies are the same for the first 27 lines. 8 short questions on the GPU: 8 of 8 with both files on a Mac, with the same answers; 7 of 8 with both files on a Pixel 11 Pro and with this file on a Galaxy S26 (each answers that 0.11 is larger than 0.9). Galaxy S26 GPU (LiteRT-LM v0.19.0, runs in the order previous, new, new, previous): decode 23.1 β 48.8 tokens/s, 1,024-token prefill 422 β 690 tokens/s. Galaxy S26 CPU (after one warm-up run, the same order): the 1,024-token prefill is 8.3β9.6 % faster in each iteration, decode is within 0.4 %, and peak memory (VmHWM) is 2.81β2.82 GB against 2.26β2.34 GB. Procedure: REPRODUCE.md. Measured on this file: the opening sentence, the Galaxy S26 and Pixel 11 Pro sections and this entry. Every other measurement on this card was taken on earlier files.
Raspberry Pi 5 (CPU)
Measured on a Raspberry Pi 5 Model B Rev 1.1 (8 GB, Raspberry Pi OS 64-bit) with litert-lm benchmark 0.16.1: CPU backend, 4 threads, 256 prefill + 256 decode tokens, --cache memory (the compile cache lives and dies with the process, so every invocation compiles the model from scratch; nothing is reused between runs), one warm-up plus one timed iteration per invocation, 3 invocations per file with cooldown in between. Values are the median across invocations (minβmax in parentheses). No thermal throttling occurred during these runs (vcgencmd get_throttled stayed 0x0). Every file listed produced coherent text in a real generation on this backend before its numbers were recorded.
| File | Prefill (tok/s) | Decode (tok/s) | TTFT | Peak RSS |
|---|---|---|---|---|
OLMo-2-1B-Instruct_q4_block32_ekv4096.litertlm |
40.0 (39.4β40.3) | 2.1 (2.1β2.1) | 7.7 s | 2.3 GB |
Known runtime issues
External weights (since 2026-10-30). In OLMo-2-1B-Instruct_q4_block32_ekv4096.litertlm, the weights sit in a TFLiteWeights section at the end of the file (LiteRT's external weights) instead of inside the model graph. On Android, the GPU path needs LiteRT-LM 0.19.0 or later: the GPU engine of the v0.18.0 and v0.18.1 Android builds crashes (SIGSEGV) on such a file (LiteRT-LM#3986). The earlier file with the weights inside the graph stays at revision 3ed9622.
On LiteRT-LM releases before 0.17.0 (read in the source of 0.10.1 to 0.16.1), an answer whose last punctuation mark is a token of its own, such as a . or ? after a word, arrives without that mark: this file carries stop sequences of <|endoftext|> and a newline with each of 13 characters in front (12 punctuation marks and a space), so the runtime holds the mark back to see whether <|endoftext|> and a newline follow, the answer ends on <|endoftext|> alone, and the held mark is never written. 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). Not measured on this file: this follows from the runtime's source read with this file's stop list and tokenizer; the drop itself was seen with LiteRT-LM 0.16.1 on a Galaxy S26, on another bundle whose stop sequences have the same form.
License and changes
Apache-2.0, inherited from the base model allenai/OLMo-2-0425-1B-Instruct. Changes from the original work: weights converted from safetensors bf16 to LiteRT flatbuffers and quantized as described above; tokenizer and prompt template repackaged unmodified into the .litertlm bundle. This repository is a community conversion and is not affiliated with AllenAI.
- Downloads last month
- 4
Model tree for sairaph-official/OLMo-2-1B-Instruct-423cfd8
Base model
allenai/OLMo-2-0425-1B