sentence-similarity · feature-extraction · text · WASM q8 · ~43.78 MB · Apache-2.0
Ruri v3 30M — Japanese ModernBERT Embeddings
Nagoya University's cl-nagoya/ruri-v3-30m (37M parameters, 256-d, 8,192-token RoPE
context, 102,400 SentencePiece vocabulary) running completely off-thread in your browser on CPU WASM
via onnx-community/ruri-v3-30m-ONNX.
At a glance
- Upstream model
- cl-nagoya/ruri-v3-30m
- ONNX graph loaded
- onnx-community/ruri-v3-30m-ONNX
- Task & pooling
sentence-similarity/feature-extraction· mean pool + L2 norm- Architecture
- ModernBERT-Ja · 10 layers · 4 heads · 256-d · 37M params (10M non-emb)
- Context & tokenizer
- 8,192 tokens (local 128 + global RoPE) · 102,400 SentencePiece vocab
- Runtime & dtype
- Shared Transformers.js 3.7.5 · CPU
WASM·q8 - Download size
- ~43.78 MB (37.05 MB ONNX + 6.73 MB tokenizer/config)
- License
- Apache-2.0 (
apache-2.0)
1 · On-device Model & Cache
2 · Live Japanese Semantic Similarity & 1+3 Prefix Switcher
Ruri v3 uses a 1+3 prefix scheme: "" (bare STS), "トピック: "
(topic / classification), "検索クエリ: " (retrieval query), and "検索文書: "
(retrieval passage). Switch prefixes below or load the official card example to measure live cosine separation.
.txt, .md, .csv, or .json corpus, paste with
Ctrl/Cmd+V, or upload:
3 · See Inside — Cosine Heatmap & 256-d Embedding Inspector
Pairwise cosine matrix across the query (Q) and every document (D1…Dn), plus the
256-dimensional unit-normalised query vector. Pre-norm shows the raw mean-pooled magnitude before L2 division.
Pairwise Cosine Heatmap (Q + Documents)
| Run inference above to populate the similarity matrix. |
256-d Query Vector & Norm Diagnostics
4 · Why Ruri v3 30M Matters
-
Zero-server Japanese semantic search: At just
43.78 MBtotal download (37.05 MBINT8 ONNX +6.73 MBSentencePiece tokenizer), confidential Japanese manuals, tickets, and notes never leave the browser. -
No external morphological analyzer: Unlike older Japanese BERT embedders that needed MeCab
or Sudachi pre-tokenization, Ruri v3's
102,400-token SentencePiece vocabulary runs natively inside Transformers.js. - 8,192-token ModernBERT-Ja context: Alternating local (128-token) and global RoPE attention lets whole multi-section Japanese specifications embed without chopping off trailing clauses.
Explore the Use-Case Ladder
5 · How the API Works & Source Inspection
Because onnx-community/ruri-v3-30m-ONNX ships the ONNX graph and config.json
without tokenizer.json, the worker pairs AutoTokenizer from
cl-nagoya/ruri-v3-30m with AutoModel from
onnx-community/ruri-v3-30m-ONNX, then mean-pools last_hidden_state and L2-normalises.
import { AutoTokenizer, AutoModel } from "@huggingface/transformers";
const tokenizer = await AutoTokenizer.from_pretrained("cl-nagoya/ruri-v3-30m");
const model = await AutoModel.from_pretrained("onnx-community/ruri-v3-30m-ONNX", {
device: "wasm",
dtype: "q8",
});
const inputs = tokenizer("検索クエリ: 瑠璃色はどんな色?", { padding: false, truncation: true, max_length: 2048 });
const out = await model(inputs); // out.last_hidden_state: [1, seq, 256]