Wstf-Odin-Spear (Wasserstoff-AI/odin-spear)

A 450M-Parameter (856 MB) Universal Document Classifier & Custom-Schema JSON Extractor

Built by Wasserstoff Innovation ยท v1.1

Website Hugging Face Size License CPU Ready


Overview

Wstf-Odin-Spear is a tiny 450M-parameter (856 MB) vision-language model engineered by Wasserstoff Innovation to classify any document and extract structured JSON in any schema you define โ€” running 100% locally on a laptop or 8 GB RAM CPU-only server with no cloud API required.

Pass in an image, scan, PDF page, or raw text + your own document categories + your own target JSON structure (flat fields, nested objects, or repeating line-item arrays), and it returns clean, schema-conforming JSON with normalized ISO dates (YYYY-MM-DD), ISO-3 currency codes (USD, EUR, INR, GBP), plain numbers, and explicit null values for missing fields.


Benchmarks at a Glance

All three public benchmarks below were evaluated strictly zero-shot (zero training samples from CORD-v2, SROIE, or FATURA), comparing Wasserstoff-AI/odin-spear (856 MB) directly against its same-size base model (LiquidAI/LFM2.5-VL-450M-Extract), 2ร— larger Qwen/Qwen3.5-0.8B (1.75 GB), and cloud reference APIs โ€” all scored with the exact same evaluator. Full raw metrics are bundled in benchmarks/public_benchmarks_results.json.

Benchmark Base Liquid (0.45B ยท 856 MB) Odin-Spear (0.45B ยท 856 MB) Qwen3.5-0.8B (0.87B ยท 1.75 GB) Speed (Odin vs Qwen)
FATURA Invoices (100 public docs, 5-field avg) 72.2% 98.0% (+8.0 over Qwen!) 90.0% 0.87 s vs 3.14 s (3.6ร— faster)
CORD-v2 Receipts (100 docs, Total / Item Names) 58.0% / 0.0% 80.0% / 65.9% 91.0% / 82.9% 2.63 s vs 5.63 s (2.1ร— faster)
ICDAR 2019 SROIE (100 noisy scans, 4-field avg) 53.2% 67.5% (+14.3 over Base) 89.0% 2.23 s vs 3.96 s (1.8ร— faster)
Universal 19-Domain Suite (40 held-out docs) โ€” 95.0% (100% valid JSON) โ€” 3.12 s / doc

1. Public Invoices โ€” FATURA (100 unseen invoices, zero-shot)

Source: thoughtworks/document-processing-benchmark (fatura split). All models scored with the exact same evaluator.

Field Extracted Base Liquid (0.45B) Odin-Spear (0.45B ยท 856 MB) Qwen3.5-0.8B (0.87B ยท 1.75 GB) GPT-5.4-nano (Cloud)
Valid JSON 91.0% 100.0% 100.0% 100.0%
Invoice Date (1995โ€“2019) 79.0% 100.0% 92.0% 100.0%
Currency 63.5% 100.0% 100.0% 98.8%
Grand Total 80.0% 97.6% 89.4% 100.0%
Invoice Number 71.6% 96.6% 96.6% 92.0%
Due Date 47.4% 96.5% 98.2% โ€”
Vendor Name 66.7% 95.8% 72.2% 100.0%
Overall 5-Field Average 72.2% 98.0% 90.0% 98.2%
Average Speed (M4 MPS) 0.98 s / doc 0.87 s / doc 3.14 s / doc 3.34 s / doc (API)

Takeaway: On unseen public invoices, Odin-Spear (856 MB) beats 2ร— larger Qwen3.5-0.8B (1.75 GB) by +8.0 pts overall (+23.6 pts on Vendor, +8.2 pts on Total, +8.0 pts on Date) while running 3.6ร— faster (0.87 s vs 3.14 s) โ€” and matches OpenAI's GPT-5.4-nano (98.2%) 100% locally.


2. Public Receipts with Line Items โ€” CORD-v2 (100 real store receipts, full test split, zero-shot)

Source: naver-clova-ix/cord-v2 (test, 100 receipts). Tests nested JSON arrays (items[]) plus totals.

