Jev migration: move from TypeSafe Jev to Laya Studio
The open-source Laya package implements TypeSafe Jev's /v1/systemone wire protocol, and Laya Studio exposes it unchanged. In plain terms: your existing Jev code keeps working after you change two values, the address and the key. Laya Studio is an independent service, not affiliated with TypeSafe.
Before and after
Toggle between your Jev client and the same client on Laya Studio. Only the highlighted lines change.
const BASE = "https://api.laya.studio";const KEY = process.env.LAYA_API_KEY; // lsk_live_… const res = await fetch(`${BASE}/v1/systemone`, { method: "POST", headers: { Authorization: `Bearer ${KEY}`, "Content-Type": "application/json" }, body: JSON.stringify({ state, questions, model: "jev-latest" }),});const { answers } = await res.json();route(answers.intent.choice, answers.intent.confidence);The request body, the question types and the answer fields stay the same. A Jev model id such as jev-latest is accepted and ignored.
Migration checklist
Tick items off as you go. Your progress is remembered in this browser.
0 of 8 done
Your ticks are saved in this browser only.
1. Point your client at Laya Studio
The request body is the same: state, questions with choice / score / noul types, and model. A Jev model id such as jev-latest is accepted and ignored — Laya routes to its own checkpoint automatically.
2. Check what differs
| Area | Meaning |
|---|---|
Context | Jev accepts up to 32k tokens of state; Laya reads the first 512 (English) or 1,024 (multilingual) tokens per question. Trim or summarise long states. |
Confidence | Both return a confidence, computed differently. Laya: 1 − normalised entropy (choice/score), max(p, 1−p) for noul. Re-derive thresholds on your own labelled data. |
Large label sets | Jev is much stronger on many-label questions (Banking77: 0.870 vs 0.425). Split large taxonomies before migrating them. |
Extra fields | Laya adds routing and action.act_probability; Jev clients ignore unknown fields. |
Pricing | Both bill input tokens, in the same unit: Jev lists $0.042 per 1M input tokens, Laya Studio $0.0294 per 1M input tokens (30% less). 1 credit = 1 input token; 5 free runs per new workspace. |
3. Shadow before you switch
Send a sample of production traffic to both for a week and compare answers and confidence before flipping the default.
The full, sourced comparison is at Laya vs Jev.