Skip to main content

jev_bridge/
lib.rs

1//! Bridge a generic OpenAI-compatible inference API into a Jev-style decision
2//! scoring service.
3//! Jev-style decisions are not a model format; they are a readout. This crate
4//! implements that readout on top of any runtime that can return next-token log
5//! probabilities:
6//!
7//! 1. render the `direct-options-v1` prompt through the serving runtime's own
8//!    chat template, with thinking disabled;
9//! 2. read the log probabilities of the fixed uppercase answer letters at the
10//!    final position;
11//! 3. softmax only over the declared options, so no other vocabulary can leak
12//!    into the distribution;
13//! 4. answer in the System One wire format with `choice`, `noul` and `score`
14//!    questions.
15//!
16//! No model weights are copied and no answer text is generated: a decision
17//! costs one prompt evaluation and zero output tokens.
18//!
19//! # Layout
20//!
21//! * [`strategy`] probes the upstream service and parses the response shapes
22//!   different runtimes use for the same distribution.
23//! * [`prompt`] owns the prompt contract, the single-token answer-slot check
24//!   and the softmax.
25//! * [`server`] holds [`server::Bridge`] and the HTTP surface.
26//! * [`wire`] validates System One requests and builds their responses.
27//!
28//! The `jev-bridge` binary is a thin CLI over [`server::Bridge`].
29//!
30//! # Documentation
31//!
32//! Every public item is documented, and the crate builds with
33//! `#![warn(missing_docs)]` so that stays true.
34
35#![warn(missing_docs)]
36
37pub mod prompt;
38pub mod render;
39pub mod server;
40pub mod strategy;
41#[cfg(feature = "local-tokenizer")]
42pub mod tokenizer;
43pub mod wire;