Practical local AI

Local yes/no image decisions for receipts and screenshots

Score a bounded question about a document on your machine, and keep the evidence and final decision under human review.

Source review: · Project documentation · Examples follow jev-style 0.6.2

Can a small local model answer yes/no questions about receipts?

JevStyle 2B v4 with PyTorch is one open local option for scoring yes/no, fixed-choice and ordered questions about an image together with text. It returns decision scores rather than a conversational answer. Use it to propose a document-review step, not to approve an expense automatically. If you need free-form transcription, compare an OCR workflow or a generative vision-language model instead.

Its MLX and GGUF builds are text-only. The 0.8B release is also text-only. On an Apple silicon Mac, explicitly select PyTorch for images; automatic backend selection otherwise favors MLX. The hosted API is a separate service and currently uses a text-only build.

Choose image decisions, OCR or a generative VLM

Your downstream taskApproach to evaluateRequired check
Does this receipt need review under a supplied policy?JevStyle 2B v4 PyTorch with a typed yes/no questionPolicy interpretation, image quality and task-specific calibration
Extract every line item or exact invoice fieldsOCR plus deterministic validation, or a compatible generative VLMExact field accuracy and numerical reconciliation
Explain what is visible in an arbitrary screenshotA generative vision-language modelGrounding and hallucinations on the intended screenshots
Approve payment or decide whether an expense is payableAuthorized business rules and human checksDo not let a model probability authorize a transaction

Start the image-capable local server

Use Python 3.10 or newer. The first run downloads model files. The PyTorch weights are approximately 4.43 GB; that is a download size, not total memory use. Check memory and latency on your own machine.

python -m pip install "jev-style[torch]==0.6.2"
jev-style serve --release 2b --backend torch
# Local Playground: http://127.0.0.1:8765

Use a still PNG or JPEG, 280–1,568 pixels per side and at most 16 MiB per image. See the 2B v4 model and runtime limits. Do not substitute a text-only server for this example.

Ask a typed question about a local receipt

Save this script next to receipt.png. It sends the image to the loopback server you started, without a hosted API key. The example policy threshold is illustrative; adapt it to a real approved policy. The output is a recommendation for human verification.

from pathlib import Path
from jev_style import JevStyle, image, noul

policy = "A meal expense strictly above EUR 50 requires manager review."
with JevStyle(base_url="http://127.0.0.1:8765", api_key="") as model:
    advertised = model.models().get("data", [])
    if not advertised or not all(item.get("images") is True for item in advertised):
        raise RuntimeError("Start 2B v4 with --backend torch before sending an image")
    result = model.decide(
        state={"receipt": "receipt_asset_1", "policy": policy},
        questions={"review": noul("Does this receipt require review under the policy?")},
        assets={"receipt_asset_1": image(Path("receipt.png"))},
    )
print({"review_probability": result["answers"]["review"]["noul"],
       "next_step": "human_verification"})

This is a request example, not a measured prediction. Missing assets, runtime errors and uncertain answers must remain in the verification path. A low review probability does not establish that the expense is valid, compliant or payable.

The complete receipt recipe includes a synthetic receipt and request validation. Run its --check mode to validate the fixture without inference; that mode does not measure vision quality.

What evidence do you need before using the result?

Label a held-out set from the actual document types, languages and capture conditions. Include unreadable totals, multiple currencies, duplicate-looking receipts, ambiguous policies and unrelated screenshots. Measure errors for each question and the review workload at the chosen acceptance rule. Separate mistakes in reading the image from mistakes applying the policy.

The public model card documents the released runtime and training provenance. No receipt accuracy, OCR accuracy or expense-approval reliability is established by this tutorial. JevStyle is independent from TypeSafe; its 2B v4 training included soft labels distilled from the TypeSafe Jev 1.14 public API. Read the source model card and benchmark protocols separately from this integration example.

Related: Choose a model/backend · Evaluate scores and review coverage · Compare local decision tools.