Laravel Tutorials

Decide with Jev: Laravel AI That Answers with a Probability

Published

▶️ Watch the video tutorial (9 minutes)

Before I send a tutorial to an editor, I check one thing. Does the draft do what the brief asked for?

A brief is the plan for an article. It says what the reader should learn. The draft is what the writer turned in. Sometimes the two don't match.

So in Decide with Jev, a new mini course on Laravel News, we build an app that checks this for us. I call it a content preflight checker. Pilots check the plane before takeoff. This app checks the draft before it goes to the editor. It doesn't write anything, and it doesn't publish anything. The editor still makes the call.

The app uses Jev, an AI model from a company called TypeSafe. Most AI models you've used write text back. Jev gives you a number instead. It tells you how likely the answer is "yes."

Why does that help? PHP can't make rules out of a paragraph. It can make rules out of a number. A high number means the draft is a good match. A low number means it isn't. Anything in the middle goes to a person. I'm not saying Jev is smarter than a chat model. Its answer is simply the right shape for this job.

In this first episode we set everything up. We install the Laravel AI SDK and add a TypeSafe API key. In the video I use the 1.x dev version of the SDK, because this feature wasn't on the main branch yet. (Since I recorded this video, it has been merged, so you don't need the dev branch anymore. A normal install works.) Jev runs on TypeSafe's servers, so there's nothing extra to install on your computer.

Then we need something to test. I wrote four short drafts for one brief: show a Laravel developer how to add a GET /hello route and check it in the browser.

  • The first draft does everything the brief asks.
  • The second talks about routes but never gives a single step.
  • The third is a mix. It has some opinion and some product news, but only one instruction.
  • The fourth tries to trick the checker. It tells the model to ignore the brief. We'll use that one later in the course.

Next we ask Jev our first question in Tinkerwell. The complete draft gets 0.96. The thin one gets 0.02.

One warning about that number. It's the chance the model gives to "yes." It is not proof that the answer is right.

In the next episode we ask three questions at once. Does the draft do what the brief asked? What kind of text is it? How clear are the steps?

⭐ GitHub: https://github.com/harris21/decide-with-jev

▶️ Watch Episode 1 now →

Harris Raftopoulos photo

Senior Software Engineer • Staff & Educator @ Laravel News • Co-organizer @ Laravel Greece Meetup

Sponsored

serpapi logo
SerpApi

The Web Search API for Your LLM and AI Applications

Visit SerpApi

The latest

View all →
Laravel Herd 2: Coding Agents, Workspaces, and Cloud Deploys image

Laravel Herd 2: Coding Agents, Workspaces, and Cloud Deploys

Read article
Strict Request Input Casting in Laravel image

Strict Request Input Casting in Laravel

Read article
Prevent Duplicate File Uploads With Laravel Storage Dedupler image

Prevent Duplicate File Uploads With Laravel Storage Dedupler

Read article
Slow Job Alerts and Replica Commit IDs in Laravel 13.40 image

Slow Job Alerts and Replica Commit IDs in Laravel 13.40

Read article
Flock: A Free, Native Herd Alternative for Laravel image

Flock: A Free, Native Herd Alternative for Laravel

Read article
Live Props for Real-Time Updates in Inertia.js v3.11 image

Live Props for Real-Time Updates in Inertia.js v3.11

Read article