Jev in 25 Lines of Python

Hacker News by 3 min read 509x views
Jev in 25 Lines of Python

Share Post

My name is Jev

Everyone and their mom is talking concerning Jev. Jev this, Jev that. Everyone on Twitter is all complete Jev, how it's the next frontier of ample tongue models and the AI paradigm. We don’t really think so. So here's Jev in 25 lines of Python.

Load the model.

 import numpy from llama_cpp import Llama 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 immediate 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 tag 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))) 

There. That’s Jev.

But no, you don’t comprehend Jev!

Yeah, we know.

But yes. This is Jev.

  • It classifies: it gets a immediate alongside choices and outputs probabilities.
  • It's fast.
  • It's local.
  • You don't dispatch your data anyplace else.

And we akin not sending your data anyplace else. Check out NobodyWho.

(note: this is a parody blog post, see these links for better/more complete open implementations of Jev: OpenJev, openjev-sglang, and OpenJev on DiffusionGemma.)


Everything NobodyWho do is open-source, delight depart a star on Github to assistance us ❤️

Published Sep 22, 2026 by Duarte O.Carmo

Technical

Other Article Hacker News
↑
Close Right Ads
Close Left Ads