Skip to main content

Crate jev_bridge

Crate jev_bridge 

Source
Expand description

Bridge a generic OpenAI-compatible inference API into a Jev-style decision scoring service. Jev-style decisions are not a model format; they are a readout. This crate implements that readout on top of any runtime that can return next-token log probabilities:

  1. render the direct-options-v1 prompt through the serving runtime’s own chat template, with thinking disabled;
  2. read the log probabilities of the fixed uppercase answer letters at the final position;
  3. softmax only over the declared options, so no other vocabulary can leak into the distribution;
  4. answer in the System One wire format with choice, noul and score questions.

No model weights are copied and no answer text is generated: a decision costs one prompt evaluation and zero output tokens.

§Layout

  • strategy probes the upstream service and parses the response shapes different runtimes use for the same distribution.
  • prompt owns the prompt contract, the single-token answer-slot check and the softmax.
  • server holds server::Bridge and the HTTP surface.
  • wire validates System One requests and builds their responses.
  • evaluate turns --score predictions plus a gold file into offline calibration metrics (accuracy, NLL, Brier, ECE, reliability curve) and recomputes a written report for verification.
  • readout runs the startup self-check: a few questions with obvious answers, read through the same slot channel every request uses, so a model that is not answering the question at all is visible instead of silently confident.

The jev-bridge binary is a thin CLI over server::Bridge.

§Documentation

Every public item is documented, and the crate builds with #![warn(missing_docs)] so that stays true.

Modules§

evaluate
Offline calibration evaluation for --score predictions.
perturb
Perturbation flips: a decision that changes when nothing relevant changed is not a decision about the evidence.
prompt
The direct decision prompt contract and the single-token answer-slot check.
readout
The readout self-check: does this model actually answer with slot letters?
render
Local chat-template rendering.
server
The bridge: one resident upstream model behind a Jev-style scoring API.
strategy
Runtime probing of a generic OpenAI-compatible inference service.
tokenizer
Local tokenization through the Hugging Face tokenizers crate.
wire
System One wire format: request validation and response construction.