Run this model with HF Jobs

Run litert-community/sarashina2.2-0.5b-instruct-v0.1 on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.

Paste one of these prompts into your coding agent:

Fine-tune on my dataset

Use HF Jobs to fine-tune https://huggingface.co/litert-community/sarashina2.2-0.5b-instruct-v0.1. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.

Run batch inference

Use HF Jobs to run batch inference with https://huggingface.co/litert-community/sarashina2.2-0.5b-instruct-v0.1 on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.

Evaluate on a benchmark

Use HF Jobs to evaluate https://huggingface.co/litert-community/sarashina2.2-0.5b-instruct-v0.1. Ask me which benchmark to run, then save the scores and the per-example results to a new dataset repo. Run `hf jobs --help` first to learn the CLI.

Measured on device (edge-compat, sarashina2.2-0.5b-instruct-v0.1-int4): Galaxy S26 · LiteRT-LM 0.16.0 · GPU · decode 40.3 tok/s · prefill 903 tok/s · TTFT 380 ms · all 1066 ops delegated (2026-09-02); Mac Studio M4 Max · LiteRT-LM 0.16.0 · GPU · decode 197.8 tok/s · prefill 5754 tok/s · TTFT 58 ms (2026-09-02); Galaxy S26 · LiteRT-LM 0.16.0 · CPU · decode 19.5 tok/s · prefill 133 tok/s · TTFT 2.47 s (2026-09-02). Record: https://github.com/john-rocky/edge-compat/blob/main/cards/sarashina2.2-0.5b-instruct-v0.1-int4/CARD.md

Measured on device (edge-compat, sarashina2.2-0.5b-instruct-v0.1-int8): Galaxy S26 · LiteRT-LM 0.16.0 · GPU · decode 36.5 tok/s · prefill 895 tok/s · TTFT 390 ms · all 1066 ops delegated (2026-09-02); Pixel 8a · LiteRT-LM 0.16.0 · GPU · decode 16.8 tok/s · prefill 297 tok/s · TTFT 1.14 s · all 1066 ops delegated (2026-09-05); Mac Studio M4 Max · LiteRT-LM 0.16.0 · GPU · decode 197.1 tok/s · prefill 5722 tok/s · TTFT 58 ms (2026-09-02). Record: https://github.com/john-rocky/edge-compat/blob/main/cards/sarashina2.2-0.5b-instruct-v0.1-int8/CARD.md

sarashina2.2-0.5b-instruct-v0.1 — LiteRT-LM

Try it in your browser: the LiteRT-LM Web chat demo loads sarashina2.2-0.5b-instruct-v0.1_int4.litertlm (535 MB download) and runs it with WebGPU. sarashina2.2 is tuned for Japanese, so ask in Japanese: in the demo the same question got the right answer in Japanese and nonsense in English.

sbintuitions/sarashina2.2-0.5b-instruct-v0.1(SB Intuitions の日本語 LLM)を、Google の LiteRT-LM ランタイム用 .litertlm 形式に変換したものです。スマートフォン・PC の CPU / GPU 上で、ネット接続なしに日本語チャットが動きます。動作確認は litert-lm 0.16.x で行いました。

sarashina2.2 は SB Intuitions が日本語向けに事前学習・指示学習した Llama 型の密モデル(24 層・hidden 1280・GQA 16:8・語彙 102,400(untied))で、思考(reasoning)チャネルを持たない汎用チャットモデルです。公式カードの日本語ベンチマークは Elyza-tasks-100 2.38 / Japanese MT Bench 4.55。ライセンスは MIT。

ファイル 量子化 サイズ
sarashina2.2-0.5b-instruct-v0.1_int8.litertlm int8 dynamic(線形層 + 埋め込み) 871 MB
sarashina2.2-0.5b-instruct-v0.1_int4.litertlm int4 blockwise-32 + OCTAV(線形層)、埋め込みは int8 534 MB

まず int8 を推奨します。 bf16 に最も近く(JCQA 62 vs bf16 65、int4 65 — いずれも対応差 4 問前後の誤差内)、下の実測では Galaxy S26 でも Mac でも int4 より遅くなりません。語彙 102,400 の埋め込みと出力層が重く、このサイズでは線形層を int4 にしても速度が出ないためです。int4 はファイルが約 39% 小さく(534 MB)、容量が制約のときの選択肢です。

