logo
Kurashizu Blogwhere ideas flow
  • Home
  • News
  • Blog
  • About
  • Home
  • News
  • Blog
  • About

© 2026 Kurashizu. All rights reserved.

Admin·New Post·Service Status
Powered by Cloudflare·01.11.26
← Back to news

Jev in 25 Lines of Python

Original article
nobodywho.ai|513 points|157 comments|by bashbjorn|Sep 23, 2026

Implementing Jev with 25 Python Lines

It seems like everyone—including your parents—is currently obsessed with Jev. If you've been on Twitter lately, you know it's being hailed as the absolute frontier of the AI paradigm and the future of Large Language Models (LLMs).

🛠️ Prerequisites

Before running the code, ensure you have the following:

  • Python 3.12+
  • huggingface-hub
  • llama-cpp-python
  • numpy

AI Concept

💻 The Implementation

Here is the concise implementation using a GGUF model. You can swap the repo_id for any compatible model found on the Hugging Face GGUF library.

# /// script
# requires-python = ">=3.12"
# dependencies = ["huggingface-hub", "llama-cpp-python", "numpy"]
# ///
import numpy as np
from llama_cpp import Llama

# Initialize model with Qwen3-0.6B
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,
)

# Setup classification parameters
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"{l}. {c}" for l, c in zip(labels, choices, strict=True)])

prompt = f"|im_start| system Choose one option.\n|im_end| |im_start| user Email: {email}\n\n{options} |im_end| |im_start| assistant think\n\n/think\n\n"

# Extract logits for the label tokens
token_ids = [model.tokenize(l.encode(), add_bos=False, special=True)[0] for l in labels]
logits = model(prompt, max_tokens=1, logits_all=True)['logits'][0]
choice_logits = np.asarray([logits[tid] for tid in token_ids])

# Convert logits to probabilities
logprobs = choice_logits - np.log(np.sum(np.exp(choice_logits)))
probabilities = np.exp(logprobs)

for name, scores in [("Logits", choice_logits), ("Log probabilities", logprobs), ("Probabilities", probabilities)]:
    print(f"{name}: {dict(zip(choices, np.tolist(scores), strict=True))}")

⚙️ How it Works

The process follows a linear pipeline from raw text to a probability distribution:

To transform the raw logits into usable probabilities, we essentially apply the softmax function:

P(i)=ezi∑j=1KezjP(i) = \frac{e^{z_i}}{\sum_{j=1}^{K} e^{z_j}}P(i)=∑j=1K​ezj​ezi​​

Where zzz represents the choice_logits for each label.

📊 Results

The output of the script provides a breakdown of how the model perceives the input email:

MetricLegitimateSpamPhishing
Logits26.25427.26229.614
Log Probabilities-3.482-2.474-0.122
Probabilities0.0310.0840.885

⚠️ The Fine Print

Note: This is a parody blog post.

We didn't skipped the process of training a model with Reinforcement Learning for Calibrated Decisions (RLCD) to ensure the probabilities are perfectly calibrated (though, in reality, they aren't always accurate). Essentially, this is just a classifier: it takes a prompt with options and returns the probability of each.

For those seeking serious, production-ready implementations of Jev, please check out these resources:

  • OpenJev
  • openjev-sglang
  • OpenJev on DiffusionGemma

Everything produced by NobodyWho is open-source. If you appreciate the work, please leave a star on GitHub to support us! ❤️

Published Sep 22, 2026 by Duarte O.Carmo (Technical)