Real-time customer decisioning has long involved tradeoffs among speed, flexibility, and cost.
Large language models can reason over detailed customer profiles, but invoking one for every event adds cost and latency. Traditional ML models offer fast, predictable inference, but typically require training for each decision and a deployed serving endpoint.
An alternative is to ask a fast decision model several focused questions about the customer, apply business rules to its answers, and send only uncertain cases to a larger model.
That's the architecture I built with Jev and Tealium Functions.
I designed Tealium’s Invoke Your Own Model framework to combine live customer data, model responses, deterministic rules, and activation, with an escalation path for harder decisions.
For this implementation, I used Jev’s structured, probability-based answers to choose next best actions for abandoned carts and checkouts.
Here’s how I built it, what I observed in testing, and what I would account for before deploying it in production.
What is Jev?
Jev is TypeSafe’s first System One model. It takes a state, such as text or JSON, and answers questions you define using three output types: Choice, Score, and Noul. Tealium’s introduction to Jev explains those primitives and their use cases. A few characteristics matter here:
- Confidence and probability. Choice and Score answers include a confidence value from 0 to 1, derived from the probability distribution. Noul returns a probability rather than a separate confidence score. TypeSafe describes calibration across groups of predictions, not individual answers, so validate thresholds on a statistically meaningful sample of your own data.
- Structured output, not prose. Jev does not generate explanatory text or a reasoning trace. Its answers can feed directly into deterministic routing code, without parsing generated prose.
- Request-level customization. Accounts use the same model weights; you shape its responses through the state and the instructions and criteria supplied with each question (TypeSafe API Reference).
Why Jev, an LLM, or a Trained ML Model
Choosing among Jev-first, LLM-first, and ML-first approaches takes more than comparing API costs.
Invoke Your Own Model can call each type in real time. All three can evaluate a customer at a moment such as cart abandonment, but they differ in setup, output, and the work needed to maintain them:

Where Jev fits in Tealium

Tealium's Invoke Your Own Model (IYOM) framework allows a Tealium Function to call a model endpoint using a live event or visitor profile, then use the model's response for visitor enrichment and activation.
When embedding Jev into the framework, Tealium provides the customer state, formatted questions and the surrounding application logic. Jev is a hosted API, so the Tealium Function calls it directly over HTTPS. API keys are stored and managed by Tealium.
Deterministic code then evaluates the response and routes the resulting action through Tealium’s activation tools.
What I Built: Tealium IYOM + Jev Next Best Action for Cart Reclamation
The workflow has three layers:
- Data collection with customer enrichment and segmentation layer
- Core decisioning layer
- Outcome-based activations layer
I’ll focus on the decisioning layer: using Jev to recommend an action when a retail customer abandons a cart or checkout.
The Decisioning Layer
Tealium uses profile data to build Jev’s state. When a consenting retail customer enters a Cart Abandoners or Checkout Abandoners audience, a visitor function runs. It assembles a labeled subset of attributes from the current visit and the customer’s history, limited to what Jev needs to answer the questions. Personally identifiable information (PII) is excluded.

Many questions in one request
I used TypeSafe’s speculative fan-out pattern to ask multiple questions in one request. Deterministic code then evaluates the answers together to select an action.
In this example, I sent eight questions in one request:

Each question includes instructions and criteria, including cases where a particular choice should not apply:

Tealium sends the state, questions, and model version to Jev in one authenticated API request, then receives an answers object. The API key is managed in Tealium Functions.

The Tealium Function applies rules to determine whether to act on Jev’s answers or escalate.
Choice and Score answers include confidence values. I used them in three routing rules:
- If the visitor is more than 95% likely to purchase without additional incentive, do nothing.
- If Jev's confidence in the recommended action is below 0.6, or the customer state is sufficiently unusual, escalate to a larger LLM.
- Otherwise, act on Jev's answers.
These are example policy thresholds, not universal model cutoffs. In production, I would tune them using calibration data, observed outcomes, business impact, and escalation costs.
Two routing patterns put those rules into practice:
Confidence-gated routing. The function checks purchase propensity first and skips outreach when the customer is likely to buy unaided. If next-best-action confidence falls below 0.6, it escalates to an LLM. Because the thresholds live in code, they can be adjusted as validation data accumulates.
Model routing. A Score question measures how atypical the visitor state is. Uncertain or unusual cases go to an LLM, with code selecting a cost-efficient, mid-tier, or frontier model based on the profile and customer value. Tealium’s AI connectors handle the prompted evaluation at that tier. Routine decisions remain on the faster Jev path.

