Build with Jev / Lesson 16 of 24

Version models, questions, and policy together

Control aliases, pinned releases, replay evidence, canaries, regression checks, and rollback.

After this moduleYou can upgrade Jev without losing reproducibility or confusing model drift with question drift.

Distinguish native aliases, versions, and the Gateway model

Once requests and failure paths work, version the behavior you intend to evaluate and release. TypeSafe currently documents native jev-1.13.0 and the aliases jev-latest and jev-preview. At the research snapshot, both aliases resolved to jev-1.13.0; that equality is current state, not a promise.

model alias: a stable model name whose underlying version can change without the caller changing its request string. An alias makes automatic adoption convenient. A versioned ID makes an evaluated release easier to attribute and roll back. Neither choice removes semantic uncertainty or guarantees byte-identical answers.

Vercel AI Gateway exposes typesafe-ai/jev. The inspected Gateway provider can report the requested Gateway ID as result.modelId, which does not prove which native Jev version served the request. No documented Gateway ID for pinning the underlying native version was established in this research. A workflow that requires an immutable Jev selection can use the documented native jev-1.13.0 path; a Gateway workflow must record the backend-version limitation rather than claiming exact native replay.

Trace this example from input to result
01

Customer choice

A support lead proposes moving a ticket router from a pinned model to a newer release.

02

Request or event

The evaluation runner runs the same versioned states, questions, and policy against baseline and candidate.

03

Backend behavior

The system records complete distributions and operational metadata before a shadow and low-risk routing canary.

04

Customer sees

Ticket behavior changes only after measured promotion criteria pass, with review and rollback available.

05

Diagnostic reasoning

Compare state builder, exact state, question definitions, requested and returned model metadata, distributions, policy, and queue mapping.

Customer seesApplication doesJev returns
Stable routing during evaluationKeeps the baseline in control while recording candidate answersA typed answer associated with the selected provider and model metadata
A safe canary or review resultLimits candidate control to reversible traffic and applies rollback gatesA distribution whose movement must be measured on target cases

The native response model field should be captured rather than inferred from the requested alias. The Models documentation says it reports the resolved versioned model, while some examples show an alias, so preserve the actual value and the requested value. For Gateway, preserve the requested model and all provider metadata, but do not translate typesafe-ai/jev into jev-1.13.0 without direct evidence.

Version the complete decision contract

The model is one behavioral input among several. decision contract: the complete versioned set of evidence construction, question meaning, model selection, policy, and downstream mapping that turns an event into an action. A historical ticket cannot be explained from the customer message and alias alone.

const decisionContract = {
  stateSchema: "ticket-state/3",
  retrieval: "support-context/5",
  canonicalStateHash,
  questions: "support-judgments/7",
  requestedProvider: "typesafe-native",
  requestedModel: "jev-1.13.0",
  returnedModel: result.model,
  policy: "routing-policy/12",
  queueMap: "queue-map/4",
};

Version the exact instructions, criteria, labels, level ordering, and question IDs in source control. Version the state builder and retrieval query because an added or removed field can move the distribution even when the question and model are unchanged. Version thresholds, review bands, weights, and label-to-handler mapping because the same model answer can produce a different customer result under new policy.

Hash canonical redacted state when raw retention is not permitted. A hash can show that two serialized inputs differ, but it cannot explain why, so keep source record identifiers and builder versions under appropriate access controls. Record complete typed answers and distributions where privacy policy allows; retaining only the winner prevents later threshold replay.

Question and model versions interact. A question revised for the old model may behave differently on the new one, and a new model may improve the old question but regress the revised one. Change one surface at a time when practical. When the interaction is central, use a factorial comparison: old model with old and new questions, then new model with both. This costs additional evaluation calls but separates a question effect from a model effect.

Commercial and operating facts also have versions. Prices, rate limits, context limits, SDK defaults, retention terms, and alias resolution can change. Store the date and source used for capacity or privacy decisions and recheck the current first-party contract before promotion.

Evaluate an upgrade before it controls traffic

Run baseline and candidate on the same frozen held-out states with identical question and policy definitions. Compare task accuracy, confusion matrices, false positives, false negatives, calibration views, subgroup behavior, review coverage, token use, latency, and service failures. Include missing evidence, legitimate no-match cases, adversarial state, non-English production languages, and examples close to action boundaries.

Do not reduce the comparison to label agreement. A probability movement can cross a threshold and change the route even when the winner remains the same. Different winners can still produce the same review fallback. Compare raw answers and final actions. Inspect every costly disagreement and name whether retrieval, judgment, policy, or mapping explains it.

