jevlang
Python dialect that adds a '~' operator and jev/case blocks so a branch can ask Jev a yes/no, scale or choice question.
Overview
jevlang lets you write decision workflows as Python with a 'smart if'. A .jev file is ordinary Python plus two forms: value ~ question, which returns a probability, a scale position or a label, and a jev/case block that branches on a choice question. Files are rewritten to plain Python at import time by an import hook, so callers just import the module and receive floats and strings.
The question's shape picks its type: a string is a yes/no question, a list is an ordered scale and a dict is a set of labelled options. Every ~ is one paid call to TypeSafe's Jev, and the value on the left is what gets sent, so the README warns to keep secrets out and to guard important branches because answers are probabilities. It ships a skill for coding agents such as Claude Code, Codex and Cursor. The author calls it a tested, working prototype.
What the decision model decides
| Type | Question | Answers |
|---|---|---|
| Yes / no | Does the customer want a refund? (msg ~ 'the customer wants a refund') | — |
| Score | How annoyed is the sender? (msg ~ ['calm','annoyed','angry']) | calm · annoyed · angry |
| Choice | Which team should handle this? | billing · technical |
How it works
- Write a .jev module using ~ and jev/case
- Import it; the hook rewrites it to plain Python
- Each ~ calls Jev with the value as state and the question
- Threshold, rank or branch on the returned number or label, with an else fallback
Strengths
- Decision logic reads as ordinary Python control flow
- No new interpreter; --show prints the generated Python without an API call
- Return values are plain floats and strings with probabilities attached
Caveats
- Every ~ is a paid network call
- Prototype status by the author's own description
- Whatever is left of ~ is sent to the API
Getting started
pip install jevlang, export TYPESAFE_API_KEY=..., then python -m jevlang hello.jevAt a glance
- Type
- Project
- Status
- prototype
- Language
- Python
- Runtime
- Python 3.10+ import hook
- Has code
- yes
- Has tests
- yes
- License
- MIT
Use cases and integrations
How curated lists describe it
The simplest way to write decision workflows in Python. Python with a smart if.
logicrw/awesome-jev-projects
Frequently asked questions
What does ~ return?
A probability for a string question, a scale position for a list, or a label for a dict of options.
Is it a new language runtime?
No. .jev files are rewritten to plain Python at import time.
What does it cost?
Each ~ is one TypeSafe API call billed to your key.
Related projects
Rust crate and jud CLI where a decision is a .jud rubric file answered by a System One model, type-checked and testable without a key.
PluginbetaRustSimon Willison's LLM plugin that adds Jev as a model for yes/no, choice and score questions from the command line.
PluginproductionPythonGo integration bringing TypeSafe Choice, Score and Noul to Google's adk-go agents, with a typed client, routing agent and callbacks.
ProjectbetaGoUnofficial hosted or local Jev MCP server giving agents a quick second opinion: it picks yes/no, scale or choice and returns probabilities.
MCP serverbetaTypeScriptCLI, MCP server and Claude Code plugin for closed-form yes/no, choice, score and rank decisions via Jev, OpenAI Decisions or Claude.
MCP serverbetaTypeScriptRuby gem for probabilistic conditionals like Feelings(msg).like?("urgent"), answered by Jev or other decision models.
ProjectbetaRuby