動作確認

  • Mac 8 問チェック(Apple M4 Max、litert-lm 0.16 系、1 問 1 プロセス、greedy): 英語 8 問 = int8 CPU 7/8 / GPU 6/8、int4 CPU 6/8 / GPU 6/8。日本語 8 問(同じ 8 検査を日本語で: 計算・首都・反対語・曜日数・英訳・掛け算・小数比較・富士山の県)= int8 CPU 7/8 / GPU 7/8、int4 CPU 8/8 / GPU 8/8。bf16 の PyTorch 参照は英語 6/8 / 日本語 8/8 — 英語の取りこぼしは元モデル由来です(bf16 も「merci」と韻の問題を外します)。いずれの実行でも反復・特殊トークン垂れ流しなし。
  • 絵文字・異体字のストリーミング: 「😀」「𠮷」「☔」を含む文を復唱させ、1 トークンずつのデコードで U+FFFD(文字化け)が出ないことを全 4 通りの実行で確認(この語彙は絵文字を 4 個のバイトトークンに分けるため、逐次デコードの検査が要ります)。
  • トークナイザ一致: 埋め込んだ HF tokenizer.json をエンジン側で tokenize し、HF 側と 7 種のテスト文字列(特殊トークン文字列・日本語・混在・絵文字/異体字・Latin-1・空白・①㈱〒)で ID 列が完全一致。
  • マルチターン(3 ターン日本語、python API、greedy): 4 バンドル全てで空応答・特殊トークン漏れなし。
  • Galaxy S26(SM-S942Q、Adreno、litert_lm_advanced_main v0.16.0 リリースキット): 日本語プロンプト「日本の首都はどこですか?」に GPU / CPU の両方で「東京」と回答。GPU は全 11 の prefill signature と decode グラフが LITERT_CL に完全委譲(prefill_2〜1024 は 1066/1066 ノード、prefill_1 は 947/947、decode は 975/975、XNNPack への差し戻しゼロ)。

精度 — JCommonsenseQA(JGLUE v1.3 valid、先頭 100 問、greedy)

質問と 5 択を提示し「選択肢の文字列だけを答えよ」とした自前ハーネスの数字です(正解文字列が含まれ、かつ他の選択肢が先に出ていなければ正解)。このハーネス内でのみ比較可能で、公表されている JGLUE スコアとは比べられません。

構成 正解数
PyTorch bf16(参照、MPS) 65/100
LiteRT int8(CPU) 62/100
LiteRT int4 block-32(CPU) 65/100

使い方

litert-lm run ./sarashina2.2-0.5b-instruct-v0.1_int8.litertlm --prompt "日本の首都はどこですか? 簡潔に答えてください。"

# GPU
litert-lm run ./sarashina2.2-0.5b-instruct-v0.1_int8.litertlm --backend gpu --cache no --prompt "海について一文で書いてください。"

バンドルはモデル公式のチャット書式(<|user|>…</s><|assistant|>…</s>、system は <|system|>…</s>)を構造化テンプレートとして内蔵し、停止トークン </s>(id 2)を宣言しています。KV キャッシュ上限 4096 トークン、prefill signature は 1〜1024 の 11 段。

Android: Google AI Edge Gallery にこのリポジトリをインポート(またはファイルを端末に置いてローカルインポート)して、日本語で会話できます。

性能

Galaxy S26(SM-S942Q、Adreno GPU、litert_lm_advanced_main = litert-lm v0.16.0 リリースキット、321 トークンのプロンプト + --benchmark、各条件 2 回、範囲表示):

ファイル バックエンド Prefill(321) Decode TTFT ピーク RSS
int8 GPU(OpenCL) 862–895 tok/s 36.2–36.5 tok/s 0.39–0.40 s 848–849 MiB
int8 CPU 295–349 tok/s 20.1–21.0 tok/s 0.97–1.14 s 1623–1625 MiB
int4 GPU(OpenCL) 661–903 tok/s 31.8–40.3 tok/s 0.38–0.52 s 882–883 MiB
int4 CPU 133–135 tok/s 18.8–19.5 tok/s 2.44–2.47 s 1316–1400 MiB

