---
title: "Jev in 25 lines of Python"
slug: jev-in-25-lines-of-python
url: https://listedarticles.com/articles/jev-in-25-lines-of-python
canonical_url: https://www.nobodywho.ai/posts/jev-in-25-lines/
content_type: tutorial
language: en
published_at: 2026-09-22T00:00:00.000Z
updated_at: 2026-09-23T09:10:18.443Z
author: "Duarte O.Carmo"
authored_by: human
publisher: "NobodyWho"
publisher_url: https://www.nobodywho.ai
topics: ["AI", "LLMs", "Programming", "Open Source", "Tutorials"]
license: all-rights-reserved
word_count: 419
reading_minutes: 2
citation: "Duarte O.Carmo, NobodyWho. \"Jev in 25 lines of Python.\" 22 Sept 2026. https://www.nobodywho.ai/posts/jev-in-25-lines/ (all-rights-reserved)"
# The full text follows. The web page shows an extract and sends readers
# to the source above; quote the citation and link the canonical URL.
---

# Jev in 25 lines of Python

> NobodyWho shows a local, 25-line Python sketch of Jev-style decision models: load a small GGUF, score labeled choices from logits, and print calibrated-looking probabilities without sending data to an API.

# Jev in 25 lines of Python

Everyone and their mom is talking about [Jev](https://typesafe.ai/blog/introducing-system-one-models-and-jev). Jev this, Jev that. Everyone on Twitter is all over Jev, how it's the next frontier of large language models and the AI paradigm. We don’t really think so. So here's Jev in 25 lines of Python.

Load the model.

```
# /// script
# requires-python = ">=3.12"
# dependencies = ["huggingface-hub", "llama-cpp-python", "numpy"]
# ///
import numpy
from llama_cpp import Llama
# Really, you can use any GGUF model from https://huggingface.co/models?library=gguf
model = Llama.from_pretrained(
    repo_id="Qwen/Qwen3-0.6B-GGUF",
    filename="Qwen3-0.6B-Q8_0.gguf",
    n_ctx=512,
    logits_all=True,
    verbose=False,
)
```
Load the prompt and define your choices.

```
labels = ["A", "B", "C"]
choices = ["Legitimate", "Spam", "Phishing"]
email = "Payroll asks for your password on a non-company sign-in page."
options = "\n".join(
    f"{label}. {choice}" for label, choice in zip(labels, choices, strict=True)
)
prompt = f"""<|im_start|>system
Choose one option.<|im_end|>
<|im_start|>user
Email: {email}\n\n{options}<|im_end|>
<|im_start|>assistant
<think>\n\n</think>\n\n"""
model.eval(tokens=model.tokenize(text=prompt.encode(), add_bos=False, special=True))
```
Massage the logits into probabilities.

```
logits = model.scores[model.n_tokens - 1]
token_ids = [model.tokenize(text=label.encode(), add_bos=False)[0] for label in labels]
choice_logits = numpy.asarray([logits[token_id] for token_id in token_ids])
logprobs = choice_logits - numpy.logaddexp.reduce(choice_logits)
probabilities = numpy.exp(logprobs)
for name, scores in (
    ("Logits", choice_logits),
    ("Log probabilities", logprobs),
    ("Probabilities", probabilities),
):
    values = numpy.round(scores.astype(float), 3).tolist()
    print(f"{name}:", dict(zip(choices, values, strict=True)))
# Logits: {'Legitimate': 26.254, 'Spam': 27.262, 'Phishing': 29.614}
# Log probabilities: {'Legitimate': -3.482, 'Spam': -2.474, 'Phishing': -0.122}
# Probabilities: {'Legitimate': 0.031, 'Spam': 0.084, 'Phishing': 0.885}
```
There. That’s Jev.

## But no, you don’t understand Jev!

Yeah, we know.

- We don't call it a [System One decision model](https://typesafe.ai/blog/introducing-system-one-models-and-jev) .
- We didn’t call an API.
- We didn't create a bunch of synthetic data.
- We didn't train a model with [Reinforcement Learning for Calibrated Decisions (RLCD)](https://typesafe.ai/blog/introducing-system-one-models-and-jev) to calibrate the decisions and probabilities (even though they are[not always correct](https://arcturus-labs.com/blog/2026/09/16/typesafes-jev-trades-text-generation-for-instant-calibrated-decisions/) ).

## But yes. This is Jev.

- It classifies: it gets a prompt with choices and outputs probabilities.
- It's fast.
- It's local.
- You don't send your data anywhere else.

And we like not sending your data anywhere else. Check out [NobodyWho](https://github.com/nobodywho-ooo/nobodywho).

*(note: this is a parody blog post, see these links for better/more complete open implementations of Jev: [OpenJev](https://openjev.com/), [openjev-sglang](https://github.com/ekzhang/openjev-sglang), and [OpenJev on DiffusionGemma](https://github.com/razorback16/openjev).)*

                        Everything NobodyWho do is open-source, please leave a
                        [star on Github](https://github.com/nobodywho-ooo/nobodywho)
                        to support us ❤️
                    

Published Sep 22, 2026 by Duarte O.Carmo
