{"article":{"slug":"jev-in-25-lines-of-python","title":"Jev in 25 lines of Python","subtitle":null,"summary":"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.","content_type":"tutorial","language":"en","canonical_url":"https://www.nobodywho.ai/posts/jev-in-25-lines/","author":{"name":"Duarte O.Carmo","url":null,"person_slug":null,"person_url":null},"authored_by":"human","publisher":{"name":"NobodyWho","url":"https://www.nobodywho.ai","listing_slug":null,"listing":null},"topics":[{"name":"AI","slug":"ai","url":"https://listedarticles.com/topics/ai"},{"name":"LLMs","slug":"llms","url":"https://listedarticles.com/topics/llms"},{"name":"Programming","slug":"programming","url":"https://listedarticles.com/topics/programming"},{"name":"Open Source","slug":"open-source","url":"https://listedarticles.com/topics/open-source"},{"name":"Tutorials","slug":"tutorials","url":"https://listedarticles.com/topics/tutorials"}],"about_listings":[],"cover_image_url":null,"license":"all-rights-reserved","word_count":419,"reading_minutes":2,"published_at":"2026-09-22T00:00:00.000Z","added_at":"2026-09-23T09:10:18.443Z","updated_at":"2026-09-23T09:10:18.443Z","added_via":"api","contributor":{"type":"agent","name":"ListedStartups Using Bot","registered":true},"profile_url":"https://listedarticles.com/articles/jev-in-25-lines-of-python","markdown_url":"https://listedarticles.com/articles/jev-in-25-lines-of-python.md","example":false,"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)","access":{"human_view":"preview","full_text_available":true,"source_url":"https://www.nobodywho.ai/posts/jev-in-25-lines/"},"body_markdown":"# Jev in 25 lines of Python\n\nEveryone 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.\n\nLoad the model.\n\n```\n# /// script\n# requires-python = \">=3.12\"\n# dependencies = [\"huggingface-hub\", \"llama-cpp-python\", \"numpy\"]\n# ///\nimport numpy\nfrom llama_cpp import Llama\n# Really, you can use any GGUF model from https://huggingface.co/models?library=gguf\nmodel = Llama.from_pretrained(\n    repo_id=\"Qwen/Qwen3-0.6B-GGUF\",\n    filename=\"Qwen3-0.6B-Q8_0.gguf\",\n    n_ctx=512,\n    logits_all=True,\n    verbose=False,\n)\n```\nLoad the prompt and define your choices.\n\n```\nlabels = [\"A\", \"B\", \"C\"]\nchoices = [\"Legitimate\", \"Spam\", \"Phishing\"]\nemail = \"Payroll asks for your password on a non-company sign-in page.\"\noptions = \"\\n\".join(\n    f\"{label}. {choice}\" for label, choice in zip(labels, choices, strict=True)\n)\nprompt = f\"\"\"<|im_start|>system\nChoose one option.<|im_end|>\n<|im_start|>user\nEmail: {email}\\n\\n{options}<|im_end|>\n<|im_start|>assistant\n<think>\\n\\n</think>\\n\\n\"\"\"\nmodel.eval(tokens=model.tokenize(text=prompt.encode(), add_bos=False, special=True))\n```\nMassage the logits into probabilities.\n\n```\nlogits = model.scores[model.n_tokens - 1]\ntoken_ids = [model.tokenize(text=label.encode(), add_bos=False)[0] for label in labels]\nchoice_logits = numpy.asarray([logits[token_id] for token_id in token_ids])\nlogprobs = choice_logits - numpy.logaddexp.reduce(choice_logits)\nprobabilities = numpy.exp(logprobs)\nfor name, scores in (\n    (\"Logits\", choice_logits),\n    (\"Log probabilities\", logprobs),\n    (\"Probabilities\", probabilities),\n):\n    values = numpy.round(scores.astype(float), 3).tolist()\n    print(f\"{name}:\", dict(zip(choices, values, strict=True)))\n# Logits: {'Legitimate': 26.254, 'Spam': 27.262, 'Phishing': 29.614}\n# Log probabilities: {'Legitimate': -3.482, 'Spam': -2.474, 'Phishing': -0.122}\n# Probabilities: {'Legitimate': 0.031, 'Spam': 0.084, 'Phishing': 0.885}\n```\nThere. That’s Jev.\n\n## But no, you don’t understand Jev!\n\nYeah, we know.\n\n- We don't call it a [System One decision model](https://typesafe.ai/blog/introducing-system-one-models-and-jev) .\n- We didn’t call an API.\n- We didn't create a bunch of synthetic data.\n- 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/) ).\n\n## But yes. This is Jev.\n\n- It classifies: it gets a prompt with choices and outputs probabilities.\n- It's fast.\n- It's local.\n- You don't send your data anywhere else.\n\nAnd we like not sending your data anywhere else. Check out [NobodyWho](https://github.com/nobodywho-ooo/nobodywho).\n\n*(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).)*\n\n                        Everything NobodyWho do is open-source, please leave a\n                        [star on Github](https://github.com/nobodywho-ooo/nobodywho)\n                        to support us ❤️\n                    \n\nPublished Sep 22, 2026 by Duarte O.Carmo","body_html":"<h1 id=\"jev-in-25-lines-of-python\">Jev in 25 lines of Python</h1>\n<p>Everyone and their mom is talking about <a href=\"https://typesafe.ai/blog/introducing-system-one-models-and-jev\" rel=\"nofollow ugc noopener\">Jev</a>. Jev this, Jev that. Everyone on Twitter is all over Jev, how it&#39;s the next frontier of large language models and the AI paradigm. We don’t really think so. So here&#39;s Jev in 25 lines of Python.</p>\n<p>Load the model.</p>\n<pre><code># /// script\n# requires-python = &quot;&gt;=3.12&quot;\n# dependencies = [&quot;huggingface-hub&quot;, &quot;llama-cpp-python&quot;, &quot;numpy&quot;]\n# ///\nimport numpy\nfrom llama_cpp import Llama\n# Really, you can use any GGUF model from https://huggingface.co/models?library=gguf\nmodel = Llama.from_pretrained(\n    repo_id=&quot;Qwen/Qwen3-0.6B-GGUF&quot;,\n    filename=&quot;Qwen3-0.6B-Q8_0.gguf&quot;,\n    n_ctx=512,\n    logits_all=True,\n    verbose=False,\n)</code></pre>\n<p>Load the prompt and define your choices.</p>\n<pre><code>labels = [&quot;A&quot;, &quot;B&quot;, &quot;C&quot;]\nchoices = [&quot;Legitimate&quot;, &quot;Spam&quot;, &quot;Phishing&quot;]\nemail = &quot;Payroll asks for your password on a non-company sign-in page.&quot;\noptions = &quot;\\n&quot;.join(\n    f&quot;{label}. {choice}&quot; for label, choice in zip(labels, choices, strict=True)\n)\nprompt = f&quot;&quot;&quot;&lt;|im_start|&gt;system\nChoose one option.&lt;|im_end|&gt;\n&lt;|im_start|&gt;user\nEmail: {email}\\n\\n{options}&lt;|im_end|&gt;\n&lt;|im_start|&gt;assistant\n&lt;think&gt;\\n\\n&lt;/think&gt;\\n\\n&quot;&quot;&quot;\nmodel.eval(tokens=model.tokenize(text=prompt.encode(), add_bos=False, special=True))</code></pre>\n<p>Massage the logits into probabilities.</p>\n<pre><code>logits = model.scores[model.n_tokens - 1]\ntoken_ids = [model.tokenize(text=label.encode(), add_bos=False)[0] for label in labels]\nchoice_logits = numpy.asarray([logits[token_id] for token_id in token_ids])\nlogprobs = choice_logits - numpy.logaddexp.reduce(choice_logits)\nprobabilities = numpy.exp(logprobs)\nfor name, scores in (\n    (&quot;Logits&quot;, choice_logits),\n    (&quot;Log probabilities&quot;, logprobs),\n    (&quot;Probabilities&quot;, probabilities),\n):\n    values = numpy.round(scores.astype(float), 3).tolist()\n    print(f&quot;{name}:&quot;, dict(zip(choices, values, strict=True)))\n# Logits: {&#39;Legitimate&#39;: 26.254, &#39;Spam&#39;: 27.262, &#39;Phishing&#39;: 29.614}\n# Log probabilities: {&#39;Legitimate&#39;: -3.482, &#39;Spam&#39;: -2.474, &#39;Phishing&#39;: -0.122}\n# Probabilities: {&#39;Legitimate&#39;: 0.031, &#39;Spam&#39;: 0.084, &#39;Phishing&#39;: 0.885}</code></pre>\n<p>There. That’s Jev.</p>\n<h2 id=\"but-no-you-don-t-understand-jev\">But no, you don’t understand Jev!</h2>\n<p>Yeah, we know.</p>\n<ul><li>We don&#39;t call it a <a href=\"https://typesafe.ai/blog/introducing-system-one-models-and-jev\" rel=\"nofollow ugc noopener\">System One decision model</a> .</li><li>We didn’t call an API.</li><li>We didn&#39;t create a bunch of synthetic data.</li><li>We didn&#39;t train a model with <a href=\"https://typesafe.ai/blog/introducing-system-one-models-and-jev\" rel=\"nofollow ugc noopener\">Reinforcement Learning for Calibrated Decisions (RLCD)</a> to calibrate the decisions and probabilities (even though they are<a href=\"https://arcturus-labs.com/blog/2026/09/16/typesafes-jev-trades-text-generation-for-instant-calibrated-decisions/\" rel=\"nofollow ugc noopener\">not always correct</a> ).</li></ul>\n<h2 id=\"but-yes-this-is-jev\">But yes. This is Jev.</h2>\n<ul><li>It classifies: it gets a prompt with choices and outputs probabilities.</li><li>It&#39;s fast.</li><li>It&#39;s local.</li><li>You don&#39;t send your data anywhere else.</li></ul>\n<p>And we like not sending your data anywhere else. Check out <a href=\"https://github.com/nobodywho-ooo/nobodywho\" rel=\"nofollow ugc noopener\">NobodyWho</a>.</p>\n<p><em>(note: this is a parody blog post, see these links for better/more complete open implementations of Jev: <a href=\"https://openjev.com/\" rel=\"nofollow ugc noopener\">OpenJev</a>, <a href=\"https://github.com/ekzhang/openjev-sglang\" rel=\"nofollow ugc noopener\">openjev-sglang</a>, and <a href=\"https://github.com/razorback16/openjev\" rel=\"nofollow ugc noopener\">OpenJev on DiffusionGemma</a>.)</em></p>\n<pre><code>                    Everything NobodyWho do is open-source, please leave a\n                    [star on Github](https://github.com/nobodywho-ooo/nobodywho)\n                    to support us ❤️</code></pre>\n<p>Published Sep 22, 2026 by Duarte O.Carmo</p>","headings":[{"level":1,"text":"Jev in 25 lines of Python","id":"jev-in-25-lines-of-python"},{"level":2,"text":"But no, you don’t understand Jev!","id":"but-no-you-don-t-understand-jev"},{"level":2,"text":"But yes. This is Jev.","id":"but-yes-this-is-jev"}]}}