Apple M4 Max(litert-lm benchmark 0.16.0、-p 256 -d 256 --runs 3 --cache no、待機状態のマシン、GPU の計測は 300 秒休止後):

ファイル バックエンド Prefill(256) Decode TTFT
int8 GPU 5722 tok/s 197.1 tok/s 0.058 s
int8 CPU 1029 tok/s 47.0 tok/s 0.530 s
int4 GPU 5754 tok/s 197.8 tok/s 0.058 s
int4 CPU 546 tok/s 42.7 tok/s 0.565 s

iPhone 17 Pro の実測行は、BenchmarkApp(128 トークン、コールドスタート)で取得でき次第この節に追記します。アーキテクチャは素の Llama(attention のみ)で、iOS 固有の壁(単一セクション 2 GiB の mmap 上限)より十分小さいファイルです。

同じ端末・同じランタイムでの LFM2.5-230M(語彙 65k、tied)の decode は S26 GPU で 122 tok/s でした。sarashina2.2 が遅いのは語彙 102,400 が untied で、埋め込み + 出力層だけで 262M パラメータあり、1 トークンごとにその出力層を読むためです。

変換メモ

litert-torch 0.9.3 / transformers 5.14.1 / ai-edge-quantizer のリリース版のみで変換しました(再現スクリプト: hf-to-litertlm)。

  • トークナイザは vendor の tokenizer.model ではなく HF tokenizer.json を埋め込んでいます。 sarashina の SentencePiece モデルは <|user|> <|assistant|> <|system|> </s> を CONTROL 片として持ち、素の sentencepiece は CONTROL 片を文字列から一致させません(<|user|> が < | user | > の 5 片になる)。HF fast tokenizer は added token として 1 ID に一致させます。
  • BOS を前置しません。 tokenizer_config は add_bos_token: false で公式テンプレートも <s> を出しませんが、exporter は bos_token から start_token を書いてしまいます。bf16 で同じプロンプトに <s> を付けると 0.5b は 8 問チェックを英語 6→5、日本語 8→7 に落としたため、バンドルには start_token を入れていません。
  • チャットテンプレートは公式 jinja と同じ文字列を出す構造化 prefix/suffix(system / user / assistant)。tool-calling 分岐は含みません。
  • 量子化は export 時(int8 = dynamic_wi8_afp32、int4 = blockwise-32 + OCTAV、埋め込み int8)。後処理なし。

Known runtime issues

External weights (since 2026-10-30). In sarashina2.2-0.5b-instruct-v0.1_int4.litertlm and sarashina2.2-0.5b-instruct-v0.1_int8.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 files with the weights inside the graph stay at revision 12bc001.

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: these files carry </s> with each of 13 characters in front (12 punctuation marks and a space) as stop sequences next to </s> alone, so the runtime holds the mark back to see whether </s> follows, and when the answer ends there the held mark is never written. From LiteRT-LM 0.17.0 on (read in the source of 0.17.0 to 0.18.1) sarashina2.2-0.5b-instruct-v0.1_int4.litertlm still drops 12 of the 13 marks and keeps only ;, and sarashina2.2-0.5b-instruct-v0.1_int8.litertlm drops all 13: the mark and </s> complete two stop sequences at the same token, </s> alone and the one with the mark, the runtime records the one that comes later in the file's stop list (for </s> alone, its first entry when the file lists it twice), and it writes the held mark only when that is </s> alone. Not measured on these files: this follows from the runtime's source read with these files' stop list and tokenizer; the drop on releases before 0.17.0 was seen with LiteRT-LM 0.16.1 on a Galaxy S26, on another bundle with punctuated stop sequences.

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.

ライセンスと変更点

元モデルと同じ MIT License(Copyright (c) 2025 SB Intuitions)で配布します。元モデルからの変更点: safetensors bf16 の重みを LiteRT flatbuffer に変換し上記のとおり量子化、トークナイザとチャット書式を .litertlm に同梱。学習・微調整は行っていません。元モデルの制限(安全性学習が限定的である旨)はそのまま当てはまります。


