CoolFace
Apppublic

async-dime/jevloop

sourceHugging Faceapache-2.0updated 6d agoView on Hugging Face
0likes
App README

JevLoop — distribution-guided text optimization with Jev

JevLoop treats Jev — TypeSafe AI's "System One" decision model that returns typed Noul / Choice / Score answers with calibrated probabilities — not as an argmax classifier, but as a continuous value function inside a closed optimization loop. Every documented and social use case so far (triage, routing, guardrails, bulk labeling, résumé scoring) consumes only the top answer + confidence. JevLoop uses the full probability distributions: per-axis probability mass selects which rubric dimension to attack next (UCB1 bandit), a cross-entropy-method update steers which edit operator is tried next, and the loop stops when the value plateaus and the critic's distribution entropy drops — i.e. when Jev itself says it is sure there is nothing left to gain.

There is no LLM in the loop: the proposer is a set of deterministic edit operators. That is the point — a System One critic plus ~200 lines of code can steer text improvement for ~$0.0004 per critique at 70–500 ms per pass, with zero hallucinated output.

Try it

The app below runs in mock mode by default: a deterministic heuristic critic with the same interface simulates calibrated distributions so the whole loop works offline (no API key, and clearly labelled as a simulation — it demonstrates the control loop, not Jev itself).

To run against the real model, pick typesafe (real Jev API) and provide a TypeSafe API key. The direct API (POST https://api.typesafe.ai/v1/systemone, model jev-latest) is early-access / waitlisted; Jev is also reachable via the Vercel AI Gateway (typesafe-ai/jev) and Cloudflare Workers AI (typesafe/jev).

CLI

bash
pip install requests                # mock mode needs nothing else
python -m jevloop.cli --preset resume_bullet \
    --text "I was responsible for working on the payments team..." --rounds 8
python -m jevloop.cli --input pitch.txt --reference original.txt --mode typesafe --api-key $TYPESAFE_API_KEY

Architecture (one call per pass, all questions answered in parallel by Jev)

state (current text) ──► Critic pass ──► per-axis Score distributions + Noul guards
        ▲                     │                │
        │                     │        value = Σ weightᵢ · normᵢ
        │                     ▼        entropy = mean normalized entropy of Score dists
   best_text ◄── accept if value improves ──┤
        ▲                                   │
        │   UCB1 picks target axis (weak + uncertain)
        │   Proposer: deterministic edit ops sampled from CEM distribution
        └──────── candidates (m per round) ◄──┘
guard violations (overclaim / fabrication / dismissive / meaning drift) → candidate vetoed

Files

  • —jevloop/rubric.py — 4 presets (sales pitch, résumé bullet, support reply, doc clarity): Score axes + Noul guards in Jev's exact question schema
  • —jevloop/client.py — JevClient (real API) and MockCritic (offline simulation), identical interface
  • —jevloop/proposer.py — deterministic edit operators + CEM distribution over them
  • —jevloop/optimizer.py — the loop: UCB1 axis selection, candidate generation, guard vetoes, entropy stopping, cost accounting
  • —jevloop/cli.py — CLI
  • —app.py — this Space UI

References

  • —TypeSafe AI launch post: <https://typesafe.ai/blog/introducing-system-one-models-and-jev>
  • —Question schema (Noul/Choice/Score, criteria, probabilities, legend): <https://developers.cloudflare.com/ai/models/typesafe/jev/>
  • —pydantic-ai TypeSafeModel: <https://pydantic.dev/docs/ai/models/typesafe/>
  • —Vercel AI Gateway model page: <https://vercel.com/ai-gateway/models/jev>