shipwithjev

Catalog / Research & data

0462GitHub

LLM2Jev

Adapts a local language model into a Jev-style decision engine, answering runtime-defined Choice, Score and Noul questions through SGLang.

Yinsongxu/LLM2JevREADME ↗
# LLM2Jev: Turn LLMs into Jev-Style Decision Models
<br/>

[](pyproject.toml)
[](LICENSE)
[](docs/usage.md)

[简体中文](README_zh.md)

**LLM2Jev adapts local language models to Jev-style structured decisions. It accepts runtime-defined `Choice`, `Score`, and `Noul` questions and returns typed answers with probabilities.**

</div>

> LLM2Jev is an independent open-source project. It is not affiliated with or endorsed by Jev or TypeSafe.


## Key Features

- **Structured decisions:** define `Choice`, `Score`, and `Noul` questions at runtime. Get option probabilities, weighted scores, or the probability that a condition is true.
- **Probabilities from logits:** score each candidate with an independent yes/no judgment, then assemble JSON in code. No answer tokens are generated.
- **Order-independent options:** evaluate each Choice candidate independently, so reordering options does not introduce a positional preference or change their scores.
- **Shared-prefix caching:** stage candidate submissions to reuse SGLang's Radix Cache within a single request, including a first request with no relevant cached prefix.

Candidates share `state`, and candidates for the same question also share its `instructions`. LLM2Jev first scores a real `criteria` candidate to establish the prefix cache, then submits candidates that can reuse it. Each candidate is scored once, reducing repeated computation for long inputs with many candidates.



Learn how it works: [From Jev Request to LLM Request](docs/request-to-model.md) → [Shared-prefix design](docs/shared-prefix-cache.md).

## News

- **September 21** - **[Web and Snake demos](#demos):** added interactive examples for composing mixed questions and model-driven decisions.
- **September 21** - **Shared-prefix reuse:** added staged candidate submis

Also filed under Research & data