A shared support inbox I worked on ran the full treatment on everything that arrived: load the customer record, join the order history, assemble a 4,000-token state, ask four questions. It did that for the newsletters, the payment receipts, the out-of-office replies and the thank-you notes as well. Roughly 70% of the bill bought nothing. A Jev Noul screen fixes that for the price of one question.
Decide whether a Noul screen beats batching#
Screening is only worth it when the step you are gating costs something the screening question does not. Assembling a bigger state, calling a slower model, waking a human reviewer, hitting a paid third-party enrichment API — those are real savings. Run the test honestly before you build anything.
If the later questions read exactly the same state as the screen, you are not saving anything by asking first. You are paying for the state twice and adding a round trip. In that case send every question in one request and discard the answers you do not need, which is the batching pattern I covered in parallel Jev questions — the state dominates the input tokens, so the marginal question is nearly free and the marginal request is not.
The screen earns its keep when the state grows between the two steps:
| Step | State | Cost |
|---|---|---|
| Screen | The raw message body, ~120 tokens | One Noul |
| Process | Message + customer record + 12 months of orders, ~4,000 tokens | Four questions |
Thirty-three times the input, discarded for every newsletter. That is the gap the screen closes.
Write the Jev Noul screen question#
A Noul is Jev's boolean primitive: a statement plus optional true and false criteria, answered with a single float between 0 and 1 representing the probability the statement is true. For a screen, the state is the raw input and nothing else — the moment you enrich the state to ask the screening question, you have paid the cost you were trying to avoid.
<?php
declare(strict_types=1);
namespace App\Support\Inbox;
use Illuminate\Support\Facades\Http;
final readonly class ScreenMessage
{
/** @return float The probability the message needs the full treatment. */
public function __invoke(string $body): float
{
$response = Http::withToken(config('services.typesafe.key'))
->post('https://api.typesafe.ai/v1/systemone', [
// The raw body only. No customer record, no order history.
'state' => ['message' => $body],
'model' => config('jev.model'),
'questions' => [
'needs_triage' => [
'type' => 'noul',
'instructions' => 'This message is a customer asking us to do something or answer something.',
'criteria' => [
'true' => 'A question, a complaint, an order or delivery enquiry, a returns or warranty request, or any message expecting a reply from a person.',
'false' => 'A newsletter or marketing email, an automated payment receipt or invoice, a delivery carrier status update, an out-of-office auto-reply, a recruiter or cold sales email, a thank-you with no question in it, or spam.',
],
],
],
])->throw()->json();
// A Noul answer contains only `noul`. There is no confidence field on it.
return (float) $response['answers']['needs_triage']['noul'];
}
}
The false list is where the accuracy comes from. Enumerate the kinds of input that have nothing to do, rather than writing "not a support request" and hoping — definition by negation is the same trap that makes an other option fail in a Choice question without a companion Noul. Mine came out of an afternoon reading a month of the general inbox, not out of my imagination.
The response is small enough to read at a glance:
{
"model": "jev-1.14.0",
"answers": {
"needs_triage": { "type": "noul", "noul": 0.04 }
},
"usage": { "input_tokens": 138, "output_tokens": 5 }
}
Read real probabilities before you pick thresholds#
Run the screen over a few hundred real inputs with no routing attached and look at what comes back. The numbers are not evenly spread — most inputs land near 0 or near 1, and the interesting work is in the thin band between.
| Input | Probability |
|---|---|
| "My standing desk arrived with the wrong desktop, can I swap it?" | 0.98 |
| "Order #4411 — where is it? Three weeks now." | 0.96 |
| "Thanks, that sorted it. Cheers." | 0.31 |
| "Re: your invoice 2026-114 attached — payment terms query" | 0.52 |
| "DeskFlow Weekly: five ways to fix your posture" | 0.03 |
The thank-you at 0.31 is genuinely borderline: no question in it, but a human might still want to see it. The invoice query at 0.52 is the model telling you it cannot tell — it is a request from a person, just not the kind the inbox team handles. Neither is a rounding problem, and neither should be forced into yes or no.
Set two thresholds and three exits#
Two thresholds, three exits, every input gets one. Above the high threshold the expensive step runs. Below the low threshold the message is set aside. Between them it goes somewhere a person will eventually look.
<?php
// config/jev.php
return [
'model' => env('JEV_MODEL', 'jev-1.14.0'),
'screen' => [
// At or above this, run the expensive step.
'high' => (float) env('JEV_SCREEN_HIGH', 0.70),
// Below this, set it aside without further work.
'low' => (float) env('JEV_SCREEN_LOW', 0.30),
],
];
Keep the decision itself in a plain class with no network in it, so the bands are unit-testable:
<?php
declare(strict_types=1);
namespace App\Support\Inbox;
enum ScreenOutcome: string
{
case Process = 'process';
case Review = 'review';
case SetAside = 'set_aside';
}
final readonly class DecideScreen
{
public function __construct(
private float $low,
private float $high,
) {}
public function decide(float $probability): ScreenOutcome
{
return match (true) {
$probability >= $this->high => ScreenOutcome::Process,
$probability < $this->low => ScreenOutcome::SetAside,
// Everything else is the band. It is an outcome, not a leftover.
default => ScreenOutcome::Review,
};
}
}
Start the thresholds wide apart and tighten them once you have data. The asymmetry matters: make the gap between low and high large when a missed message costs you a customer, and narrow when the expensive step is cheap enough that over-processing is the lesser evil. The same three-band shape drives confidence-gated intent routing, where the consequence of acting automatically is what sets the gate.
Wire the screen as a chained queue job#
Two jobs. The cheap one reads only the raw input and decides; the expensive one is dispatched from it and never runs otherwise. This is a conditional chain rather than Bus::chain(), because the second job must not run on a no — the trade-offs between the two are the ones I went through in queue chains versus batches.
First, somewhere to record what the screen decided:
<?php
// database/migrations/..._add_screen_columns_to_inbound_messages_table.php
Schema::table('inbound_messages', function (Blueprint $table): void {
$table->decimal('screen_probability', 5, 4)->nullable()->index();
$table->string('screen_outcome')->nullable()->index();
// Pin the versioned model, never the alias — thresholds are tuned against it.
$table->string('screen_model')->nullable();
});
Then the screening job:
<?php
declare(strict_types=1);
namespace App\Jobs;
use App\Models\InboundMessage;
use App\Support\Inbox\DecideScreen;
use App\Support\Inbox\ScreenMessage;
use App\Support\Inbox\ScreenOutcome;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Queue\Queueable;
final class ScreenInboundMessage implements ShouldQueue
{
use Queueable;
public function __construct(public InboundMessage $message) {}
public function handle(ScreenMessage $screen, DecideScreen $decide): void
{
$probability = $screen($this->message->body);
$outcome = $decide->decide($probability);
// Store the number, not just the verdict. You will want it in six weeks.
$this->message->update([
'screen_probability' => $probability,
'screen_outcome' => $outcome->value,
'screen_model' => config('jev.model'),
]);
if ($outcome === ScreenOutcome::Process) {
TriageInboundMessage::dispatch($this->message);
}
}
}
Review and SetAside both fall through to no dispatch. The difference between them is what a human sees: the review band surfaces in a queue somebody works through, the set-aside pile is searchable but nobody is paged for it.
Test all three exits with Http::fake()#
Three canned responses, three assertions, no network. The screening job is the cheapest thing in the pipeline and also the one with the most branches, so it earns the coverage.
<?php
use App\Jobs\ScreenInboundMessage;
use App\Jobs\TriageInboundMessage;
use App\Models\InboundMessage;
use Illuminate\Support\Facades\Bus;
use Illuminate\Support\Facades\Http;
function jevNoul(float $probability): array
{
return [
'model' => 'jev-1.14.0',
'answers' => ['needs_triage' => ['type' => 'noul', 'noul' => $probability]],
];
}
beforeEach(function (): void {
Bus::fake();
config(['jev.screen.low' => 0.30, 'jev.screen.high' => 0.70]);
});
it('dispatches the expensive job on a clear yes', function (): void {
Http::fake(['api.typesafe.ai/*' => Http::response(jevNoul(0.96))]);
$message = InboundMessage::factory()->create();
(new ScreenInboundMessage($message))->handle(app(ScreenMessage::class), app(DecideScreen::class));
Bus::assertDispatched(TriageInboundMessage::class);
expect($message->fresh()->screen_outcome)->toBe('process');
});
it('sets aside a newsletter without dispatching anything', function (): void {
Http::fake(['api.typesafe.ai/*' => Http::response(jevNoul(0.03))]);
$message = InboundMessage::factory()->create();
(new ScreenInboundMessage($message))->handle(app(ScreenMessage::class), app(DecideScreen::class));
Bus::assertNotDispatched(TriageInboundMessage::class);
expect($message->fresh()->screen_outcome)->toBe('set_aside');
});
it('routes a mid-band message to review and stores the probability', function (): void {
Http::fake(['api.typesafe.ai/*' => Http::response(jevNoul(0.52))]);
$message = InboundMessage::factory()->create();
(new ScreenInboundMessage($message))->handle(app(ScreenMessage::class), app(DecideScreen::class));
Bus::assertNotDispatched(TriageInboundMessage::class);
expect($message->fresh()->screen_outcome)->toBe('review')
->and((float) $message->fresh()->screen_probability)->toBe(0.52);
});
Avoid the four ways this goes wrong#
Most of the damage comes from the screen quietly doing something other than what you think it does. These are the four I have actually had to fix.
Enriching the state to screen. If ScreenInboundMessage loads the customer record to decide, the screen costs what the triage costs and saves nothing. Pass the raw body and only the raw body. The moment a screening job needs a relationship loaded, the pattern is wrong for that step.
One threshold. A single cut-off at 0.5 puts the model's most uncertain answer on whichever side of the line the comparison operator happens to fall. Two thresholds and a band is not extra complexity, it is the complexity that was already there.
No audit trail. Storing only set_aside and not 0.31 means the day somebody asks why their message was ignored, you have no answer and no way to tune. Store the probability and the versioned model string. If you are already tracking spend per call, fold it into the same record — the approach in tracking AI token usage and cost in Laravel works unchanged here.
Screening something that was already going to be cheap. Adding a Noul in front of a step that costs less than the Noul is a net loss plus a round trip. Measure the two steps before you believe the saving.
Wrapping Up#
Add the screening job in front of whatever your most expensive step is, send only the raw input in the state, and let two thresholds decide between process, review and set aside. Store every probability from day one — six weeks of them is what turns threshold tuning into evidence rather than argument.
The same cheap-first thinking extends naturally: scoring RAG passages with Jev before the LLM sees them applies it to retrieval instead of routing, and using Jev as a guardrail on LLM output puts a cheap question on the other end of the same pipeline.
FAQ#
What is a Noul question?
A Noul is Jev's boolean primitive: a statement, optionally with true and false criteria, answered with a single float between 0 and 1 representing the probability that the statement is true. It is not a label and not a classification — there is no confidence field on a Noul answer, because the probability itself is the confidence signal. A 0.97 and a 0.03 are both confident answers; a 0.5 is the model saying it cannot tell.
How do I cut LLM costs in a Laravel app?
Stop paying for inputs that were never going to need the work. Put one cheap question in front of the expensive step, gate the dispatch on it, and make sure the cheap question reads a much smaller state than the step it guards. Batch the questions that do share a state into a single request rather than sending them separately, and track your actual token spend per call so you know which steps are worth gating in the first place.
When should I screen before an expensive AI call?
When the next step costs something the screening question does not — a bigger state to assemble, a slower or more expensive model, a paid third-party lookup, or a person's attention. If the later questions read the same state as the screen, screening saves nothing and adds a round trip; send everything in one request instead and discard what you do not need.
What thresholds should I use for a Noul?
There is no universal pair of numbers. Run the screen over a few hundred real inputs with no routing attached, look at where the probabilities actually fall, and pick your boundaries from that distribution. I start around 0.30 and 0.70 for inbox screening and widen the gap whenever the cost of wrongly setting something aside is high. Keep both numbers in config so tightening them never means editing a job.
How do I handle answers in the middle?
Give the band its own exit rather than forcing it to yes or no. In practice that means a third outcome — a review queue, a lower-priority pile, a digest someone scans once a day — where the input is visible to a person but does not trigger the expensive automated path. The middle band is where the model is genuinely uncertain, and that uncertainty is information worth keeping rather than rounding away.