shadow run: a candidate evaluation whose output is recorded for comparison but cannot control the customer action. Shadowing supplies paired production evidence, but it increases inference cost and data processing. Sample deliberately, preserve privacy controls, and do not log raw state merely because both results are useful. The baseline remains authoritative during this phase.

A canary lets the candidate control a small share of reversible, low-risk ticket routing after offline and shadow gates pass. Define promotion and rollback conditions before starting: automatic-route error, urgent-case recall, subgroup floors, review volume, latency, unavailable rate, and downstream correction. Keep financial and authorization actions outside the model-controlled canary.

Applied diagnosis

Billing false positives rise after an alias moves

requested=jev-latest · returned model differs · question version unchanged · billing corrections rise

Route borderline cases to review and restore the prior pinned model if available. Replay the frozen labeled set against both versions while keeping state and policy fixed. Check traffic mix, retrieval, and mapping changes as competing explanations rather than assuming the alias caused every correction. Promote again only after the candidate meets the predeclared action and subgroup gates.

Replay incidents and roll back a coherent release

A useful incident packet records the intended workflow, exact or safely reconstructable state, exact instructions and criteria, requested and returned model metadata, complete answer distributions, threshold and policy version, visible symptom, smallest supported boundary, competing explanations, next controlled test, immediate mitigation, and longer-term design change.

Replaying a historical state is a controlled comparison, not a promise to reproduce identical floating-point values. A moved alias changes the implementation. A Gateway model ID may not identify the native backend. Even a pinned semantic model can show nondeterminism. Use replays to compare distributions and action stability over a set of cases rather than declaring a single mismatch proof of a regression.

Rollback must restore a contract that was evaluated together. Reverting only the model while retaining thresholds tuned for the candidate can create a new policy. Restore the compatible model, questions, state builder where relevant, thresholds, and queue mapping. Keep human review active while queued work drains. Decide explicitly whether to replay prior decisions or change only future events; replaying old tickets can duplicate notifications or route writes without idempotency.

The rollback path also needs operational validation. Confirm that the old model ID is still available, the old question pack still passes current client validation, and credentials and capacity support the returned traffic. Canary the rollback if its environment has changed since release. Preserve the candidate evidence so the team can diagnose rather than permanently freezing on an old model.

Dig deeperInterpret model and question interactions

A two-by-two evaluation separates old and new model behavior from old and new question behavior. Report each cell's distributions and policy actions rather than only the best aggregate score. If the new question helps both models, it may be an independent improvement. If the new model helps only under the new question, promote them as one explicitly evaluated contract and roll them back together. Avoid searching many question variants on the held-out set, which turns final evaluation into another tuning loop.

Saved locally

Plan a controlled upgrade

Your answers stay in this browser. Write enough that another engineer could continue the investigation.

Knowledge check

Check your understanding

Explain how aliases, provider model IDs, question versions, shadow evaluation, canaries, replay limits, and coherent rollback preserve evidence during an upgrade.
Module quiz

0/4 answered

01Why pin a native model in a controlled production release?
02What must an incident replay preserve?
03What does a shadow comparison do?
04Why can replaying `jev-latest` fail to reproduce an old decision?
Sources and verification notes 5
Models, limits and pricingpublic-contract

Native jev-latest and jev-preview documented as jev-1.13.0; 64k total and 32k state plus longest question; 250k tokens/second and 1,200 requests/minute; $0.042/million input tokens. Recheck before rollout.

HTTP APIpublic-contract

POST /v1/systemone and authenticated GET /v1/models, request/response fields and errors. Prose and schema differ on omitted instructions, null state and one-level Score; course uses conservative valid requests.

Jev 1.13 limitationspublic-contract

Literal interpretation, arithmetic, dates, representations, indirection, irrelevant and adversarial text, criteria and calibration limitations. Reviewed model page dated September 17.

Gateway live model catalogobserved

Observed typesafe-ai/jev evaluation model, input USD0.000000042/token, free output and ZDR/no-training flags. Context zeros do not establish zero capacity. No inference executed.

Gateway evaluation contractpublic-contract

AI SDK evaluation entry point, boolean/probability normalization and confidence metadata; not an OpenAI-compatible chat REST route.

Further learning

Optional references

These resources provide public documentation and examples for readers who want them.

TypeSafe docsModelsTypeSafe docsJev 1.13 jaggedness