Jevify: run your local models as a Jevlike endpoint

After seeing the success of Jev and seeing all the people trying to replicate it with open weights, I wanted to see if it would be feasible to get DeepSeek-V4-Flash to act like it without messing up with my local deploy.

So I built Jevify, which creates a super simple API endpoint that mimics Jev’s own. It’s a super simple app and it can be installed with uv pip install jevify.

It turns out, it works – and it seems to work very well with smaller models. It runs by reading the answer straight off the model’s next-token distribution.

Jevify now lets me have DSv4Flash making structured decisions while only waiting for prefill. It feels pretty amazing to be able to do that.

Things get pretty incredible if you experiment with faster GPUs and smaller models. Ternary Bonsai (the ultra-quantized Qwen3.8-27B) seems to be very good for applications like these and can get truly insane speeds (<100 ms) on my 4090.

Jevify is MIT licensed. Hope you guys like it.

Here is Ternary Bonsai using its multimodal projector to play Doom with Jevify. ~100 ms per action!

When I first saw this I didn’t really get it because I hadn’t heard of Jev. This is really cool. Do you know how much faster this is over having it respond with JSON and waiting for the complete decode? It’d be interesting to have some percentages. Really neat.

It also seems like this is a great target for a fine-tuned model. There might be a lot of low-hanging fruit to pick in creating a fine-tuning dataset as Jevify is used. Maybe that could be automated too.

This has really captured my attention so I’m doing a deep dive on it. Maybe I’m wrong, but it seems like Jevify is using the highest candidate probability directly as the confidence, which is different. So if it had:

A: 0.90,
B: 0.06,
C: 0.04

it would output 0.90 as the confidence when the page linked below shows it should be 0.85?

Again, maybe I just couldn’t figure out where you’re doing this already, but if you’re not already, here’s an implementation I made in JavaScript.

function confidence(probabilities, decimals = 2) {
  const values = Object.values(probabilities);

  if (values.length === 0) {
    throw new Error("At least one probability is required.");
  }

  const largest = Math.max(...values);
  const n = values.length;

  const rawConfidence =
    n === 1 ? 1 : (n * largest - 1) / (n - 1);

  const clamped = Math.max(0, Math.min(1, rawConfidence));
  const factor = 10 ** decimals;

  return Math.round((clamped + Number.EPSILON) * factor) / factor;
}

// Clear winner
console.log(confidence({
  A: 0.90,
  B: 0.06,
  C: 0.04
})); // 0.85

// Spread out
console.log(confidence({
  A: 0.40,
  B: 0.33,
  C: 0.27
})); // 0.10

// Even split
console.log(confidence({
  A: 0.33,
  B: 0.33,
  C: 0.33
})); // 0.00

Note this only supports ds4 vision right now. I’m running 0731 on 2x sparks so had to use qwen3-embedding-0.6b.local.yaml instead along side on the head node. Really love the binary compatibility with jev systemone. Hopefully, we’ll see some open RLCD post trained weights on open datasets soon.

Example bash script to get a network based jev binary compatible script. Assumes git pull of jevify to ~/Documents/git. Biggest difference from repo’s README.md is detaching and use of 0.0.0.0 host for network based access.

pkill jevify
cd ~/Documents/git/jevify
jevify probe recipes/qwen3-embedding-0.6b.local.yaml
jevify serve recipes/qwen3-embedding-0.6b.local.yaml --host 0.0.0.0 --port 8600 > ~/jevify_logs 2>&1 &
echo "jevify started and logs to ~/jevify_logs"

Disclaimer: agent created post. However, I thought this was cool enough that I wanted to share the gist and wouldn’t be able to convey it properly/succinctly. I don’t game so glm53f spawned a server hosting this tile board game shown below and ran code against Playwright.


Been playing with Jev-style decisions served off my own stack. TypeSafe’s pitch is a model that never generates text: state in, typed probabilities out. I wanted that without another model to host, so I tried reading decisions straight off the GLM-5.3-Flash logits — options in the prompt, stop after prefill, take the first token’s top logprobs, softmax over the option tokens. No sampling, no decode loop, nothing generated.