Metric Base Liquid (0.45B) Odin-Spear (0.45B ยท 856 MB) Qwen3.5-0.8B (0.87B ยท 1.75 GB) GPT-5.4-nano (Cloud)
Valid JSON 81.0% 99.0% 100.0% 100.0%
Grand Total 58.0% 80.0% 91.0% 86.0%
Subtotal 47.7% 76.9% 100.0% โ€”
Line-Item Names (F1) 0.0% 65.9% 82.9% 83.3%
Line-Item Prices (F1) 1.0% 63.7% 83.7% 77.7%
Average Speed 2.33 s / doc 2.63 s / doc 5.63 s / doc 3.97 s / doc (API)

Takeaway: Compared to its same-size base model, Odin-Spear unlocks nested line-item extraction (+65.9 pts item names, +62.7 pts item prices, +22.0 pts grand total) while running 2.1ร— faster and at half the memory of Qwen3.5-0.8B.


3. Public Noisy Scanned Receipts โ€” ICDAR 2019 SROIE (100 scans, zero-shot)

Source: jsdnrs/ICDAR2019-SROIE (test).

Field Extracted Base Liquid (0.45B) Odin-Spear (0.45B ยท 856 MB) Qwen3.5-0.8B (0.87B ยท 1.75 GB)
Receipt Date 63.0% 71.0% 86.0%
Full Street Address 51.0% 71.0% 94.0%
Company Name 54.0% 70.0% 91.0%
Grand Total 45.0% 58.0% 85.0%
Overall 4-Field Average 53.2% 67.5% (+14.3 vs Base) 89.0%
Average Speed 1.89 s / doc 2.23 s / doc 3.96 s / doc

(All Odin-Spear and Base Liquid local scores above use the default Hybrid mode: document image + 0-MB OS-local OCR text hint. Pure-vision zero-OCR runs are also included in benchmarks/public_benchmarks_results.json.)


4. Universal Multi-Domain Held-Out Suite (40 unseen synthetic docs across 19 domains)

Metric Score
Valid JSON Rate 100.0% (40 / 40)
Exact Caller Schema Keys 100.0% (40 / 40)
Stage-1 Document Classification 100.0% (40 / 40)
Overall Field-Level Accuracy 95.0%
Average Speed (Apple Silicon MPS) 3.12 s / doc
Domain Category Domains & Field-Level Accuracy
Healthcare prescription 100.0% ยท medical_lab_report 98.1%
Travel & HR boarding_pass 100.0% ยท resume 100.0% ยท pay_stub 100.0%
Legal & Insurance insurance_policy 100.0% ยท contract 93.9%
Logistics & Trade bill_of_lading 100.0% ยท producer_cert 100.0% ยท packing_sop 100.0% ยท packing_list 81.8%
Engineering & Specs tech_pack 100.0% ยท pp_comments 90.9%
Finance & Commerce buyer_po 100.0% ยท commercial_invoice 97.8% ยท proforma_invoice 97.3% ยท tax_invoice 94.8% ยท rmpo 94.3% ยท bank_statement 85.7%

Synthetic Sample Documents & Verified Outputs

Three unseen synthetic documents from ./samples/ alongside the exact JSON extracted by Wasserstoff-AI/odin-spear:

Example 1: Tax Invoice โ†’ Custom Nested ERP Schema (100.0% exact)

View Sample Image & Extracted Nested JSON Synthetic Tax Invoice sample document
{
  "erp_record": {
    "doc_ref": "INV/26-27/81555",
    "issue_dt": "2026-02-24",
    "seller": { "legal_name": "Gupta Packaging Works", "tax_id": "09RAQYX4189P1ZF" },
    "buyer": { "legal_name": "P.W. Pharma Traders", "tax_id": "08HYRHU5145S1ZD" },
    "financials": {
      "iso_currency": "INR",
      "taxable_total": 721227.4,
      "gst_total": 86547.29,
      "payable_grand_total": 807774.69
    },
    "items": [
      { "label": "5-Ply Corrugated Export Carton Box", "qty": 850.0, "rate": 111.77, "row_total": 95004.5 },
      { "label": "Postage & Courier Charges (Navy Blue)", "qty": 240.0, "rate": 531.96, "row_total": 127670.4 },
      { "label": "Recycled LD Printed Polybag 13x17\" (Off White)", "qty": 1200.0, "rate": 5.5, "row_total": 6600.0 },
      { "label": "Zinc Alloy Metal Brand Badge", "qty": 500.0, "rate": 3.26, "row_total": 1630.0 },
      { "label": "Ladies Woven Midi Dress", "qty": 850.0, "rate": 576.85, "row_total": 490322.5 }
    ]
  }
}

