Jev by TypeSafe is getting a lot of attention right now. Social media, especially Twitter, is filled with demos of people using Jev in many different and interesting ways. But if you are coming from traditional LLMs like ChatGPT, Claude, or Gemini, it may not be immediately clear what Jev does or when you should use it.
In this article, we will look at what Jev is and how it can be used for decision-making and structured output. We will also explore the three types of questions supported by Jev. These include Choice, Score, and Noul, which we will explore using practical, real-world examples.
Let’s start with what Jev is not. Jev is not an LLM like ChatGPT, Claude, or Gemini. It does not produce text output. In other words, if you send your request to Jev asking, “List all 50 states in America,” it will not return you a list of 50 states. That is not the point of Jev. For those kinds of questions, you can use your LLM of choice.
Jev is an AI model that is good at decision-making and providing structured output. Jev supports three different types of questions. These include:
I think it is better to explain this with examples of each question type.
Consider a scenario where your company provides support through a chatbot on its website. Users can ask questions and get results. Behind the scenes, your company has implemented different AI profiles/assistants for different types of questions. One AI assistant is good at answering technical questions, another is good at answering billing questions, and the last one is good at answering general questions.
If the customer asks, “I returned the item last week. Why is my refund not processed?” which assistant do you think would be good at answering this specific question? If you answered billing, then you are correct.
That is the purpose of the Jev model: to make this decision and route the request/prompt to the correct assistant/profile. Below, you can see one of the requests to the Jev model.
{
"state": "I returned the item last week, why is my refund not processed?",
"questions": {
"category": {
"type": "choice",
"instructions": "Which support category does this request belong to?",
"criteria": {
"technical": "Technical problems with the application",
"billing": "Payments, charges, refunds, or billing questions",
"general": "General questions that do not belong to another category"
}
}
}
}
The Choice question type, allows Jev model to select a single option. The selected option is based on the processed text.
Although you can use LLM to perform intent classificaton, but the results are hit or miss. Even if you use Foundation Models framework, which provides structured output most of the time the results were unexpected and took much longer to process.
Consider a scenario where, apart from routing the request to the correct assistant/profile, you are also looking for a measure of the customer’s frustration. This can be accomplished by using Score questions.
If the user sends a message, “Where the hell is my order? I paid two weeks ago and it has still not arrived yet,” we can set different criteria for our score. These can be:
Each criterion is associated with a number. So, Calm is 0, Frustrated is 1, and Very Angry is 2. If the score for the user’s request comes out to be 0.1, then we can confidently say that the user is calm. On the other hand, if the score is 1.99, then it is close to 2, which means the user is very angry and we should take immediate action.
Consider a scenario where you are evaluating resumes for a senior SwiftUI developer position. You are looking for candidates who have SwiftUI, SwiftData, and networking experience. For these cases, you can use Noul questions.
Noul questions produce a numeric value. If the value is greater than or equal to 0.5, we can confidently say yes; otherwise, the answer is no. This means that for questions like, “Does this candidate have SwiftUI experience?” Jev can answer yes or no based on the resume. This can help you filter out candidates really quickly.
You can watch the demo of the Resume Evaluator web app here: Resume Evaluator Demo
Jev provides a different way of working with AI. Instead of asking the model to generate text, we can use it to make decisions and return structured output based on the criteria we provide.
In this article, we looked at the three types of questions supported by Jev. Choice can be used to select an option from a list, Score can be used to evaluate something based on a rubric, and Noul can be used to determine whether a statement is true or false.
These simple question types can be used in many different real-world scenarios, including routing requests, measuring customer frustration, evaluating resumes, and much more.
Become an AzamSharp School member and get access to more than 250 hours of practical courses covering SwiftUI, SwiftData, testing, architecture, AI, machine learning, and more.
Your membership also includes access to AzamSharp books, live workshops, office hours, and new content added regularly.