When the answers clear the rules, Tealium activates the selected action through the chosen channel.
Example 1: Fast-path decision
A mobile customer abandons checkout. Jev returns eight answers in one response:

The answers point to price sensitivity and a likely need for an incentive. Purchase propensity is 0.21, below the 0.95 do-nothing cutoff; next-best-action confidence is 0.82, above the 0.6 floor; and complexity is 0.25. The function therefore selects a discount offer by push notification. With device personalization at 0.88, Tealium Context API also makes the profile available for in-app personalization.
Example 2: Confidence-gated escalation
A second mobile customer abandons checkout. Jev returns eight answers again, but the confidence scores lead to escalation:

Jev favors a loyalty reminder over a plain cart reminder, 0.67 to 0.32. But the competing options leave next-best-action confidence at 0.58.
Because 0.58 falls below the 0.6 confidence floor, the function escalates rather than acting. A complexity score of 0.84 leads to the mid-tier model; the customer’s lifetime value and cart total do not meet the frontier-tier criteria. The resulting event routes the visitor to a mid-tier LLM through Tealium’s AI connectors.
Tealium's Real-Time Activation
The function emits an event with Jev’s answers and the routing outcome. Identifiers are added after Jev responds:

Profile enrichments trigger outbound actions through Tealium’s real-time connectors, including SMS via marketing automation platforms. Context API makes the same attributes available for in-app personalization through Tealium’s mobile SDKs, including Prism, and for onsite experiences through its tag manager and web SDKs. Third-party vendors can access current customer attributes through Context API as well.
What it costs and how fast it is
In my test environment, the end-to-end function averaged 295 ms, including the Jev request. At the time of writing, TypeSafe reports 70 to 500 ms for the model call alone. Before production, I would measure P95 latency under realistic concurrency, accounting for cold starts, network variation, rate limits, and downstream activation.
My test request used 3,094 input tokens. At the stated price of $0.042 per million input tokens, that is approximately $0.00013 per decision, or $130 per million. Reducing the state and question payloads would lower the cost further.
Bundling all eight questions also helps with cost and latency. In this test, separate calls would have used about 1.9 times as many input tokens.
Production Implementation Considerations
Privacy and consent. Jev receives only the profile snapshot included in the state. Tealium Functions removes PII before the request; identifiers remain within Tealium for permitted identity-resolution workflows. Tealium Consent Orchestration gates the audience that triggers the call and checks preferences before channel activation.
Code hosting. I built the state, questions, API call, and response handler in a Tealium Function to simplify testing and deployment. Tealium Functions AI Assistant can also help write code and test visitor and event payloads.
The same approach can run in serverless environments such as AWS Lambda, Google Cloud Functions, Google Cloud Run, or Azure Functions. Tealium Functions can POST a formatted visitor payload to a cloud function that builds the Jev request and handles its response. Tealium then uses the returned answers for enrichment and activation.
Confidence thresholds. The 0.6 confidence floor and 0.95 purchase propensity cutoff are examples, not defaults. Keep them configurable and evaluate alternatives against historical and experimental data:
- Model quality: accuracy by confidence band, calibration
- Business impact: conversion rate, incremental conversion, false-positive and false-negative rates
- Operations: escalation rate, cost per decision, latency by decision path
Safe fallback. Timeouts, rate limits, malformed responses, and provider outages should not interrupt the customer journey. If Jev is unavailable, the function skips model-based decisioning and uses the existing rules-based flow. Define and test that behavior before launch.
What’s next
Real-time decision APIs are emerging from multiple vendors. Jev launched in September 2026, followed two weeks later by OpenAI’s announcement of Decisions API, built on its Luna model to answer user-defined questions with a finite set of outcomes.
If you’re exploring Jev or real-time AI decisioning, reach out. I can walk you through the architecture, code, and a live demo. You can also hear me talk through this on the 1 Amazing Thing podcast (Real-Time AI Decisioning Without the LLM Bill (Tealium + Jev Demo).
For more use cases across industries and teams, see Tealium’s Jev announcement.
The models will keep changing. The goal of Tealium's infrastructure is to make it easier to adopt the right one without rebuilding the customer journey around it.