Example 2: Medical Prescription โ†’ Medications Array + Strict Null (100.0% exact)

View Sample Image & Extracted JSON Synthetic Medical Prescription sample document
{
  "patient_name": "Anuj Foster",
  "clinic_name": "Hibelas Health Clinic",
  "date": "2025-01-20",
  "medications": [
    { "drug_name": "Paracetamol", "dosage": "650 mg", "frequency": "Every 6 hours if fever", "duration": "5 days" },
    { "drug_name": "Azithromycin", "dosage": "500 mg", "frequency": "Once daily", "duration": "3 days" }
  ],
  "discount_amount": null
}

Example 3: Maritime Bill of Lading โ†’ Logistics Schema (100.0% exact)

View Sample Image & Extracted JSON Synthetic Bill of Lading sample document
{
  "bl_number": "BL-FMS120091",
  "shipper": "Sri Cenalis Commerce International",
  "consignee": "Neton Components AG",
  "vessel": "MV HEHANIO V.31",
  "container_number": "VLEC6908258",
  "port_of_loading": "Chennai, India",
  "port_of_discharge": "Rotterdam, NL",
  "ship_date": "2025-11-30",
  "gross_weight_kg": 3220.5
}

8 GB RAM CPU-Only Speed & Memory Analysis (No GPU)

Measured strictly on CPU only (device="cpu", zero GPU/Metal/CUDA, stock PyTorch 2.15.0 float32):

Setup Peak RAM Used Free RAM on 8 GB Machine Cold Load Short Schema / Classify Full Nested Table JSON Decode Speed
CPU-Only (4 threads โ€” Recommended) 3.02 GB ~4.98 GB free 0.37 s 7.3 โ€“ 14.8 s 33 โ€“ 36 s 8.0 โ€“ 8.2 tok/s
CPU-Only (8 threads โ€” Oversubscribed) 3.05 GB ~4.95 GB free 0.32 s 13.6 s 74 โ€“ 80 s 3.5 โ€“ 3.6 tok/s
Apple Silicon MPS (GPU, bf16) ~1.05 GB ~6.95 GB free ~0.35 s 0.9 s 2.6 โ€“ 3.1 s ~65+ tok/s
Projected: 4-bit GGUF (llama.cpp Q4_K_M) ~0.7 โ€“ 0.9 GB ~7.1 GB free ~0.25 s ~2 โ€“ 4 s ~7 โ€“ 12 s ~25 โ€“ 45 tok/s

CPU Deployment Tips:

  • Pin torch.set_num_threads(4) on 8 GB CPU-only laptops/VMs โ€” runs 2.3ร— faster than 8 threads by matching physical performance cores.
  • Use float32 on ARM64 / standard CPUs (PyTorch emulates bfloat16 in software without AVX-512 BF16 / oneDNN). On Intel 4th+ Gen Xeon / AMD Zen 4+ with AVX-512 BF16, bfloat16 cuts CPU RAM to ~1.3 GB.
  • Vision encoding takes only ~2.4 s on 4 CPU threads; total time scales linearly with output JSON length.

Model Details

Property Specification
Developed by Wasserstoff Innovation
Model ID Wasserstoff-AI/odin-spear (v1.1)
Base Model LiquidAI/LFM2.5-VL-450M-Extract
Architecture Hybrid conv + attention LM (350M) + SigLIP-2 NaFlex dynamic-tiling vision encoder (86M) + 2-layer projector
Checkpoint Size 856 MB (model.safetensors, bfloat16)
Training Method 100% synthetic multi-domain multimodal LoRA + TIES/SVD spectral merging + Orthogonal Subspace Circuit Projection (94 surgically updated matrices)
License LFM Open License v1.0

