日本語 | English
EXLLM for EX-wordは、小型日本語モデル「EXLLM 5M」をCASIO EX-word上でオフライン実行するhomebrewアプリです。キーボード入力、トークン単位の逐次表示、Thinkingモード、スクリーンショット、性能ログ、本体・microSD由来モデルの選択に対応します。
LLMとは、Little Language Modelの略です。
現行版はv1.3.1です。
exword-templateとlibexwordの対応範囲から、DATAPLUS 5 / 6 / 7を理論上の対象としています。
| 機種 | 世代・識別 | 状態 |
|---|---|---|
| XD-B4800 | DATAPLUS 6 / CY168 | 実機確認済み |
| XD-N6500 | DATAPLUS 7 / CY460 | 実機確認済み |
| DATAPLUS 5 | — | 理論上の対象・実機未確認 |
| その他の機種・世代 | — | 動作未確認 |
同じ世代でも型番やROM構成による差異があり得るため、実機確認済み機種以外の動作は保証しません。
- 対応するCASIO EX-word
- EXLLM for EX-wordをビルドしたD01
- EXQ12 runtime layoutと互換性のある
.q12モデル - インストールに使用するlibexword環境
動作確認済みのmodel.q12はToTo-40417/EXLLMで配布しています。モデルのソース、学習手順、再生成方法はexllmを参照してください。別モデルを使用する場合は、事前にexllm-model-checkなどで互換性を確認してください。
このリポジトリはビルド済みD01ではなくソースを公開しています。libdataplusなどの依存物は同梱していないため、各配布元から取得してビルドしてください。
収録アプリは次の2種類です。
XLLMI— 通常利用向け安定版XLMBM— TTFT・総時間・tokens/sを記録する計測版
ビルドしたD01をlibexwordで本体へ導入し、モデルを本体内蔵領域のMODELS/へ配置します。インストールやファイル転送が明確に完了するまで、USB接続を解除しないでください。
起動時に、本体内蔵領域のモデルとmicroSDから登録済みのモデルを最大16件表示します。
| キー | 動作 |
|---|---|
| 上下 | モデルを選択 |
決定 |
選択モデルを読み込む |
| 左 | microSD上のモデルを登録 |
| 右 | 選択中の本体モデルをmicroSDへ配置 |
履歴 |
表示中の画面を保存 |
自由入力:本体キーボードから質問を入力例題:収録済みの4問を実行端末情報:パラメータ数、モデル容量、メモリプロファイル、本体識別情報を表示Thinking ON/OFF:Thinkingモードを切り替え。初期値はOFF戻る:アプリを終了履歴:表示中の画面を保存
Thinking ONでは最大10 tokenのdraftを生成し、そのtoken列を補助情報として最終生成へ再利用します。最終回答には通常時と同じ最大48 tokenを確保します。
自由入力はローマ字入力のかな変換から始まります。例えばOHAYOUと入力すると「おはよう」になります。
現行版に漢字変換IMEはありません。質問はひらがな中心で入力しますが、モデルの回答は漢字かな交じり文を表示できます。漢字を前提に学習したモデルでは、意味が同じかな表記でも回答品質が下がる場合があります。
| キー | 動作 |
|---|---|
| 文字キー | かなまたは英字を入力 |
SHIFT |
かな / ABCを切り替え |
記号 |
? 。 、 ! ーを順に切り替え |
| 右方向キー | 空白を入力 |
削除 |
末尾の1文字を削除 |
決定 |
推論を開始 |
戻る |
入力を中止 |
履歴 |
表示中の画面を保存 |
生成されたトークンは順次表示され、完了後も質問と回答が分かれて残ります。「決定」で次の質問へ戻り、「戻る」で終了します。
「履歴」を押すと、表示中の528×320画面を日時付きBMPとして本体内蔵領域のXLLMI/_USER/YYYYMMDD/へ追加保存します。画像はUSB接続時にlibexwordから回収できます。
v1.3.0は、EXLLM自身によるmicroSDへのモデル配置と、SDモデルの内蔵キャッシュ登録に対応しています。
正式な配置方法は、モデル選択画面で本体モデルを選び、右キーを押す操作です。 PCやlibexwordからSDへ直接コピーする方法は、現時点では動作確認済みの標準手順ではありません。
ここで示すcrd0とdrv0は、PC上のドライブ名ではなく、実行中のEX-wordアプリから見える名前空間です。
- その本体で利用可能なmicroSDを挿入する
- モデル選択画面で本体モデルを選び、右キーを押す
- 進捗表示が完了するまで待つ
- 左キーでSD登録画面を開く
- 登録するモデルを選び、「決定」を押す
- コピーと検証が終わり、アプリが終了するまで待つ
- EXLLMをもう一度起動し、
SD登録と表示されたモデルを選ぶ
書込み中は電源を切ったり、カードを抜いたりしないでください。
右キーは、選択中の本体モデルをアプリから見えるSD領域へ書き出します。
本体内蔵モデル
\drv0\MODELS\model.q12
│
│ モデル選択画面で右キー
▼
microSD上の端末可視領域
\crd0\EXLLM.Q12
左キーの「SD登録」は、SDモデルを内蔵キャッシュへコピーする操作です。推論中にSDを直接読み続ける機能ではありません。
microSD
\crd0\EXLLM.Q12
│
│ 左キー → モデル選択 → 決定
▼
内蔵の一時ファイルへコピー
│
├─ サイズ確認
├─ ハッシュ確認
└─ 失敗時は旧キャッシュへ復帰
▼
内蔵キャッシュ
\drv0\MODELS\SDCACHE.Q12
│
│ アプリ終了・再起動
▼
内蔵キャッシュからモデル読込み・推論
登録できる内蔵キャッシュは1件です。別のSDモデルを登録すると、既存のSDCACHE.Q12を置き換えます。
EX-word本体 \drv0
└─ MODELS
├─ model.q12 本体へ直接配置したモデル
└─ SDCACHE.Q12 SDから登録した1件のキャッシュ
microSD \crd0
├─ EXLLM.Q12 右キーで作成する標準配置
├─ CASIO\*.q12 登録画面の追加検索先
└─ MODELS\*.q12 登録画面の追加検索先
標準手順で使用するSD上のファイルは\crd0\EXLLM.Q12です。追加検索先は将来のモデル管理も考慮して列挙しますが、PCからファイルを置く手順の動作を保証するものではありません。
PC / libexwordから見えるSD領域
≠
EX-wordアプリがcrd0として見る領域
この非対称性を実機で確認しているため、アプリ内の右キーによる配置だけを標準手順としています。また、カードはEX-wordのパートナー管理を受けるため、1枚のカードを複数端末で使い回す運用はサポートしません。
直接SD推論を採用しなかった理由、transactional copy、メモリ制約、DATAPLUS 6 / 7の内部差異は、docs/DP6-DP7-RUNTIME-NOTES.mdにまとめています。
v1.3.0で、SD登録した同一モデルに「こんにちは」と入力した結果です。
| 機種 | TTFT | 総時間 | 出力 | 表示速度 | 結果 |
|---|---|---|---|---|---|
| XD-B4800 | 12.705秒 | 54.150秒 | 24 tokens | 0.57 token/秒 | 推論・画面保存・ログ保存に成功 |
| XD-N6500 | 12.707秒 | 54.163秒 | 24 tokens | 0.57 token/秒 | 推論・画面保存・ログ保存に成功 |
両機種は同じ回答を生成しました。従来の複数質問ベンチでも差はミリ秒単位であり、今回の条件では実質同速です。詳細はdocs/EXLLM-BENCHMARK-ARTICLE-NOTES.mdを参照してください。
devkitSH4とlibdataplusが必要です。
export DEVKITPRO="$HOME/toolchains/devkitPro"
export DEVKITSH4="$DEVKITPRO/devkitSH4"
export PATH="$DEVKITPRO/tools/bin:$DEVKITSH4/bin:$PATH"
make -C apps/exllm
make -C apps/exllm-benchmarkmodel.q12は、モデルrepoのpython tools/export_exq12.pyで公開EXLLM8重みから同一SHA-256のファイルを再生成できます。
GPL-2.0。Gnuboy EX由来の最小libcとbrain-hackers/exword-templateを基礎にしています。モデルはApache-2.0で別配布です。ゲームROM、セーブデータ、CASIO firmware、端末認証情報は含みません。
再配布や派生版の公開はライセンスに従って自由に行えます。公開時に作者へ一報いただけると幸いですが、連絡は利用条件ではありません。
EXLLM— 学習・評価コードと参照ランタイム- Hugging Faceモデル・配布用重み
exllm-model-check— EXQ12モデルの構造検査exword-hardware-dump— EX-word実機情報の取得exword-ram-scanner— RAM領域の実機検証exword-gnuboy-save-importer— Gnuboyセーブデータ転送DP6 / DP7 runtime notes— 公開可能な内部構造・安全設計資料- Note記事:高校生用の電子辞書でLLMを動かしてみた ―0.024GHz/0.016GB
EXLLM for EX-word is a homebrew application that runs the compact Japanese EXLLM 5M model fully offline on CASIO EX-word hardware. It supports keyboard input, token-by-token output, Thinking mode, screenshots, performance logs, and selection of internal or microSD-origin models.
LLM stands for Little Language Model.
The current version is v1.3.1.
DATAPLUS 5, 6, and 7 are theoretical targets based on the supported scope of exword-template and the libexword installation path. Physical-device validation covers the XD-B4800 (DATAPLUS 6 / CY168) and XD-N6500 (DATAPLUS 7 / CY460). DATAPLUS 5 and all other generations remain untested, and other models are not guaranteed.
You need a compatible EX-word, a D01 built from this source, an EXQ12-compatible .q12 model, and a libexword installation environment. The validated model.q12 is distributed separately. See exllm for its source, training recipe, and reproducible export path.
This repository contains the stable XLLMI app and the separate XLMBM benchmark build. It publishes source rather than prebuilt D01 files. Obtain devkitSH4 and libdataplus from their upstream projects, build the app, install the D01 with libexword, and place a model in MODELS/ in internal storage. Do not disconnect USB until installation and file transfers have clearly completed.
At startup, the app lists up to 16 internal and registered SD-origin models. Up/Down selects a model; Enter loads it; Left opens SD registration; Right places the selected internal model on the card; and History saves the screen.
The main menu provides free input, four example questions, device information, and Thinking ON/OFF. Thinking defaults to OFF. When enabled, it generates a draft of up to 10 tokens and reuses those token IDs as supporting input for the final pass, which retains the normal 48-token output limit.
Free input starts in romaji-to-kana mode. Letter keys enter text; Shift switches between kana and ABC; repeated Symbol presses cycle through ? 。 、 ! ー; Right inserts a space; Delete removes one character; Enter starts inference; and Back cancels input.
Generated tokens appear progressively. The completed screen keeps the question and answer visible separately. History saves a timestamped 528×320 BMP under XLLMI/_USER/YYYYMMDD/ in internal storage; screenshots can be retrieved over USB with libexword.
v1.3.0 supports placing a model on microSD through EXLLM itself and registering one SD model in an internal cache.
The supported placement method is to select an internal model on the model screen and press Right. Copying a file directly from a PC or through libexword is not currently a validated standard workflow.
crd0 and drv0 below are namespaces visible to the running EX-word application, not PC drive paths.
- Insert a microSD card usable by that device.
- Select an internal model and press Right.
- Wait for the write progress to complete.
- Press Left to open SD registration.
- Select the SD model and press Enter.
- Wait for copying, verification, and automatic app exit.
- Relaunch EXLLM and select the entry marked
SD登録.
Do not power off or remove the card while writing.
Internal model
\drv0\MODELS\model.q12
│
│ Right on the model-selection screen
▼
Application-visible microSD storage
\crd0\EXLLM.Q12
SD registration copies the model into internal storage. Inference does not continue reading directly from the card.
microSD
\crd0\EXLLM.Q12
│
│ Left → select model → Enter
▼
Copy to an internal temporary file
│
├─ verify size
├─ verify hash
└─ restore the old cache on failure
▼
Internal cache
\drv0\MODELS\SDCACHE.Q12
│
│ exit and relaunch
▼
Load and infer from the internal cache
There is one SD-registration cache slot. Registering another SD model replaces the existing SDCACHE.Q12.
EX-word internal storage \drv0
└─ MODELS
├─ model.q12 model placed directly in internal storage
└─ SDCACHE.Q12 one model registered from SD
microSD \crd0
├─ EXLLM.Q12 standard path written with Right
├─ CASIO\*.q12 additional registration search path
└─ MODELS\*.q12 additional registration search path
The standard workflow uses \crd0\EXLLM.Q12. The additional locations are enumerated for future model management, but this does not guarantee that files copied there from a PC will be visible to the application.
SD storage visible to PC / libexword
!=
storage visible to the EX-word app as crd0
Because this asymmetry was observed on physical hardware, only in-app placement with Right is treated as the standard workflow. EX-word also applies device-partner management to cards, so sharing one card between multiple units is unsupported.
See docs/DP6-DP7-RUNTIME-NOTES.md for the reasons direct SD inference was rejected, transactional-copy details, memory constraints, DATAPLUS 6/7 differences, and the safety decisions behind this design.
The same SD-registered model and こんにちは prompt completed on both validated devices.
| Device | TTFT | Total | Output | Displayed speed | Result |
|---|---|---|---|---|---|
| XD-B4800 | 12.705 s | 54.150 s | 24 tokens | 0.57 token/s | Inference, screenshot, and log succeeded |
| XD-N6500 | 12.707 s | 54.163 s | 24 tokens | 0.57 token/s | Inference, screenshot, and log succeeded |
Both produced the same answer. Earlier matched multi-prompt measurements also differed only by milliseconds, making their performance effectively equal in this workload. See docs/EXLLM-BENCHMARK-ARTICLE-NOTES.md for details.
export DEVKITPRO="$HOME/toolchains/devkitPro"
export DEVKITSH4="$DEVKITPRO/devkitSH4"
export PATH="$DEVKITPRO/tools/bin:$DEVKITSH4/bin:$PATH"
make -C apps/exllm
make -C apps/exllm-benchmarkThe model repository's python tools/export_exq12.py deterministically rebuilds model.q12 from the published EXLLM8 weights and verifies the release SHA-256.
GPL-2.0 source, based on the minimal libc from Gnuboy EX and brain-hackers/exword-template. The Apache-2.0 model is distributed separately. Game ROMs, save data, CASIO firmware, and device authentication data are not included. Redistribution and derivative releases are welcome under the license. A brief note to the author when publishing would be appreciated, but is not a condition of use.