sarashina2.2-0.5b-instruct-v0.1 — LiteRT-LM (English)

sbintuitions/sarashina2.2-0.5b-instruct-v0.1 (SB Intuitions' Japanese LLM) converted to the LiteRT-LM (.litertlm) format for on-device inference with Google's LiteRT-LM runtime. Tested on litert-lm 0.16.x. A plain Llama-architecture dense model (24 layers, hidden 1280, GQA 16:8, 102,400-entry untied vocab), Japanese-first, non-thinking; MIT license.

File Recipe Size
sarashina2.2-0.5b-instruct-v0.1_int8.litertlm int8 dynamic on linears + embedding 871 MB
sarashina2.2-0.5b-instruct-v0.1_int4.litertlm int4 blockwise-32 + OCTAV on linears, int8 embedding 534 MB

int8 is the recommended file — closest to bf16 (JCQA 62 vs bf16 65; int4 65 — all within a few paired flips), and on both the Galaxy S26 and the Mac it is not slower than int4 on either backend: the 102,400-entry untied vocab makes the embedding + lm_head the dominant per-token cost at this size. int4 is ~39% smaller (534 MB).

Correctness. 8-question sanity check (Apple M4 Max, litert-lm 0.16 lineage): English int8 CPU 7/8 / GPU 6/8, int4 CPU 6/8 / GPU 6/8; the same 8 checks in Japanese int8 CPU 7/8 / GPU 7/8, int4 CPU 8/8 / GPU 8/8; bf16 reference English 6/8 / Japanese 8/8 (the English misses are the checkpoint's own). No degeneration in any run. Emoji / rare-kanji streaming check (😀 𠮷 ☔): no U+FFFD in any run. Engine-vs-HF tokenizer parity: identical ids on 7 test strings. 3-turn Japanese multi-turn: pass on all four bundles. Galaxy S26: both files answer a Japanese capital question correctly on GPU and CPU, with full OpenCL delegation (every node of all 11 prefill signatures and the decode graph on LITERT_CL: 1066/1066 for prefill_2–1024, 947/947 for prefill_1, 975/975 for decode; zero XNNPack fallback).

Accuracy — JCommonsenseQA (JGLUE v1.3 valid, first 100, greedy, own harness; comparable only within this table): bf16 65/100 · int8 62/100 · int4 65/100.

Usage. litert-lm run ./sarashina2.2-0.5b-instruct-v0.1_int8.litertlm --prompt "…" (add --backend gpu --cache no for the GPU). The bundle embeds the model's own chat markup (<|user|>…</s><|assistant|>) as structured prompt templates and declares stop </s>; KV budget 4096, prefill signatures 1–1024. Android: import into Google AI Edge Gallery.

Performance — see the Japanese tables above (Galaxy S26 rows from litert_lm_advanced_main, v0.16.0 release kit, 321-token prompt, 2 runs; Mac rows from litert-lm benchmark -p 256 -d 256 --runs 3 --cache no; iPhone 17 Pro rows will be appended once measured).

Conversion notes. Released litert-torch 0.9.3 / transformers 5.14.1 wheels; reproduction in hf-to-litertlm. The bundle embeds the HF tokenizer.json rather than the vendor tokenizer.model (sarashina's SentencePiece model types every chat special as CONTROL, which a bare sentencepiece encoder never matches from text — <|user|> would become 5 pieces). No start_token is written: add_bos_token is false and the official template emits no <s>; prepending one measurably hurts the 0.5b in bf16 (English 6→5, Japanese 8→7 on the 8-question check). Quantization at export time, no post-processing.

License and changes. MIT (inherited; Copyright (c) 2025 SB Intuitions). Changes from the original work: weights converted from safetensors bf16 to LiteRT flatbuffers and quantized as described; tokenizer and chat markup repackaged into the .litertlm. No training or fine-tuning.

Downloads last month
443
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for litert-community/sarashina2.2-0.5b-instruct-v0.1

Collection including litert-community/sarashina2.2-0.5b-instruct-v0.1