Quick Start

pip install "transformers>=4.57" torch torchvision pillow
import json
import torch
from transformers import AutoModelForImageTextToText, AutoProcessor
from transformers.image_utils import load_image

model_id = "Wasserstoff-AI/odin-spear"

device = "cuda" if torch.cuda.is_available() else ("mps" if torch.backends.mps.is_available() else "cpu")
if device == "cpu":
    torch.set_num_threads(4)  # Optimal for 8 GB RAM CPU-only machines
dtype = torch.bfloat16 if device in ("cuda", "mps") else torch.float32

processor = AutoProcessor.from_pretrained(model_id, trust_remote_code=True)
model = AutoModelForImageTextToText.from_pretrained(
    model_id,
    dtype=dtype,
    trust_remote_code=True,
).to(device).eval()

schema = {
    "vendor": "string|null",
    "invoice_number": "string|null",
    "date": "YYYY-MM-DD|null",
    "due_date": "YYYY-MM-DD|null",
    "currency": "ISO-3|null",
    "total": "number|null",
    "items": [{"name": "string", "qty": "number|null", "price": "number|null"}],
}

system_prompt = (
    "Extract the following from the document according to the checklist and return ONLY a valid JSON object matching the exact schema below.\n\n"
    "Checklist rules:\n"
    "- Follow the exact JSON keys and nesting shown in the Output JSON schema.\n"
    "- Format all dates as ISO YYYY-MM-DD.\n"
    "- Use 3-letter ISO currency codes (USD, EUR, INR, GBP).\n"
    "- Return plain JSON numbers (no commas or currency symbols). Return null when a field is absent.\n\n"
    f"Output JSON schema:\n{json.dumps(schema, indent=2)}\n\n"
    "Respond with only a JSON object. Do not include any text outside the JSON."
)

# Image input (or pass {"type": "text", "text": "..."} for raw text extraction)
image = load_image("https://huggingface.co/Wasserstoff-AI/odin-spear/resolve/main/samples/synthetic_tax_invoice.jpg").convert("RGB")
image.thumbnail((1440, 1440))

messages = [
    {"role": "system", "content": system_prompt},
    {"role": "user", "content": [{"type": "image", "image": image}]},
]

inputs = processor.apply_chat_template(
    messages, add_generation_prompt=True, return_tensors="pt", return_dict=True, tokenize=True
)
inputs = {k: (v.to(device) if isinstance(v, torch.Tensor) else v) for k, v in inputs.items()}

with torch.inference_mode():
    out = model.generate(**inputs, max_new_tokens=768, do_sample=False)

print(json.loads(processor.batch_decode(out[:, inputs["input_ids"].shape[1]:], skip_special_tokens=True)[0].strip()))

License & Attribution

Wstf-Odin-Spear is a Derivative Work of LiquidAI/LFM2.5-VL-450M-Extract created by Wasserstoff Innovation and distributed under the LFM Open License v1.0 (full text in LICENSE, upstream attributions in NOTICE).

  • Permitted Uses: Free for research, non-commercial, and commercial use by individuals and legal entities with annual revenue under $10,000,000 USD.
  • Over $10M Annual Revenue: Commercial use by entities exceeding $10,000,000 USD annual revenue requires a separate commercial license from Liquid AI, Inc. (Section 5(b)).
  • Attribution: Redistributions must retain LICENSE and NOTICE. Base weights by Liquid AI, Inc.; vision encoder incorporates SigLIP-2 (Google Research).

Engineered by Wasserstoff Innovation
Tiny Specialist Models ยท Surgical Weight Engineering ยท Local Edge Document AI

Downloads last month
42
Safetensors
Model size
0.4B params
Tensor type
BF16
ยท
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support

Model tree for Wasserstoff-AI/odin-spear

Finetuned
(2)
this model