Downloads · 30 days
0
Tdamre/Nanbeige4.2-3B-LiteRT
Nanbeige4.2-3B-LiteRT is a text generation model from Tdamre. Use it when you need the model to write or continue text. It is set up for litert. The card lists the license as apache-2.0.
Unofficial LiteRT-LM conversion of Nanbeige/Nanbeige4.2-3B, pinned to source revision 451ed48c3273ecef7ea8faaa43c31ce529763bb1.
Downloads · 30 days
0
Access
Public
Updated Jul 24, 2026
Repo size
8.4 GB
Likes
3
Public
Click a slice to open those files.
.litertlm8.4 GB · 100%
From the Hugging Face model README
Unofficial LiteRT-LM conversion of
Nanbeige/Nanbeige4.2-3B,
pinned to source revision
451ed48c3273ecef7ea8faaa43c31ce529763bb1.
The bundle preserves Nanbeige's exact two-loop execution over 22 shared physical decoder layers, including midpoint RMSNorm and 44 logical KV-cache slots. It was exported with the official LiteRT Torch and LiteRT-LM tooling.
| File | Size | SHA-256 |
|---|---|---|
Nanbeige4.2-3B-dynamic-wi8-afp32-4096.litertlm | 4,203,134,832 bytes | 95ff2dd6b9754ff60d2caec6e7fb76f4b2562ba841e7cb364ea8ad6f2e8e8628 |
Nanbeige4.2-3B-dynamic-wi8-afp32-65536.litertlm | 4,202,541,136 bytes | 9fe2a544c4a931e2aae049e64fa4abaa27e6fac47ee03dd3feedfad3b9f0e6e8 |
Bundle details:
prefill_128 and decodetf_lite_prefill_decodeThe 4K file is the mobile-oriented default. The 64K file uses a dynamic cache
dimension in all 88 K/V inputs for both signatures. Its 1,024-token export
shape is only a trace/example size: prefill_128 keeps the 128-token compute
chunk fixed while the cache and attention-mask widths resize dynamically.
The package metadata caps the runtime at 65,536 tokens.
At the full cap, FP32 K/V state alone is approximately 23.6 GB (22 GiB), before model weights, output-cache tensors, and runtime workspace. Most mobile devices cannot allocate that. Select a context limit appropriate for the target device; the 64K artifact is intended for high-memory runtimes.
The tested conversion used:
litert-torch-nightly==0.10.0.dev20260722ai-edge-litert-nightly==2.2.0.dev20260721ai-edge-quantizer-nightly==0.9.0.dev20260722litert-lm-builder==0.14.0e72a9a2ea3bb8e33b6faff6002744c55472e3600modeling_nanbeige-litert.patch contains the compatibility adapter for the
custom Transformers model. export_nanbeige_litert.py contains the exact
4,096/128 export recipe. export_nanbeige_litert_64k.py adds dynamic prefill
and decode cache axes, the 65,536-token metadata cap, and the 44-slot cache
factory.
python export_nanbeige_litert.py
python export_nanbeige_litert_64k.py
litert-lm-peek \
--litertlm_file Nanbeige4.2-3B-dynamic-wi8-afp32-65536.litertlm
The package was inspected successfully with litert-lm-peek. The extracted
quantized graph was then executed with LiteRT built-in CPU kernels on an AMD
Ryzen 9 7950X3D:
prefill_128 completed in 201.05 seconds.[1, 1, 166144].The included validate_nanbeige_litert.py reproduces this test.
The 64K package was additionally validated beyond its 1,024-token trace
window with validate_nanbeige_litert_64k.py:
max_num_tokens: 65536.prefill_128 and decode report dynamic cache/mask axes.[1, 1, 166144] and range
[-12.451786, 19.707262].[1, 8, 1025, 128].The full 65,536-token allocation was not executed locally because the cache state plus duplicated input/output tensors and runtime workspace exceed the practical memory budget of the test machine. The beyond-trace execution, dynamic signatures, and embedded 65,536 metadata were all verified.
This card reports those findings deliberately; it does not claim upstream LiteRT-LM certification.
The base model is Apache-2.0 licensed. Review the upstream model card for its full terms and intended-use information.