The trick is where you stop the assistant turn. Chat models want to open with “The” or wrap answers in markdown, so you prefill “Answer: (” and the letter slot carries the decision — A/B/C/D read straight from the logit distribution. Three probes to find the slot on a new model, and that’s the whole setup cost.

Wrapped it as an endpoint in my API. Model and readout slot are runtime config keys, so reassigning the model is a UI edit and nothing is hardcoded. No training anywhere.

Ran the public JevBench subset (231 of 534, their harness and scoring, untrained readout):

tier sys1 readout (untrained) Jev 1.13.0 (published)
easy (48) 100.0% 100.0%
standard (72) 93.1% 99.0%
hard (111) 73.9% 74.1%
hard ECE 0.079 —

Hard tier is the interesting one. Every no-decode system lands 60-76% there regardless of training — SemIf 59.5, jqv 64.5, Jev 74.1 with their RLCD, mine 73.9 with none. The misses are date arithmetic and multi-clause policy: stuff that needs a scratchpad, and a single forward pass doesn’t have one. Generation models with reasoning on go higher (Luna-low: 94.5 hard) but that’s a different interface wearing the same API — they’re ranked together on the boards and shouldn’t be.

Throughput: the 2048 game prompt is 127 tokens. End-to-end decision through my API proxy averages ~390ms, of which ~55ms is prefill — the rest is per-call overhead (API hop, engine scheduling). ~2.5 decisions/s serial, sharing the engine with whatever else is running. Video attached: the model plays 2048 through the endpoint, one choice call per move.

Anyone on stock vLLM can do this today: logprobs + top_logprobs + continue_final_message. No forks, no training, no extra model.

Nice, you should consider sharing your code. It sounds like it’s relatively simple in terms of code?

glm53f wrote the following response and simplified the actual implementation into a cleaner/shorter answer. The way it’s built supports endpoints /system-one/ask and /system-one/batch for one v multiple requests in the payload. The morn started with me pulling in a few YT videos about Jev because I had no idea what it was. By the afternoon my API supported this approach. Still have yet to use it for anything outside of testing. Wanted to be clear about that.


Yes — it’s genuinely small. The whole readout is one prompt render plus one chat-completions call with the assistant turn stopped at the right token. Here’s the core, cleaned out of my stack’s plumbing:

import math
import requests

BASE_URL = "http://localhost:8000/v1"  # stock vLLM OpenAI server
PREFILL = "Answer: ("                  # the readout slot — see note below

def decide(state: str, question: str, options: list[str], model: str):
    tokens = [chr(ord("A") + i) for i in range(len(options))]  # A, B, C, ...
    rendered = " ".join(f"({t}) {o}" for t, o in zip(tokens, options))
    user = f"State: {state}\nQuestion: {question}\nOptions: {rendered}"

    resp = requests.post(f"{BASE_URL}/chat/completions", json={
        "model": model,
        "messages": [
            {"role": "user", "content": user},
            {"role": "assistant", "content": PREFILL},
        ],
        "continue_final_message": True,  # vLLM extras: extend the assistant turn...
        "add_generation_prompt": False,  # ...instead of opening a new one
        "max_tokens": 1, "temperature": 0,
        "logprobs": True, "top_logprobs": 15,
    }).json()

    top = resp["choices"][0]["logprobs"]["content"][0]["top_logprobs"]
    probs = {e["token"]: math.exp(e["logprob"]) for e in top}

    mass = {t: probs.get(t, 0.0) for t in tokens}
    total = sum(mass.values())  # option_mass: did the model accept the frame?
    if not total:
        return None, {}, 0.0
    dist = {o: mass[t] / total for t, o in zip(tokens, options)}
    return max(dist, key=dist.get), dist, total

Two flags that are the difference between working and not:

  • The two vLLM extras are what make the prefill trick possible. With the default add_generation_prompt=True the model ignores your assistant message and regenerates the turn.
  • Option tokens must be single tokens: letters A–O for choices, digits 0–9 for scores (that’s what caps a rubric at ten levels). top_logprobs=15 is what bounds cardinality — raise it if your server allows.

Example against one state — three question types, live output:

state = "Customer says they were charged twice for one order and wants the duplicate refunded."

decide(state, "Which team should handle this?",
       ["billing", "technical", "sales", "other"], model)
# ('billing', {'billing': 0.9982, 'technical': 0.0013, 'sales': 0.0002, 'other': 0.0003}, 0.9999)

decide(state, "How time-sensitive is this request?",
       ["not urgent", "low", "elevated", "urgent"], model)
# ('elevated', {'not urgent': 0.0048, 'low': 0.0585, 'elevated': 0.5551, 'urgent': 0.3815}, 0.9999)

decide(state, "Is a refund being requested?", ["yes", "no"], model)
# ('yes', {'yes': 0.9991, 'no': 0.0009}, 1.0)

Return tuple is (answer, distribution, option_mass). Note the urgency call: “elevated 0.56 / urgent 0.38” is graded information the argmax flattens — that’s why the distribution is the thing to consume, not the argmax. Nothing is sampled anywhere; everything above is read straight off the first token.

The prefill is model-dependent, and it’s worth deriving rather than guessing: chat models want to open sentences (The at 95% with no prefill) or decorate answers (** at 72% after a plain "Answer: "). Three probes: no prefill → look at the top tokens; "Answer: " → the dominant format token is the model’s preferred next step; append that token and re-probe until the option tokens hold ≥ 0.9 of the mass. Takes about two minutes per model.

On the confidence metric from your post above: I don’t emit a scalar confidence at all, so I never had to pick between max-prob and the (n·max−1)/(n−1) rescale — for a fixed option set that formula is an affine remap of max, so it can’t change any ordering or threshold decision. What I report instead:

  • the distribution, normalized over the option tokens, and
  • option_mass — the share of the raw first-token distribution sitting on option tokens. That’s the number that actually matters here: low mass means the model is fighting the slot, and the readout is unreliable no matter which option is argmax. Below a threshold I fall back to a normal generation call.

Also worth being explicit: untrained, the distributions rank correctly but the absolute values are the model’s raw opinion. If a workload ever needs calibrated thresholds, one fitted temperature is the lightest fix — a training run is overkill for a scalar.

On speed vs decoding JSON: the readout costs one prefill pass, so the speedup is roughly “the number of tokens you didn’t decode” — every decoded token is another full forward pass. Concretely, a 127-token state prefills in ~55 ms on my box; end-to-end through my API proxy it averages ~390 ms, most of that being per-call overhead rather than model time; and fanning out N questions against one state costs about one prefill total because the state prefix rides vLLM’s prefix cache. I haven’t run a clean same-engine A/B against JSON decoding, but the arithmetic is the token count of the JSON answer.

On your fine-tuning idea: plausible, but my JevBench numbers (73.9% on the hard tier, untrained, vs 74.1% for the RLCD-trained reference) suggest the headroom is in calibration rather than knowledge. And if you want a maintained starting point, fidecastro’s jevify already packages this exact pattern.

Thanks, that was helpful for my understanding. I feel like this is a new area in LLMs. In hindsight, it’s surprising it wasn’t something sooner. I hope more people engage with this thread because I feel like there’s a lot of dig into. I found an example of a fine-tuned model: GitHub - jaredpalmer/kev: tiny Jev-like family of decision models built on top of Qwen3.5 you can train and run on your own · GitHub

The hindsight makes it seem like this should’ve been something being built around a few years ago, but agreed, a really cool concept which would benefit from everyone’s contributions. It felt crazy to me the first time I had a state machine running LLM requests. Integrating intelligence into something historically deterministic was powerful. This is just a stripped down form of that needing the right applications. That’s the whole reason I made it work for single shot and batched requests. I can see a lot of value from code requiring an intelligent decision being served over a single method holding that API call, or giving an agent the ability to call the endpoint (or MCP tool) to batch characterize something mid-session. The game demos are fun now but there’s a lot of potential to unearth.

I mean BERT was a thing and then we all got distracted by the new shiny building of bigger and bigger LLMs because more tokens and passes are always better. :-)

Can you tell me what happened when you tried it? Jevify should support any model, not just ds4 vision. It queries the endpoints from llama.cpp/vllm directly, so to the extent there were any issues running it with 0731, these are likely coming from the inference engines themselves.

Thanks a lot for seeing this! I’m fixing it right now; should be in the repo soon.

Exactly!

I’ve been toying around with the idea of using Qwen3-Embedding as a part of a game engine for a while, since it’s the only embedding model I know that was instruction-tuned. My thought was that it could do simple decisions fast, since a query would, in principle, direct to its natural response. Now Jev’s idea makes this type of work explicitly, and (almost) just as fast.

If anyone is willing to collaborate on this project, let me know. It’s simple enough as it is and can just be forked away, but I’ll gladly open it for collaborators.

Do you think there’s still anything Jev does that’s currently missing, aside from purportedly using a specifically trained model?

So is the point of this to basically scrape off the first choice of response from the model for use in real-time applications? It seems really interesting.

Yes that’s basically the point, but it also constrains everything to allow that to happen. It’s like setting the model up to answer multiple choice questions. Then it only has to say “A” or “C”.

Multiple choice, rank, and also noul, but same idea just presented slightly differently. Restrict to a single token request such that only one forward pass is used.