DOCUMENTATION / v0.2

From state to decision.

A practical guide to installing OpenJev and connecting typed judgments to your code.

01 / Quick start

Use Python 3.10 or later. Clone the source repository and install from that checkout; the command below does not assume a published PyPI package.

Terminal
git clone https://github.com/BZ-AI/openjev.git
cd openjev
python -m pip install -e .
python examples/goal_loop_auditor.py

The included Goal Loop example uses the project's offline mock setup. To run local model inference, install an optional provider as described below.

02 / Three decision types

Noul — a yes/no probability

Ask one narrow binary question, such as whether a requirement may be missing. Use the returned probability with your own policy; confidence is not proof.

Choice — a fixed set of answers

Define named criteria. Receive one label together with its probability distribution and confidence. Useful for support routing or selecting a recovery branch.

Score — an ordered rubric

Define ordered criteria, from low to high. Receive a distribution, an expected score and confidence. Use it for semantic risk or evidence quality assessments.

See the complete three-type example ↗

03 / Try a local provider

Install the optional Laya backend from your checkout. Its model packages and weights follow their upstream licenses and may require additional downloads and compatible hardware.

Terminal
python -m pip install -e ".[laya]"
Python
from openjev import Choice, OpenJev
from openjev.providers import LayaProvider

engine = OpenJev(LayaProvider())
result = engine.evaluate(
    state={"message": "I was charged twice."},
    questions={
        "team": Choice(
            instructions="Which team should handle this?",
            criteria={
                "billing": "Payments and refunds",
                "technical": "Bugs and outages",
                "sales": "Pricing and purchasing",
            },
        )
    },
)
print(result.model_dump_json(indent=2))

For Apple Silicon, the laya-mlx extra requires Python 3.11 or later; select LayaProvider(package="laya_mlx"). OpenJev also has an OpenAI-compatible provider for configured endpoints.

04 / Make routing explicit

Start with deterministic gates. Then inspect the fast result against your confidence, calibration and option-count policy. Configure a stronger provider only when you want fallback inference.

Python
from openjev import AdaptiveDecisionRuntime, OpenJev, RoutingPolicy
from openjev.providers import LayaProvider

runtime = AdaptiveDecisionRuntime(
    OpenJev(LayaProvider()),
    policy=RoutingPolicy(
        confidence_threshold=0.60,
        max_fast_choice_options=20,
    ),
)
Thresholds are workload-specific.

0.60 is an example, not a guarantee. Fit calibration on representative held-out data. With no strong backend, low confidence remains explicit instead of silently becoming a safe answer.

Full routing and fallback guide ↗

05 / Measure before you rely on it

The benchmark harness measures top-1 accuracy, ECE, Brier score, score MAE and latency. It also supports local-first threshold sweeps.

Terminal
openjev-bench benchmarks/yibie_support_40.json --fast laya

The included 40-case support dataset is MIT licensed with upstream attribution. The 500-case comparison uses a converter rather than redistributing restricted source texts.

Adding --strong jev evaluates the stronger backend on every benchmark case, which can incur hosted API costs. Review the benchmark documentation before running it.

Reproduce the benchmarks ↗