请求加入做种队列,或现在用 pf download litert-community/d1-Omni-2B-LiteRT 获取(CLI 指南)。
This repository is a conversion of LiquidAI/d1-Omni-2B to LiteRT, made with litert-torch 0.10.0 for the CompiledModel API of ai-edge-litert 2.3.0: on an Apple M4 Max with Metal at float32 precision, one question about a 10-second audio clip takes a median 89.0 ms, and one question about the source model card's support ticket 40.9 ms (2026-11-02).
LiquidAI/d1-Omni-2B is a decision model by Liquid AI for text, pictures and audio, built on LiquidAI/LFM3-Omni-2B. It reads a state (a string, any JSON value, or nothing when the media are the whole state), pictures, audio clips, and any number of named questions, written or spoken, and returns typed answers with their probabilities from one forward pass, without generating tokens: yes or no (noul), one or several of named options (choice), an ordered level (score), a text, number or date read from the state with its span (text, number, date), an estimate with an interval (number with a range), and one object or every instance in a picture (box, boxes). Requests and responses follow system_one() and system_one_batch() of the provider (Liquid AI's model code in the source repository). What it is for and how it scores: the source model card and the blog post.
This repository holds the model as LiteRT files and a Python host for desktops that needs no PyTorch. The decision graph comes as seven files for sequences of up to 128, 256, 512, 1,024, 2,048, 4,096 and 6,144 tokens; as one file that runs eight sequences of up to 128 tokens in one call; and as one file that holds all eight of these graphs over one copy of the weights. Four of the decision graphs also come compiled ahead of time for the NPU of the Qualcomm SM8850, the chip of the Galaxy S26. Seven tower files turn a picture into tokens, one file per canvas shape, and four audio files turn a clip into tokens, for clips of up to 504, 1,000, 2,000 and 3,000 feature frames. A decision graph takes the embeddings of a sequence's tokens and two small tables that say which positions see which, and returns the hidden states after the final norm. The host reads requests with the provider's own code (its api.py, prompt.py and the other files in provider/, unchanged), computes a clip's features, writes the embeddings, picks the graphs and reads the answers out. The repository also holds the tokenizer, the embedding table, test fixtures and the conversion scripts.
The reference for every check is the provider's own code in float32 on the CPU. On an Apple M4 Max, on the CPU and on the Metal GPU at float32 precision, the files passed every check on the 523 text and picture test requests and the 67 audio test requests that the reference answers and the host runs: the same most likely option on every question that is not a near tie, and probabilities within 1.32e-5 of the reference on text and pictures and within 0.000198 with audio.
On two Android phones, the graph files ran through LiteRT 2.2.0 on inputs that the host wrote on a Mac, and the host read the outputs back. One graph call for one question took 67.0 ms on the NPU of a Galaxy S26, with the decision file compiled for its chip, and 733.6 ms on the GPU of a Pixel 11 Pro at float32 precision (see Android).
The source model card's first example, a recording of three short beeps over quiet noise (16 kHz, 4 s) and two questions:
rate = 16000
clip = np.random.default_rng(0).normal(0, 0.003, 4 * rate).astype(np.float32)
for start in (0.5, 1.5, 2.5):
clip[int(start * rate):int(start * rate) + 3200] += 0.3 * np.sin(2 * np.pi * 880 * np.arange(3200) / rate)
out = host.system_one(None, {
"beeps": {"type": "number", "instructions": "How many beeps are there?", "range": [0, 10], "step": 1},
"speech": {"type": "noul", "instructions": "Does someone speak in the recording?"},
}, media=[{"type": "audio", "audio": clip, "sampling_rate": rate}])
| Question | Answer | Provider, float32 CPU | This repository, CPU | This repository, Metal (float32) |
|---|---|---|---|---|
beeps (estimate) |
number (median) | 3.0 | 3.0 | 3.0 |
| interval (p10, p90) | 3.0, 4.0 | 3.0, 4.0 | 3.0, 4.0 | |
speech (noul) |
P(yes) | 0.06638 | 0.06638 | 0.06638 |
All three give the card's printed line 3.0 False, and report 113 input tokens and no output tokens. Before rounding, both runs differ from the reference by at most 8.6e-7 on P(yes).
| File | Bytes | Role |
|---|---|---|
d1-omni-2b_decide_L128_fp16fc.tflite |
2,934,923,056 | Decision graph for sequences of up to 128 tokens. |
d1-omni-2b_decide_L256_fp16fc.tflite |
2,935,382,112 | Up to 256 tokens. |
d1-omni-2b_decide_L512_fp16fc.tflite |
2,938,800,160 | Up to 512 tokens. |
d1-omni-2b_decide_L1024_fp16fc.tflite |
2,940,897,312 | Up to 1,024 tokens. |
d1-omni-2b_decide_L2048_fp16fc.tflite |
2,945,091,616 | Up to 2,048 tokens. |
d1-omni-2b_decide_L4096_qb1024_fp16fc.tflite |
2,953,520,352 | Up to 4,096 tokens, attention in query blocks of 1,024. |
d1-omni-2b_decide_L6144_qb1024_fp16fc.tflite |
2,961,934,864 | Up to 6,144 tokens, attention in query blocks of 1,024. |
d1-omni-2b_decide_b8_L128_fp16fc.tflite |
2,934,942,096 | Eight sequences of up to 128 tokens in one call. |
d1-omni-2b_decide_multi8_fp16fc.tflite |
2,998,830,272 | The eight graphs above as eight signatures of one file, over one copy of the weights. |
d1-omni-2b_tower_G24x24_fp16fc.tflite |
377,915,232 | Picture tower and projector for a patch grid of up to 24 × 24. |
d1-omni-2b_tower_G32x48_fp16fc.tflite |
378,406,752 | Up to 32 × 48 patches (rows × columns). |
d1-omni-2b_tower_G48x32_fp16fc.tflite |
378,406,752 | Up to 48 × 32 patches. |
d1-omni-2b_tower_G48x64_fp16fc.tflite |
379,193,184 | Up to 48 × 64 patches. |
d1-omni-2b_tower_G64x48_fp16fc.tflite |
379,193,184 | Up to 64 × 48 patches. |
d1-omni-2b_tower_G72x96_qb1152_fp16fc.tflite |
381,219,856 | Up to 72 × 96 patches, attention in query blocks of 1,152. |
d1-omni-2b_tower_G96x72_qb1152_fp16fc.tflite |
381,219,856 | Up to 96 × 72 patches, attention in query blocks of 1,152. |
d1-omni-2b_audio_T504_fp16fc.tflite |
231,210,512 | Audio encoder and projector for a clip of up to 504 feature frames (5.055 s at 16 kHz). |
d1-omni-2b_audio_T1000_fp16fc.tflite |
231,351,376 | Up to 1,000 frames (10.015 s). |
d1-omni-2b_audio_T2000_fp16fc.tflite |
231,822,368 | Up to 2,000 frames (20.015 s). |
d1-omni-2b_audio_T3000_fp16fc.tflite |
232,543,376 | Up to 3,000 frames (30.015 s). |
tables/embed_table.npy |
524,288,128 | The tied token embedding as its bfloat16 bits (uint16), 128,000 × 2,048. The host writes its rows into the decision graphs and reads the answers against them. |
provider/ |
The source repository's files that the host reads, unchanged: 12 Python modules (8 imported, constants read from 4) and 6 data files, among them tokenizer.json. |
|
contract.json |
The interface as data: graph inputs and outputs, buckets, the mask, canvases, audio buckets, routing, and the size and SHA-256 of every graph. | |
host/ |
The Python host: d1_litert.py (load_host), d1_host.py (the provider's request handling ported to numpy), d1_audio_features.py (the provider's audio features in numpy), d1_batch_omni.py and b8_single_omni.py (the eight-sequence graph), multi8_omni.py, d1_layout.py (sees_q and sees_k), d1_pictures.py, d1_tokenizer.py, lrt_backend.py, and requirements-host.txt. |
|
examples/ |
run_example.py, the source card's examples, and run_example.expected.json, the provider's answers to them. |
|
npu/sm8850/ |
Four decision files compiled ahead of time for the NPU of the Qualcomm SM8850, the chip of the Galaxy S26: for sequences of up to 128, 256 and 512 tokens, and for eight sequences of up to 128 tokens (see Galaxy S26 NPU). | |
fixtures/ |
The test requests, the provider's answers to them, and the test pictures and clips (see Provenance). | |
conversion/ |
The export and check scripts, their environments, and a README with the commands in order. | |
REPRODUCE.md |
Sources, environments, steps, and where each number on this card comes from. | |
LICENSE, NOTICE, SHA256SUMS |
The LFM Open License v1.0 (the source repository's file), attribution, and the SHA-256 of every file. |
Each decision file holds the whole text decoder, from the embeddings to the final norm, with its own copy of the weights. A graph computes every position of its length whatever the sequence's length, so the host takes the smallest file that holds a sequence. load_host() (below) compiles only the files a request needs.
hf download litert-community/d1-Omni-2B-LiteRT --local-dir d1-Omni-2B-LiteRT
cd d1-Omni-2B-LiteRT
pip install -r host/requirements-host.txt
python examples/run_example.py --check # CPU (XNNPACK, 8 threads)
python examples/run_example.py --check --accel gpu # GPU at float32 precision (Metal on a Mac)
python examples/run_example.py --check --accel gpu --form multi8 # the eight-signature file
python examples/run_example.py --check --form multi8 --weight-cache multi8.xnnpack_cache # the same on the CPU
The host needs tokenizers, numpy, pillow and ai-edge-litert (2.3.0), pinned with their dependencies in host/requirements-host.txt. It does not need PyTorch or transformers. It was tested with Python 3.12.11 on macOS 27.0.
examples/run_example.py sends the source card's examples: the recording above, the ticket with three questions, the invoice with a text, a number, a date and an absent value, and the photo with a count, one box and every cat. Then it sends a state too long for the largest graph and a 31-second clip, which the host refuses. The photo (COCO val2017 000000039769.jpg, 640 × 480) is not in this repository: the script downloads it into memory and checks its SHA-256 before use. --check compares the answers with examples/run_example.expected.json, the provider's own answers in float32 on the CPU: probabilities, P(found) and P(yes) within 1e-4 (1e-3 for the recording), box edges within 0.002, box confidence within 0.02, and everything else equal (the picked options, texts, spans, numbers, dates, counts and token counts), and the two refusals. All four commands print CHECK PASS on the Apple M4 Max. On the CPU, --form multi8 needs --weight-cache: the first load writes the XNNPACK weight cache there (5,868,852,600 bytes) and later loads read it.
In your own code:
import sys
import numpy as np
sys.path.insert(0, "host") # run from the repository root
from d1_litert import load_host
rate = 16000
clip = np.random.default_rng(0).normal(0, 0.003, 4 * rate).astype(np.float32) # the recording above
for start in (0.5, 1.5, 2.5):
clip[int(start * rate):int(start * rate) + 3200] += 0.3 * np.sin(2 * np.pi * 880 * np.arange(3200) / rate)
questions = {
"beeps": {"type": "number", "instructions": "How many beeps are there?", "range": [0, 10], "step": 1},
"speech": {"type": "noul", "instructions": "Does someone speak in the recording?"},
}
with load_host(".", accelerator="cpu") as host: # accelerator="gpu": the GPU at float32 precision
out = host.system_one(None, questions, media=[{"type": "audio", "audio": clip, "sampling_rate": rate}])
print(out["answers"]["beeps"]["number"], round(out["answers"]["speech"]["noul"], 2), out["usage"])
It prints 3.0 0.07 {'input_tokens': 113, 'output_tokens': 0}.
system_one(state, questions, media=None) and system_one_batch([(state, questions, media), ...]) are the provider's calls. media lists pictures (PIL images, file paths or {"type": "image", "path": ...}) and clips ({"type": "audio", "audio": samples, "sampling_rate": rate}, or {"type": "audio", "path": ...} for a 16-bit PCM WAV or .npy file). A spoken question takes a clip as its instructions: {"type": "noul", "instructions": {"type": "audio", "path": "question.wav"}}. load_host() builds the host from the files that are present. With form="files" (the default) it compiles a decision file when a sequence first needs it and keeps at most keep of them compiled, closing the least recently used one; with form="multi8" it compiles the eight-signature file once. On the GPU it sets GpuOptions(enforce_f32=True), and for form="multi8" also constant_tensor_sharing=True.
contract.json holds these rules as data, and host/d1_host.py implements them with the provider's own code at the revision below.
prompt.py renders a request: the state and its media, then the questions, at most 16 to a sequence (the model's set_size); a request with more questions runs as several sequences over the same state. The tokenizer is the source repository's tokenizer.json, read with tokenizers.embeds float32 [1, L, 2048]: the rows of tables/embed_table.npy at the sequence's token ids, widened from bfloat16 to float32 (exact), the tower's and the audio encoder's tokens at the media positions, and zeros on the padding.sees_q and sees_k float32 [1, L, 66] say which positions see which: per position, whether it is in the state, and which question it belongs to. The 6 global-attention layers add (sees_q · sees_kᵀ − 1) · 30000 to their scores, which is the provider's set mask: the state sees the whole state and every question, and a question sees the state and itself. The 5 sliding-window layers (window 256) and the 13 convolution layers are causal, as in the provider's code.decide signature returns hidden float32 [1, L, 2048], the hidden states after the final norm. The positions are constants in the graph, from zero.parsing.py and calibration.py read the answers out: each answer slot's hidden state times the rows of the tied table for its option tokens, the provider's calibration temperature, and its pointer reads for spans and boxes.ValueError), never cut. A batch of at least 8 sequences of at most 128 tokens each runs on the eight-sequence graph, 8 sequences a call; any other sequence runs alone.host/d1_pictures.py: its patches go to the smallest tower canvas that holds its patch grid, and the tower's tokens take the picture's positions in the sequence.host/d1_audio_features.py (128 log-mel bands, a hop of 160 samples at 16 kHz): its frames go to the smallest audio file that holds them, and the encoder's tokens, one per 8 frames, take the clip's positions in the sequence. A clip of more than 3,000 frames is refused (ValueError), never cut.The reference is the provider's code at the revision below, in float32 on the CPU (transformers 5.19.0, torch 2.14.1). The text and picture test set has 529 requests: 523 that the reference answers and the host runs, five that the reference refuses, and one that the reference answers but no graph holds. They are the 526 requests of the test set of d1-2B-LiteRT (220 requests from the transfer-v4 development file of github.com/jaredpalmer/kev, 144 SemIf items, the examples of the d1-2B and d1-3B model cards, and requests written for these conversions, with text, pictures and the speed workloads below) and the source card's three text and picture examples. The audio test set has 68 requests: 67 that the reference answers and the host runs, and one clip that the reference answers but no audio file holds. Their clips are speech made with the Kokoro-82M text-to-speech model from scripts written for this conversion, synthetic sounds, and the source card's recording, used as states and as spoken questions. Eight control requests, six with text or pictures and two with audio, each change one fact of a test request, and must move the answer that the fact decides by more than 0.02: this shows that the checks see the input.
The tolerance, set before the runs: (a) for yes/no, choice and score questions, the same most likely option outside near ties, max |Δp| at most 0.02 and mean |Δp| at most 0.002; (b) for text, number and date reads, |ΔP(found)| at most 0.02, the same found side, span and value; (c) for estimates, the distribution within 0.02 (mean 0.002) and the same median, p10 and p90; (d) for boxes, P(found) within 0.02, edges within 0.002 and confidence within 0.02, and the same count; (e) every control request moves its answer by more than 0.02, as the reference's does.
| Files | Accelerator | Requests | (a) questions, max |Δp| | (b) reads, max |ΔP(found)| | (c) estimates, max |Δp| | (d) boxes, max edge / confidence | (e) controls |
|---|---|---|---|---|---|---|---|
| Single decision files, towers and audio files: text and pictures | CPU (XNNPACK, 8 threads) | 523 | 590, 1.25e-5 | 239, 3.3e-6 | 67, 4.5e-5 | 90, 0.0000 / 0.0004 | 6/6 |
| The same: audio | CPU (XNNPACK, 8 threads) | 67 | 188, 0.000193 | 38, 5.9e-5 | 39, 0.0019 | 5, 0.0000 / 0.0000 | 2/2 |
| Single files: text and pictures | Metal, float32 | 523 | 590, 1.21e-5 | 239, 3.3e-6 | 67, 3.3e-5 | 90, 0.0010 / 0.0004 | 6/6 |
| The same: audio | Metal, float32 | 67 | 188, 0.000197 | 38, 6.3e-5 | 39, 0.002 | 5, 0.0000 / 0.0000 | 2/2 |
| Eight-signature file, constant tensor sharing: text and pictures | Metal, float32 | 523 | 590, 1.32e-5 | 239, 4.7e-6 | 67, 3.5e-5 | 90, 0.0010 / 0.0004 | 6/6 |
| The same: audio | Metal, float32 | 67 | 188, 0.000198 | 38, 6.1e-5 | 39, 0.002 | 5, 0.0000 / 0.0000 | 2/2 |
| Eight-sequence file, 8 a call | Metal, float32 | 382 | 386, 7.98e-6 | — | — | — | 1/1 |
| Eight-signature file, eight-sequence graph | CPU | 382 | 386, 4.83e-6 | — | — | — | 1/1 |
Every question passed (a) to (e), and every near tie (two options within 0.02 of each other in the reference: 11 in the text and picture set, 2 in the audio set) kept its order on the CPU and on Metal at float32. The eight-sequence rows are the 382 requests of the text and picture set whose sequences fit 128 tokens. Box edges come in steps of 0.001, so an edge either equals the reference's or is one step away. On the CPU and on Metal with sharing, the eight-signature file's seven length graphs give, bit for bit, the outputs of a seven-signature file of the same graphs, and its eight-sequence graph the outputs of the eight-sequence file.
On the phones, the host on the Mac read the phones' outputs and scored them in the same way, on a device set of 43 text and picture requests and 12 audio requests with every kind of question:
| Phone | Files | Accelerator | Requests | (a) questions, max |Δp| | (b) reads | (c) estimates | (d) boxes, max edge | (e) controls |
|---|---|---|---|---|---|---|---|---|
| Pixel 11 Pro | Seven length graphs in one file, sharing: text and pictures | GPU, float32 | 43 | 59, 1.37e-5 | 42, 3.3e-6 | 19, 5.2e-5 | 40, 0.0000 | 6/6 |
| Pixel 11 Pro | The same: audio | GPU, float32 | 12 | 26, 4.48e-5 | — | 8, 0.002 | 5, 0.0000 | 2/2 |
| Pixel 11 Pro | Single files: text and pictures | CPU (XNNPACK, 4 threads) | 43 | 59, 1.28e-5 | 42, 1.3e-6 | 19, 4.6e-5 | 40, 0.0000 | 6/6 |
| Pixel 11 Pro | The same: audio | CPU (XNNPACK, 4 threads) | 12 | 26, 4.45e-5 | — | 8, 0.0019 | 5, 0.0000 | 2/2 |
| Pixel 11 Pro | Eight-signature file, eight-sequence graph | GPU, float32 | 64 | 64, 1.32e-6 | — | — | — | — |
| Galaxy S26 | NPU, 128-token file: text and pictures | NPU | 16 | 16, 0.00437 | — | — | — | — |
| Galaxy S26 | The same: audio | NPU | 1 | 1, 0.000113 | — | 1, 0.00083 | — | — |
| Galaxy S26 | NPU, 256-token file: text and pictures | NPU | 7 | 4, 0.0011 | 12, 0.00017 | 2, 1.6e-6 | — | — |
| Galaxy S26 | The same: audio | NPU | 4 | 7, 0.00334 | — | 3, 0.0084 | — | — |
| Galaxy S26 | NPU, 512-token file: text and pictures | NPU | 4 + 1 | 15, 0.00663 | 30, 0.0065 | 3, 0.0032 | — | — |
| Galaxy S26 | The same: audio | NPU | 4 | 16, 0.00622 | — | 1, 3.5e-6 | — | — |
| Galaxy S26 | NPU eight-sequence file | NPU | 64 | 64, 0.011 | — | — | — | — |
| Galaxy S26 | d1-omni-2b_decide_b8_L128_fp16fc.tflite, sharing |
GPU, float32 | 64 | 64, 1.12e-6 | — | — | — | — |
Every question on the phones passed (a) to (e) on the questions that its row holds. On the Pixel 11 Pro's GPU, the 16 sequences of 128 tokens gave the same output bytes on the eight-signature file as on the seven-signature file that the rows above ran on. The 64 requests are the 64-states workload below. On the Galaxy S26's NPU, each decision file was scored on the requests of the device set whose sequences it holds, with the Pixel 11 Pro GPU's tower and audio encoder outputs for the media; the + 1 of the 512-token text and picture row is a request that also has a longer sequence, which ran on the 1,024-token NPU file. The NPU runs the graphs in float16. The 1,024-token NPU file is not in this repository: on the phone it moved one box edge of one picture request by 0.007 (0.353 against the reference's 0.346; the tolerance is 0.002), the same in repeated runs. On the Galaxy S26's GPU, the outputs for the tower, the audio encoder and the 128-token file also matched the Mac's Metal run of the same inputs (see Android).
An Apple M4 Max (macOS 27.0), ai-edge-litert 2.3.0 through the Python CompiledModel API. A time is the median of 20 requests after 5 warm-up requests, through the host from the request to the answers: preprocessing, the clip's features, every graph call (writing the inputs, running, reading the whole output back) and the read-out. The workloads are those of the source card's speed table, on the source card's requests where it has them.
| Request | Files | Metal, float32 | CPU, 8 threads |
|---|---|---|---|
One question (the card's ticket and refund, 43 tokens) |
L128 | 40.9 ms | 154.2 ms |
3 questions (the same ticket and state: refund, team, urgency) |
L128 | 41.0 ms | 150.4 ms |
| 5K-token state and 1 question | L6144 | 1,957.5 ms | 6,751.8 ms |
| 384 px picture and 1 question | tower G24x24, L256 | 93.5 ms | 352.8 ms |
| 10 s audio clip and 1 question (no state) | audio T1000, L256 | 89.0 ms | 302.1 ms |
| 64 states in one call (64 tickets, one question each) | eight-sequence file, 8 calls | 1,992.8 ms | 7,591.7 ms |
The 64 states take 1,992.8 ms in one call on Metal, 32.1 states a second. Compiling a decision file on Metal at float32 took 12.51 to 20.23 s, the 24 × 24 tower file 2.70 s and the 1,000-frame audio file 1.36 s, once per process.
On the GPU, a test app ran the graph files through the Kotlin CompiledModel API of LiteRT 2.2.0. On the Galaxy S26's NPU, a test runner on the C API of LiteRT 2.2.0 ran the NPU files, outside the app. Both ran on inputs that the host wrote on the Mac and time one graph call the same way: writing the inputs, running and reading the output back. A time is the median of 10 calls after 2 warm-up calls in the app (a tower or audio file: 20 after 5; the 64 states: the median of 2 requests after 1), and the median of 20 calls after 5 in the runner (the 64 states: the median of 3 requests after 1). The host's own work, which ran on the Mac, is not included: for a clip, its features. A picture or a clip is two calls, the tower or the audio encoder and then the decision graph, timed apart and added up; on the Galaxy S26 the tower and the audio encoder ran on the GPU, in the app.
| Request | Pixel 11 Pro, GPU (float32) | Galaxy S26, NPU (tower and audio: GPU, float32) |
|---|---|---|
| Load (compile) | 26.1 s, all eight signatures | 1.0 to 2.1 s, the L128 file |
| One question | 733.6 ms | 67.0 ms |
| 3 questions | 735.3 ms | 68.0 ms |
| 384 px picture and 1 question | 1,320.8 ms (278.1 + 1,042.7) | 218.6 ms (112.3 + 106.3) |
| 10 s audio clip and 1 question | 1,111.9 ms (85.1 + 1,026.8) | 131.6 ms (25.9 + 105.7) |
| 5K-token state and 1 question | 32.9 s, one call | not run (see Galaxy S26 NPU) |
| 64 states in one call | 39.2 s (8 calls) | 4.8 s (8 calls) |
On the Pixel 11 Pro, the decision call of the audio clip (the median of 6 calls after 5) and the 5K-token state (one call) were timed in a check run, on a file of the seven length graphs with sharing, which gives the same outputs as the eight-signature file (see Measured agreement). The eight-signature file's own timing run of these two requests, with the phone hotter, took 1,067.2 ms and 45.9 s a call. In the Pixel 11 Pro's 64-states run the phone heated up (Android's thermal status rose from 0 to 2), which the time includes. The Pixel 11 Pro's CPU passed the checks above; this table leaves out its times, which come mostly from those check runs, and the Galaxy S26's CPU did not run these files. On the Galaxy S26, the NPU load creates the compiled model from the file (four runs of the L128 file). Its GPU at float32 loaded the L128 file in 28.8 s and took 365.3 ms for one question.
The files that run best differ by device. The host picks the GPU and CPU files by form= and accelerator=; it does not run the NPU files:
form="multi8". One compile of 26.1 s loads all eight graphs over one copy of the weights, so every request shape is ready after one load. The tower and audio files run as single files.npu/sm8850/, see Galaxy S26 NPU), with the tower and audio files on the GPU at float32. On its GPU, the eight-signature file and the 6,144-token file were not run: the files of the same graphs in d1-2B-LiteRT, which differ in their weights only, did not load there, because during the compile the phone's available memory fell under the 1,500,000 kB at which our test stops a run. On its GPU, the decision files of the timed requests loaded in 21.6 to 31.0 s each, the tower file in 1.6 s and the audio file in 1.3 s. Against the Mac's Metal run of the same inputs, the GPU's largest differences were 2.0e-5 for the tower, 7.3e-7 for the audio encoder, 1.08e-4 for the 128-token file and 2.02e-4 for the eight-sequence file.Both phones ran the GPU through LiteRT's OpenCL backend at float32, and the Galaxy S26 its NPU through LiteRT's dispatch delegate, one node holding the whole graph. The Pixel 11 Pro ran Android 17 (API level 37); the Galaxy S26 (SM-S942Q) Android 16 (API level 36). This repository has no Android host: an app needs the steps of the host contract above, in its own language, and the clip's features.
npu/sm8850/ holds four decision files compiled ahead of time for the NPU of the Qualcomm SM8850 with ai-edge-litert 2.2.0 and Qualcomm's QAIRT 2.47 (conversion/npu/): for sequences of up to 128, 256 and 512 tokens, and the eight-sequence file. These are the files that ran on the Galaxy S26, with the SHA-256 that the phone read:
| File | Bytes | SHA-256 |
|---|---|---|
d1-omni-2b_decide_L128_fp16fc_SM8850.tflite |
2,970,355,376 | f7d29aa961ed15bce5e3c5141ed608d5eace85c30f141c57502bf697290f9901 |
d1-omni-2b_decide_L256_fp16fc_SM8850.tflite |
2,976,356,016 | ed4fbb447c93e619df79a697df79a1f560b1b2eba092c2575c9590313e012071 |
d1-omni-2b_decide_L512_fp16fc_SM8850.tflite |
3,000,534,704 | 5ccb7e3fe8ea5381264338a45589b6e36b548618ecb0c53473df7db5b101549f |
d1-omni-2b_decide_b8_L128_fp16fc_SM8850.tflite |
3,087,439,584 | d76bae81d96c36ce186c1a455f290cfc7569e2df80103dbc3d1bbf36e6b911ac |
Each file is one dispatch operator that holds the whole graph, and the phone ran every node on the NPU, in float16. The agreement and the times are in Measured agreement and speed above. The 1,024-token file compiled too, but is not in this repository: on the phone it moved one box edge outside the tolerance (see Measured agreement). The longer files were not run on this NPU: the 2,048-token file compiles with the same memory estimates as the file of the same graph in d1-2B-LiteRT, whose context the Galaxy S26 refused to create (QNN error 1002, for a context it estimated at 3,883,471,104 bytes, more than one compute-DSP session holds), and the 4,096- and 6,144-token files were not compiled, after the d1-2B 4,096-token file did not compile within 32 GiB of memory. So on the Galaxy S26 a sequence of more than 512 tokens needs the GPU, and the 5K-token state was not run on this phone (see Android).
The host of this repository does not run these files. On the Galaxy S26, a test runner on the C API of LiteRT 2.2.0, outside an app, loaded each into a CompiledModel with the NPU accelerator and Qualcomm's dispatch library (libLiteRtDispatch_Qualcomm.so), and ran it on inputs laid out on the Mac by the scripts of this repository: the times and the agreement above come from that runner. An Android app loads them the same way, through LiteRT's CompiledModel with the NPU accelerator and that dispatch library; no app ran them in these checks.
Run the GPU at float32 precision: the host sets GpuOptions(enforce_f32=True) for accelerator="gpu". At the Metal GPU's default precision (float16), the answers move outside the tolerance: on text and pictures, max |Δp| 0.199 on the questions with 5 near ties changing order, |ΔP(found)| 0.027 on the reads, 0.55 on the estimates with three estimate questions failing, and up to 0.31 on box edges and 0.53 on box confidence; with audio, max |Δp| 0.0363 and two estimate questions failing.
.npy files.NotImplementedError).form="multi8" needs a weight cache file (5,868,852,600 bytes).LiquidAI/d1-Omni-2B at revision 431f1d667de5afcc9b0c58b2d9c170a7b38b358b. Base: LiquidAI/LFM3-Omni-2B. Both are licensed under the LFM Open License v1.0.modeling_lfm3.py) written out in plain PyTorch for export, with the set attention mask built inside the graph from sees_q and sees_k, exported with litert-torch 0.10.0 from the weights in float32 (transformers 5.14.1, torch 2.14.1), then quantized with ai-edge-quantizer 0.10.0: the decoder's 153 weight matrices are stored in float16 and read through DEQUANTIZE operators, and activations stay in float32. A decision graph has 2,062 to 2,456 operators. None is CUSTOM, no tensor is int64, and no tensor has a rank above 4.conversion/ holds the export and check scripts, with their environments and a README of the commands. REPRODUCE.md lists the sources, the steps and where each number comes from. One file of each kind, rebuilt on 2026-11-02 from a clean copy of these scripts, has the same SHA-256 as the shipped file.fixtures/ holds the test requests, the provider's answers, and the test pictures and clips. The SemIf records (MIT, fixtures/LICENSE-SemIf-MIT.txt), the examples of the d1-2B, d1-3B and d1-Omni-2B model cards and the requests written for these conversions are included with their text. The 223 requests made from the transfer-v4 development file of github.com/jaredpalmer/kev (220 of its lines and 3 requests made from them) quote public datasets under their own licenses, so they are listed by reference, and fixtures/rebuild_requests.py restores them from that file at tag kev-1.0. The pictures are 5 CC0 photographs from Wikimedia Commons and 18 synthetic pictures, and the clips 59 speech clips made with hexgrad/Kokoro-82M (Apache-2.0) from texts written for this set and 15 synthetic sounds, as WAV files; the COCO photo is listed by URL and SHA-256, and examples/run_example.py makes the card's recording.License: d1-Omni-2B and LFM3-Omni-2B are licensed under the LFM Open License v1.0 (LICENSE, a copy of the source repository's file). This repository is released under the same license, except the SemIf fixture records (MIT). Note the license's limit on commercial use by organizations with annual revenue of US$10 million or more. Attribution is in NOTICE.
Changes from the original work. The weights were converted from the checkpoint's safetensors (bfloat16) to LiteRT flatbuffers: float16 FULLY_CONNECTED weights, float32 for the rest. The decision model was split into graphs of fixed lengths, an eight-sequence graph and a file that holds them all, with the attention mask built inside the graph from two position tables. The picture and audio encoders were split into graphs of fixed canvases and lengths. The embedding table ships separately and the host writes its rows. The tokenizer and the provider's request code are unchanged. The host ports the rest of the provider's request handling, picture preprocessing and audio features to numpy. This repository is not affiliated with Liquid AI.
有文件?提交种子。
发布种子LiquidAI/d1-Omni-2B