Skip to content

polyjev

Typed, probabilistic decisions from any model.

polyjev asks a model a fixed set of questions about some state (a ticket, a document, a JSON object, an image) and gives back typed answers with probabilities, never free text:

type answers example
noul a probability of yes Does the customer need a reply within the hour? → 0.93
choice one option + a distribution over all options Which team owns this? → outage (0.88)
score a level on an ordered scale + its distribution How angry is the customer? → annoyed, score 1.4 of 2
span / spans values copied from the input, with offsets and confidence the invoice id → A-1042 at [9:15]

It is an open-source take on the "System One" idea behind TypeSafe's Jev: fast, bounded decisions for software, rather than long text for people. Unlike Jev, it runs on any model:

  • hosted APIs: OpenAI, Anthropic Claude, Google Gemini, OpenRouter, Together, Groq, DeepSeek, Mistral, xAI, …
  • open models on your GPUs: vLLM, SGLang, llama.cpp, Ollama, LM Studio, on a workstation or an HPC cluster
  • in-process: Hugging Face models loaded straight into your job

It speaks Jev's HTTP API (POST /v1/systemone), so Jev and djev clients work against it unchanged.

import polyjev as pj

judge = pj.Polyjev("vllm/local")      # or "anthropic/claude-opus-5", "openai/gpt-5.6-luna", ...
d = judge.decide(
    {"ticket": "Everything is down and we have a demo at noon."},
    {
        "urgent": pj.Noul("Does the customer need a reply within the hour?"),
        "team": pj.Choice("Which team owns this?", {"billing": None, "outage": "service down", "feature": None}),
        "tone": pj.Score("How angry is the customer?", ["calm", "annoyed", "furious"]),
    },
)
d["urgent"].p          # 0.999
d["team"].value        # 'outage'
d["tone"].level        # 'annoyed'

Raw output of Qwen3-4B-Instruct-2507 on vLLM (one RTX 5000 Ada), tens of milliseconds per decision. Instruction-tuned models are this sure of themselves; see calibration for how often they should be.

Why typed decisions?

  • Always valid. Answers are read as probabilities over your options, so an answer outside the schema cannot happen and there is nothing to parse.
  • Probabilities, not vibes. Every answer carries a distribution and a confidence, so code can branch on "sure" versus "unsure" and send the unsure ones to a human.
  • Honest numbers. Option-order averaging reduces position bias, and calibration fits each model's probabilities to how often it is actually right.
  • Any model, one contract. Swap Claude for an open model on your cluster by changing one string.

Next: Quickstart · How it works · Deploy on GPUs / HPC

Note

polyjev is not affiliated with TypeSafe. "Jev" is TypeSafe's trademark; polyjev implements the publicly documented /v1/systemone request and response shapes.