Instructions to use tokimoa/jp-invoice-reader-2b-GGUF with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use tokimoa/jp-invoice-reader-2b-GGUF with llama.cpp:
Install (macOS, Linux)
curl -LsSf https://llama.app/install.sh | sh # Start a local OpenAI-compatible server with a web UI: llama serve -hf tokimoa/jp-invoice-reader-2b-GGUF:Q4_K_M # Run inference directly in the terminal: llama cli -hf tokimoa/jp-invoice-reader-2b-GGUF:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf tokimoa/jp-invoice-reader-2b-GGUF:Q4_K_M # Run inference directly in the terminal: llama cli -hf tokimoa/jp-invoice-reader-2b-GGUF:Q4_K_M
Use pre-built binary
# Download pre-built binary from: # https://github.com/ggerganov/llama.cpp/releases # Start a local OpenAI-compatible server with a web UI: ./llama-server -hf tokimoa/jp-invoice-reader-2b-GGUF:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf tokimoa/jp-invoice-reader-2b-GGUF:Q4_K_M
Build from source code
git clone https://github.com/ggerganov/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-server llama-cli # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama-server -hf tokimoa/jp-invoice-reader-2b-GGUF:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf tokimoa/jp-invoice-reader-2b-GGUF:Q4_K_M
Use Docker
docker model run hf.co/tokimoa/jp-invoice-reader-2b-GGUF:Q4_K_M
- LM Studio
- Jan
- vLLM
How to use tokimoa/jp-invoice-reader-2b-GGUF with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "tokimoa/jp-invoice-reader-2b-GGUF" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "tokimoa/jp-invoice-reader-2b-GGUF", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker
docker model run hf.co/tokimoa/jp-invoice-reader-2b-GGUF:Q4_K_M
- Ollama
How to use tokimoa/jp-invoice-reader-2b-GGUF with Ollama:
ollama run hf.co/tokimoa/jp-invoice-reader-2b-GGUF:Q4_K_M
- Unsloth Studio
How to use tokimoa/jp-invoice-reader-2b-GGUF with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for tokimoa/jp-invoice-reader-2b-GGUF to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for tokimoa/jp-invoice-reader-2b-GGUF to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for tokimoa/jp-invoice-reader-2b-GGUF to start chatting
- Pi
How to use tokimoa/jp-invoice-reader-2b-GGUF with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf tokimoa/jp-invoice-reader-2b-GGUF:Q4_K_M
Configure the model in Pi
# Install Pi: npm install -g @mariozechner/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "llama-cpp": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "tokimoa/jp-invoice-reader-2b-GGUF:Q4_K_M" } ] } } }Run Pi
# Start Pi in your project directory: pi
- OpenClaw new
How to use tokimoa/jp-invoice-reader-2b-GGUF with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf tokimoa/jp-invoice-reader-2b-GGUF:Q4_K_M
Configure OpenClaw
# Install OpenClaw: npm install -g openclaw@latest # Register the local server and set it as the default model: openclaw onboard --non-interactive --mode local \ --auth-choice custom-api-key \ --custom-base-url http://127.0.0.1:8080/v1 \ --custom-model-id "tokimoa/jp-invoice-reader-2b-GGUF:Q4_K_M" \ --custom-provider-id llama-cpp \ --custom-compatibility openai \ --custom-text-input \ --accept-risk \ --skip-health
Run OpenClaw
openclaw agent --local --agent main --message "Hello from Hugging Face"
- Docker Model Runner
How to use tokimoa/jp-invoice-reader-2b-GGUF with Docker Model Runner:
docker model run hf.co/tokimoa/jp-invoice-reader-2b-GGUF:Q4_K_M
- Lemonade
How to use tokimoa/jp-invoice-reader-2b-GGUF with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull tokimoa/jp-invoice-reader-2b-GGUF:Q4_K_M
Run and chat with the model
lemonade run user.jp-invoice-reader-2b-GGUF-Q4_K_M
List all available models
lemonade list
- Hermes Agent
How to use tokimoa/jp-invoice-reader-2b-GGUF with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf tokimoa/jp-invoice-reader-2b-GGUF:Q4_K_M
Configure Hermes
# Install Hermes: curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash hermes setup # Point Hermes at the local server: hermes config set model.provider custom hermes config set model.base_url http://127.0.0.1:8080/v1 hermes config set model.default tokimoa/jp-invoice-reader-2b-GGUF:Q4_K_M
Run Hermes
hermes
- Atomic Chat
Upload folder using huggingface_hub
Browse files- .gitattributes +4 -0
- README.md +66 -0
- jp-invoice-reader-2b-Q4_K_M.gguf +3 -0
- jp-invoice-reader-2b-Q8_0.gguf +3 -0
- jp-invoice-reader-2b-f16.gguf +3 -0
- mmproj-jp-invoice-reader-2b-f16.gguf +3 -0
.gitattributes
CHANGED
|
@@ -33,3 +33,7 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
| 36 |
+
jp-invoice-reader-2b-Q4_K_M.gguf filter=lfs diff=lfs merge=lfs -text
|
| 37 |
+
jp-invoice-reader-2b-Q8_0.gguf filter=lfs diff=lfs merge=lfs -text
|
| 38 |
+
jp-invoice-reader-2b-f16.gguf filter=lfs diff=lfs merge=lfs -text
|
| 39 |
+
mmproj-jp-invoice-reader-2b-f16.gguf filter=lfs diff=lfs merge=lfs -text
|
README.md
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: apache-2.0
|
| 3 |
+
language:
|
| 4 |
+
- ja
|
| 5 |
+
base_model: Qwen/Qwen3-VL-2B-Instruct
|
| 6 |
+
pipeline_tag: image-text-to-text
|
| 7 |
+
tags:
|
| 8 |
+
- gguf
|
| 9 |
+
- llama.cpp
|
| 10 |
+
- japanese
|
| 11 |
+
- document-understanding
|
| 12 |
+
- invoice
|
| 13 |
+
---
|
| 14 |
+
|
| 15 |
+
# jp-invoice-reader-2b-GGUF — 日本語帳票リーダー
|
| 16 |
+
|
| 17 |
+
日本語帳票(請求書・見積書・納品書・領収書)の読み取りに特化した [jp-invoice-reader-2b](https://huggingface.co/tokimoa/jp-invoice-reader-2b) のGGUF版です。llama.cppでWindows/LinuxのCPU・GPUで動きます。
|
| 18 |
+
|
| 19 |
+
## ファイル
|
| 20 |
+
|
| 21 |
+
| ファイル | サイズ | 用途 |
|
| 22 |
+
|---|---|---|
|
| 23 |
+
| **jp-invoice-reader-2b-Q8_0.gguf** | 1.7GB | 推奨(抽出・QAとも) |
|
| 24 |
+
| jp-invoice-reader-2b-Q4_K_M.gguf | 1.0GB | QA用途向け(下記注意) |
|
| 25 |
+
| jp-invoice-reader-2b-f16.gguf | 3.2GB | 参照用 |
|
| 26 |
+
| mmproj-jp-invoice-reader-2b-f16.gguf | 781MB | 視覚エンコーダ(**必須・どの量子化とも組み合わせ可**) |
|
| 27 |
+
|
| 28 |
+
## 実測(公開中のbf16版と同一プロトコル: 未見評価100枚・QA400問・抽出700フィールド)
|
| 29 |
+
|
| 30 |
+
| 指標 | bf16(MLX公開版) | Q8_0 | Q4_K_M |
|
| 31 |
+
|---|---|---|---|
|
| 32 |
+
| ja-docs QA(実写風6問) | 6/6 | **6/6** | 6/6 |
|
| 33 |
+
| 帳票QA | 93.5% | **91.8%** | 90.5% |
|
| 34 |
+
| 抽出フィールド一致(厳密) | 90.1% | **84.3%** | 67.3% |
|
| 35 |
+
|
| 36 |
+
厳密一致の低下について実態を補足します(同一100枚で追加検証):
|
| 37 |
+
|
| 38 |
+
- **Q8_0の低下分はほぼ形式ゆれです。** 消費税額を`{"rate": 10, "amount": 1449000}`のようにネストで返す揺れが増え、厳密一致では×になりますが、**税額の値ベースでは99/100が正解**でした。金額の読み取り能力自体は維持されています。後段でJSONを受けるときはネスト形式も許容してください。
|
| 39 |
+
- **Q4_K_MはJSON構文の崩れが100枚中15件発生します。** 抽出(長い構造化出力)には非推奨で、QA用途向けです。
|
| 40 |
+
|
| 41 |
+
## 使い方
|
| 42 |
+
|
| 43 |
+
```bash
|
| 44 |
+
llama-server -m jp-invoice-reader-2b-Q8_0.gguf --mmproj mmproj-jp-invoice-reader-2b-f16.gguf \
|
| 45 |
+
--port 8080 --jinja -c 8192 --image-min-tokens 64 --image-max-tokens 4096
|
| 46 |
+
```
|
| 47 |
+
|
| 48 |
+
運用上の注意(いずれも実測に基づく):
|
| 49 |
+
|
| 50 |
+
1. **APIでは画像をテキストより先に置いてください**(contentの並びを`[image_url, text]`にする)。逆順は精度が下がります。
|
| 51 |
+
2. **`-c 8192`等でコンテキスト長を指定してください。** 無指定はモデル宣言の262Kで確保しようとしてメモリ不足になります。
|
| 52 |
+
3. **`--image-max-tokens 4096`を推奨します。** 帳票は高解像度のため、既定では画像が過剰に縮小され数値の読み取りが落ちます。
|
| 53 |
+
|
| 54 |
+
プロンプト例: 抽出は「この帳票から主要項目を抽出してJSONで出力してください。」、QAは「この請求書の合計金額は?」等の自由質問です。
|
| 55 |
+
|
| 56 |
+
## 制約
|
| 57 |
+
|
| 58 |
+
合成帳票ドメインで学習しています。実写スキャン・手書き・特殊レイアウトは未検証で、写真由来の帳票では精度が下がる可能性があります。
|
| 59 |
+
|
| 60 |
+
## ライセンスと帰属
|
| 61 |
+
|
| 62 |
+
- ベース: [Qwen/Qwen3-VL-2B-Instruct](https://huggingface.co/Qwen/Qwen3-VL-2B-Instruct)(Apache-2.0)
|
| 63 |
+
- 学習データ・評価方法の詳細は[本体repo](https://huggingface.co/tokimoa/jp-invoice-reader-2b)を参照してください
|
| 64 |
+
|
| 65 |
+
---
|
| 66 |
+
Developed by [tokimoa](https://tokimoa.jp) — データを外に出さないAI活用を支援しています
|
jp-invoice-reader-2b-Q4_K_M.gguf
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:4706a2c4c942f2ecbc761dbb9ca0d8378607fcfed7f4f4f1b69bad6657cc8f6b
|
| 3 |
+
size 1107410336
|
jp-invoice-reader-2b-Q8_0.gguf
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:586dada4c6ab3b6a6cb6e35d54c7d065afcd0829d905f7edb936a500fc02ec14
|
| 3 |
+
size 1834427808
|
jp-invoice-reader-2b-f16.gguf
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:7754cf026bbb98cdfae403bf97ec4c518b336d22c75e6e4afb9b5e31e18409ee
|
| 3 |
+
size 3447350688
|
mmproj-jp-invoice-reader-2b-f16.gguf
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:43857c950a6fc1726f573d3dde87b3d08835c456493139b634a3e8227078b6c3
|
| 3 |
+
size 819394752
|