JEV → Tally + Tapestry Looms
JEV → Tally + Tapestry Looms
Date: 2026-09-23 · Status: Tapestry LIVE · Tally committed, deploy pending (Douglas)
What JEV is
JEV AI (jev-ai.pro) is a typed-judgment engine — not a chat model. It cannot hold a conversation turn, so it never enters Courier's model menu. What it does: answer typed questions over a state text, fast and cheap.
POST https://jev-ai.pro/api/v1/systemone
Authorization: Bearer sk_jev-ai_...
{
"model": "jev-latest",
"state": "<the text being judged>",
"questions": {
"urgent": { "type": "noul", "instructions": "Does this need immediate attention?" },
"route": { "type": "choice", "instructions": "Which team handles this?",
"criteria": { "support": "...", "engineering": "...", "billing": "..." } },
"severity":{ "type": "score", "instructions": "Rate the severity",
"criteria": ["trivial", "minor", "major", "critical"] }
}
}
- noul → yes/no probability (
{ "noul": 0.87 }) - choice → pick + per-option probabilities + confidence
- score → fractional level index + probabilities + confidence
Limits: 64k model context; state + longest question ≤ 32k tokens; ≤64 questions/call; 256 KB body. Billing: input tokens draw from a paid pool, output tokens are free; 1 credit/call when the pool is empty. No $/Mtok schedule. Models: jev-latest, jev-preview, jev-1.13.0 (pinned), laya-english / laya-multilingual (small strict-limit classifiers). Account state (2026-09-23): 75M paid input tokens, 5 credits. Key verified live. Helper endpoints: GET /api/v1/models, GET /api/v1/credits (free — used for key health checks). Docs' own positioning: LLM Router, LLM-as-judge, RAG eval, classification.
The API key lives in Tapestry's system_api_keys as tapestry_jev_1 (with base_url + models in metadata). A capcom creds copy is Douglas's to add.
What's live in Tapestry — seamstresses @ e2955ff (deployed 2026-09-23)
| Piece | File | What it does |
|---|---|---|
| JEV client | src/services/jev.ts | Singleton jevSystemOne(state, questions). Key from tapestry_jev_% row (JEV_API_KEY env override). Fail-open everywhere — every caller keeps a non-JEV path. |
| Startup | src/server.ts | loadJevConfigFromDb() beside the Tally config load. |
| Quality gate pre-pass | src/services/stream.ts | The per-turn gate verdict is a yes/no question — JEV's native shape. Confident PASS (p ≥ 0.8) skips the haiku call entirely (input-token-only cost, ~0.4s vs ~2s). Contested drafts escalate to haiku because the retry loop needs the prose REASON/PATTERN. Watch logs for [gate] jev fast-pass p=…. |
| Key health | src/routes/adminExtended.ts | tapestry_jev_% pool in the SDK health check via free GET /credits. jev-sdk service card (totalServices 13). |
| Services page | frontend/.../ServicesPage.tsx | jev-sdk entry in the provider key list. |
Validation: live systemone smoke test passed; tsc clean; jest 575/577 (2 failures pre-existing on the clean tree — directLoom repo-shorthand, unrelated).
What's committed in Tally — main @ 4651b75 + 7a6d050 (deploy = Douglas)
4651b75 — JEV provider + Tally Max analyzer path
model-registry.ts: all 5 JEV models registered (supportsToolCalls: false, cost 0-as-unknown since billing is account-token based). Registry documentation + analyzer cost accounting — JEV is never seeded into chat routing.max/analyzer.ts:callAnalyzerJevbehindTALLY_MAX_ANALYZER_PROVIDER=jev(defaultanthropic). The analyzer's refined shape is a 1:1 map onto JEV question types: task_type→choice(8), structure_type→choice(4), complexity→score(5 levels, normalized 0..1), determinism→noul, capability tags→one noul each. JEV failure falls back to the Anthropic analyzer.- Documented tradeoff: typed answers can't carry
replacement_text, so the JEV path returnsrawOps: []— shape refinement only, lowerest_savings.
7a6d050 — analyzer shadow (agreement measurement)
- Analyze-and-discard retention makes post-hoc comparison impossible, so after each uncached
/route/maxverdict, the other brain runs fire-and-forget intomax_analyzer_shadow(migration 016). Never delays or fails the response. - Gates:
TALLY_MAX_JEV_SHADOW=1(JEV shadows Anthropic — pool tokens only) ·TALLY_MAX_ANTHROPIC_SHADOW=1(reverse — real $, own gate). tools/jev-agreement.sql: head-to-head match rates per field + per-brain cost/latency + a posture section that works with no shadow data.
The decision already made (2026-09-23)
Should JEV run the Tally Max analyzer? Yes — shadow first, flip on evidence.
Key fact that settled it: Tapestry never reads context_ops or est_savings from Max — only recommended_model, confidence, exploration flag, why. The one thing JEV can't produce is the one thing we don't use.
Also in JEV's favor: it eliminates the Anthropic path's malformed-JSON retry fragility (typed answers by construction), and its cost is pool tokens already paid for (~3k–15k analyses from 75M tokens depending on state size, fewer with the 24h verdict cache).
Deploy sequence:
# 1. Deploy tally main (applies migration 016), set:
TALLY_MAX_JEV_SHADOW=1
JEV_API_KEY=sk_jev-ai_... # in system_api_keys / creds
# 2. After a few hundred analyses:
psql "$DATABASE_URL" -f tools/jev-agreement.sql
# 3. Flip when satisfied:
TALLY_MAX_ANALYZER_PROVIDER=jev
Flip rule of thumb: task_type match ≥ 85% with complexity mean-abs-delta ≤ 0.15 → JEV is interchangeable on routing.
Where things live
| Thing | Location |
|---|---|
| JEV client + docs | tapestry-node/src/services/jev.ts (header comment) |
| JEV API key | tapestry DB system_api_keys.tapestry_jev_1 |
| Agreement query | tally/tools/jev-agreement.sql |
| Shadow migration | tally/apps/api/src/db/migrations/016_max_analyzer_shadow.sql |
| Memory | jev-tally-tapestry.md in Claude memory |
| Session log | ~/.claude/sessions/2026-09-23-jev-tally-tapestry.txt |