Jev vs Clef: qual decision model funciona melhor na prática?
Read the Portuguese translation →
Author: Rafael Quintanilha – QuantBrasil · Watch on YouTube
Video authored by the channel shown, not by IANIA; all rights belong to the creator. Transcript and summary generated automatically; the original-language content is preserved.
Original language: English
Original video: Jev vs Clef: qual decision model funciona melhor na prática? · Channel: Rafael Quintanilha – QuantBrasil · 27:13 · Watch on YouTube
Topics: AI agents, Software engineering with AI, AI models, Local and open-source models
Summary
Section titled “Summary”The video explains decision models: systems designed to make fast, low-cost choices from a predefined set of answers, and compares Cloudflare’s open-source Clef with Jev. It describes Clef’s advantages, including image input and a larger context window, alongside its higher cost and latency. A course-lesson recommendation feature serves as a practical test, with the presenter finding Jev faster and, in his informal comparison, generally more accurate. The video concludes that Clef may suit tasks requiring vision or more context, while Jev performed better in the tested scenarios but is closed-source and more limited.
Key points
Section titled “Key points”- Decision models return structured choices from a bounded set of allowed answers, making them useful for classification, routing, and selecting actions.
- The video presents OpenAI’s Decisions API as a similar concept, but says it was not available to test at the time of recording.
- Clef is an open-source Cloudflare decision model that is available through Workers AI and OpenRouter.
- Clef supports image input and has a 64,000-token context window, compared with Jev’s 32,000-token window.
- The presenter says Clef and Clef Flash cost more than Jev and showed higher latency in the compared figures.
- The practical example recommends course lessons based on a learner’s query, with a “no match” option for unrelated or vague requests.
- In the presenter’s informal tests, Jev was faster and often returned answers he preferred, though the comparison was not scientific.
- The presenter suggests Clef when image input or a larger context is needed, while Jev’s closed-source status and lack of vision are limitations.
Chapters
Section titled “Chapters”| Start | Chapter | Summary |
|---|---|---|
| 00:01 | Introducing decision models | The presenter introduces decision models and explains how they differ from using a general-purpose LLM for classification. |
| 04:41 | Cloudflare’s Clef announcement | The video introduces Clef and describes decision models as fast, low-cost systems for structured choices. |
| 08:21 | Bounded questions and Clef’s features | An example shows how a model can classify a support request and return probabilities, followed by Clef’s vision and context-window advantages. |
| 11:57 | Price, latency, and model training | The presenter compares Clef’s cost and latency with Jev’s and discusses the open-source model foundation and training process behind Clef. |
| 14:34 | Building a lesson recommendation demo | The presenter sets up a practical test using a course platform that recommends lessons from a learner’s query. |
| 16:10 | Testing the recommendation feature | The demo matches queries to lessons and handles requests that are unrelated to the available courses. |
| 18:44 | How the model integration works | The presenter walks through the shared request format, model selection, candidate lesson data, and recommendation endpoint. |
| 23:30 | Comparing Jev and Clef in practice | The presenter switches between the models and compares their response times and lesson recommendations across several queries. |
| 25:39 | Conclusions and limitations | The presenter favors Jev in the informal tests while noting Clef’s advantages for image input and larger contexts, then invites viewers to share their use cases. |
Quotes
Section titled “Quotes”So you can simulate this workflow using chat, using an LLM, but you aren’t using the right tool for the task. — 04:09
The decision model performs classifications that help agents decide how to act based on probabilities. — 08:21
Because the answer is bounded, meaning it can only return one of the lessons the student has access to. — 17:12
So, if you need to pass more information to the model or pass an image, it’s better to use Clef — 25:39
Concepts and entities
Section titled “Concepts and entities”decision model, Jev, Clef, OpenAI Decisions API, Cloudflare, Workers AI, OpenRouter, Qwen, TestRigor, Rafael Quintanilha
Full transcript (original language)
Section titled “Full transcript (original language)”00:01 With the release of JEV, we witnessed the birth of a new class of artificial intelligence models christened as decision models. However, JEV’s success was so great that alternatives soon emerged, such as OpenAI’s Decisions API and Clef, an open-source alternative from Cloudflare. That is why, in today’s video, I want to tell you everything about decision models, what they are, and when you should use them. I want to perform a practical test
00:32 comparing JEV with Clef and answer the question: does JEV remain the king of decision models? Folks, I recently brought a very complete analysis here on the channel about JEV and what at the time was called System One Models, which is a name I don’t like very much, and apparently, it didn’t catch on. It is based on System One and System Two, right? A terminology that comes from the book Thinking, Fast and Slow, by
01:02 Daniel Kahneman, right? And it basically means that System One is the one that gives faster answers, right? Instant answers. And the idea of JEV, then, is to serve as a classifier. We tend to use LLMs for this task. We ask the LLM to perform a classification, often forcing it with something called structured outputs, so that it always returns the format we want. But this is
01:34 sort of an abuse of what the LLM was made to solve. And therefore, what JEV brought that was new is its own architecture so that the model’s response is typed, meaning it always follows a specific stipulated pattern, a schema. Got it? So, I went into a lot of detail about JEV, and I even compared it to DeepSeek V4 Flash for a sentiment analysis classification task in the video I made here on the channel , which quickly became the most-watched
02:04 video I’ve had here in almost 2 years on the channel. I will leave the link for you to watch that video later, but what I wanted to talk about in today’s video was, first, to expand a bit on this subject, because post-JEV we saw many other companies bringing this term to the table. In particular, I wanted to talk about OpenAI, which announced at DevDay a new API called the OpenAI Decisions API, which basically aims to do the same thing: be a classifier, only much faster and much cheaper.
02:36 However, in OpenAI’s case, it’s based on Luna, okay? So, it’s not available at the moment I’m recording this video for us to test this API, but we can take a look at what they proposed here in the Decisions API. It says that this API allows for real-time decision-making, using the intelligence of Luna, one of OpenAI’s models, on a specific set of user-defined questions with a finite group of answers, okay?
03:08 So, basically, you already provide the model with what the possible answers are, and that’s why the response is much faster, because the LLM needs to explore a very large set of alternatives, and therefore, it often ends up being slower, okay? And they mention something interesting, that developers can provide context using text or images and receive back answers that they can use to classify content, route requests, or choose the agent’s
03:39 next action. Well, this isn’t available , as I said, but what’s noteworthy here is that developers can use images as context, which is something we don’t have in JV. In JV, it’s only text, alright? But as I said, we haven’t been able to test it yet. What we have here are some community articles explaining more or less how it works, right? So, the idea is that in a chat-based workflow, you have the context. For this context, you will pass a prompt
04:09 that will generate an explanation. And then you parse and validate that result and then pass it to the application. In a decision-based workflow, this context receives a question that is limited, it has a finite limit of answers, okay? In other words, it’s what they called here “allowed answers,” answers that are permitted. So this by default already returns a structured decision, right? So you can simulate this workflow using chat, using an LLM, but you aren’t
04:41 using the right tool for the task. So that is what OpenAI set out to do with the Decisions API. And we have several other solutions that have appeared here , right? We have JV here, but Kev has also emerged. And people started using various names similar to JV, right, to try to take advantage of a bit of the hype it generated, which was indeed very big. But what really caught my attention and made me want to record this video was the launch of Clef,
05:12 another similar model with a similar name, but this time from Cloudflare. All good? And Clef has some very interesting features. It is an open-source model, and they are calling them decision models. So, what Jev wanted to call system one models, it seems the community will want to call decision models, which honestly also seems like a much better name, right? So let’s take a look at this Clef announcement, because since we can test
05:42 Clef today, I’m going to create a practical example in a real application comparing Clef to Jev, so you can see how they work, okay? But before we head to the code part, let’s take a look at the Cloudflare announcement. Well, they start by pointing out that in the last few weeks there has been all this hype around these decision models, like Jev from the company called TypeSh, and they continue saying that, while classifier models have existed for a long time—so it’s nothing new—many
06:13 people came to my video comments saying , “oh, this is just a zero-shot classifier,” trying to downplay the Jev release, but there are some things that are different here, okay? So, Jev introduced a new concept of decision models to the AI world. So, it is a model that produces structured outputs, limited in a cheap, fast, and consistent way. And this can be placed in a workflow when a decision is needed
06:45 , okay? So I said it, engineers like to have the right tool for the right task. So, instead of putting an LLM there, which is something big and slow and sometimes potentially expensive, you can often use a smaller model made exclusively for that task with an even better result, okay? So, these models are capable of working on any set of inputs, without constantly having to retrain the model to incorporate new classification categories. So, this
07:18 contrasts with the world of LLMs, which are largely non-deterministic, they are probabilistic, but are open enough to reason, to think and generate text and tool calls for agentic workflows, okay? So, what was Cloudflare’s response? It was the launch of Clef. All right? And you can already use Clef today over at Workers AI, which is Cloudflare’s AI inference platform, but you can also use it on OpenRouter. I’ll show you a
07:51 comparison with GJF, okay? So they say that Clef is currently the leader when you evaluate it against the GJF Decision index. So there are some benchmarks here where it seems Clef performs better than GJF. So these models are faster, smarter, and completely compatible with the GJF API. This here is really cool, guys. Why? Because it allows us to quickly replace one model with the other. And we’ll see
08:21 that later in this video, so you can experiment with these models hosted by a provider much more easily. The weights are open source on Hugging Face , and anyone can run them locally. So this is quite interesting, okay? Let’s get into what Cloudflare calls a decision model. So the decision model performs classifications that help agents decide how to act based on probabilities. So imagine the input or context is a support message saying: “
08:51 Look, our API started returning 500 errors 20 minutes ago, we can’t proceed , right?““Need help.” So this is the message your customer sent. And you have a set of categories, for example, which team? To which team should I route this request and is it urgent or not, right? So this is what we call bounded questions or allowed answers. You can only respond with one of these things. You can only answer billing, technical, or sales for the question “
09:23 which team?” And you can only answer yes or no when the question is whether it is urgent. So this will pass through here to the decision model. The decision model will analyze all the probabilities and then it will return the probability for each of the answers . So in this case, technical was 100% and yes was 100%. So you receive this information: “Look, the model said it is 100%certain that it’s this category here.” Or the model answered me with 85 %certainty that yes, it is an urgent
09:54 request. And then, based on these probabilities, you, as the application developer, will define what to do. You can set a certain threshold, a certain trigger, and then above that threshold you proceed with a specific action. Or if you are below or between a certain range, you can ask for more information . Or if your confidence in the result is very low, you can, for example, request that a human agent, someone manually, go there and contact the
10:24 person, okay? So that is a possible workflow you could build with a decision model. But what is interesting here is to see how Clef, that is, Cloudflare’s decision model, is different from other decision models, because several have appeared, okay? Kev appeared, LIA appeared, so several other models have emerged to compete. And Cloudflare has some interesting differences. First of all, okay? They have vision, which is very cool because you can put an image as context for
10:56 your decision model. We have seen that OpenAI will want to put this in the Decisions API, which is not yet available. Jev still doesn’t have it at the moment I’m recording this video, so that’s already something cool, okay? And the second very interesting thing is that Clef has a context of 64,000 tokens, because Jev is only 32, and 32,000 is very small, depending on what you want to do. For example, imagine you want to build a code reviewer, right? You want a code reviewer, and
11:26 then this code reviewer has to receive, for example, all the changes of a certain pull request to decide if that needs a human review. A classic example of a workflow here. If my pull request is very large, this window of only 32,000 tokens is small, right? We won’t be able to do that. So, doubling it is already something interesting. So, having vision and a larger context helps a lot. This is one of the main advantages that Clef has today. Now, not everything is perfect, because if we compare price and latency, then the
11:57 story changes a bit, okay? I compared here on OpenRouter, Clef, the Clef Flash version, which is a slightly lighter version of Clef, and Jev. Got it? So you can see that Clef, as well as Clef Flash, both can receive images as input, but look at the price, okay? Jev costs, rounding up here, 4 cents per million input tokens, okay? So it is basically half of Clef Flash, and regular Clef is six times more expensive, okay? So it is a very
12:29 significant difference. And if we look at latency, the latency here for Jeff is also faster than Clef’s latency. It is true that the latency for both is very fast, okay? I mean, they are all quite quick. In half a second at most, you already have your answer. So that is cool. But note that although Clef has vision and a larger context, it will be more expensive and potentially slower. Now, the last technical detail I wanted to share with you is that here
13:00 in this blog, which I will link in the description if you want to read it later, they talk about how they trained Clef. Okay, there are a lot of technical arguments here that I won’t go into in this video, but one thing that caught my attention is that Clef 3.8 B. Isn’t that curious? A local LLM that you can run on your own machine. I have actually tested the Qwen 3.8 B here on the channel. I will leave the link if you want to watch it later. So,
13:31 based on the local model, they managed to generate Clef and Clef Flash. It’s basically the same thing, just on top of Qwen 3.5 B. That one runs on much simpler computers, okay? Like, a Mac Mini, for example, it runs it easily. So they took this open-source base architecture and performed several post-training steps, fine-tuning, etc. They used the RLCD technique, which we also saw in the original JV video, to generate this model and made it
14:02 available via Workers API on Cloudflare . So this is interesting for us to see how open-source models stack gains on top of each other, right? Because we tend to sometimes look at improvements coming from the open-source world and think that, perhaps, because it isn’t practical for us at the moment—like, I won’t program with Qwen 3.8 B in my daily life, I’ll use the 5.5—it’s true, but look, these small advances compound to become new models that
14:34 serve as a base for other technologies that may emerge in the future. So, at the end of the day, it is always interesting for us to have a greater supply of models and open-source technology in the market. Wonderful, guys. So, now I want to test it with you in practice. Since I already have my app programmed there on Cloudflare, I will test it here directly with their Workers AI, right? So you can come here , look, to models, okay? And for models , if you search for Clef, both the standard Clef and Clef Flash will
15:05 appear here. Clicking on them, you can see all the details, including how you can use them. And it’s the exact same setup as the JV API we saw in the previous video. So this is really cool because it makes it much easier to swap models if a much better one comes along soon. Got it? Now, another service that gives you much more peace of mind when switching models, knowing the final result won’t change, is TestRigor, our partner here on the channel. That’s
15:37 because, guys, with TestRigor you can test everything your agent does, ensuring it only returns results once all tests are passing. So it doesn’t matter if you’re using model A or B, because you can write a PRD, write a test scenario, and be sure the model will work until that test passes, regardless of the tech you use behind the scenes, okay? So TestRigor is a partner of ours here on the channel that you can use within your agentic
16:10 workflow via API, CLI, or even their dashboard. And if you want to check out TestRigor and use it for free, the link to test it will be in the description and in the pinned comment. Wonderful, everyone. So what do I want to show you today? Well, I launched my course platform last week, including the AI Engineer track which features three courses, okay? The Agentic Programming course, the AI Engineering Fundamentals course, and the Prompt Engineering course. Some questions I received from
16:41 people during the launch were: Rafael, where do I start, right? Where should I begin studying? Since we’re going to have many lessons here, right? In total , there will be about 80 lessons across these three courses, right? In the full track. I thought about creating a way for someone entering the platform to search for what they want to study that day, and then we will return the most suitable lesson for them. This seems like a perfect example of a decision model. Why? Because the answer is
17:12 bounded, meaning it can only return one of the lessons the student has access to. Got it? So, how did I build this? I took the transcript of all the lessons and generated a summary of them. Rafael , why did you need to generate a summary? Because the full lessons would exceed the context. And since we saw that these models have a smaller context, 32,000 tokens for Jeev and 64,000 tokens for Cleff, I needed to reduce the context by summarizing the lessons. I created this interface here,
17:43 I’ll show you the code, but first, so you understand how it works, let me show you here in the interface, okay? So the student can go here to the course area and search for what they want to learn today. I don’t know, let’s put here, I want to learn about TDD. And then I did the search and it landed here on a lesson, Spec Driven Development as a method. And then I can click here, it’s a lesson from the agentic programming course. So it worked perfectly. And I don’t know, I can do another test here. I want to learn about context management. And it
18:13 took more or less what? 1 second, 2 seconds. And here is the lesson, degradation and context management. Wonderful. And if I ask something that has nothing to do with it, I don’t know , I want to learn how to plant potatoes . There it is. No published lesson in your courses covers this subject. So, pretty cool. I found this functionality very interesting. And let me show you, then, how I made it in practice using Clef. And then we will switch to Jeev to see if there is any difference. Alright? So there you go guys, I will show you the part of the code that is most relevant. I created here a file
18:44 called Decision Model, where there are all the possibilities of decision models that we can use at this moment. And here we have both Clef and Jeev. You see here that in Clef, which is a Cloudflare product and the program runs on Cloudflare, it is very easy, right? I basically run here, env.ai.run, AI.RUN. I pass the Clef ID, which is basically just the model ID within Cloudflare, and I pass this request. And look how cool, this request here, folks, is exactly the same for Jeev and
19:16 for Clef. It’s that idea that it is Jeev-compatible, that is, it is the same request signature that we pass, right? Now with Jeev, we need to make a request, the code is a little bit longer, but nothing too much. We just make a normal HTTP request, which does a fetch passing the Jeev URL. And here you need to have a Typefe account, providing your, your API key. And basically, you provide your API key and get the same response. So, it is very easy to create a router, a switch,
19:46 where you can configure which of these two you will call. In this case, I am configuring it through an environment variable, okay? So, an environment variable itself will tell me if I should use Clef or if I should use JV to perform my classification. And look here, I have the request schema, so it is a choice type, right? In other words , it will need to choose from within a group. We will have the probabilities of each choice and the model’s confidence in those probabilities, okay ? Again, I spoke much more about this
20:18 in the original Jeff video. So, if you haven’t seen it yet, I recommend that you watch that video right after this one, okay? And we also have the possible answers here, okay? And then the answers will follow this choices schema. So, wonderful, very easy for you to understand. It is the same request, it is the same format that you provide to both JV and Clef. And let’s look here at the back end at how this works, okay? So, it is basically the recommendation endpoint. And look how cool, I go there and get all the classes available for that student. And
20:50 from those classes there, I will take the summary, the class summary. This summary I generated based on the transcript, as I told you, okay? So we have here the request that we are going to make, and this request will receive the state, instructions, and criteria. Let’s look at them one by one here, okay? So here in the state, which is basically the context, we will pass the query as the learning objective. The query, guys, is what the user will type , it is what we saw there in the input, right? So “planting potatoes” here, in
21:22 this case, is exactly the input that will be sent to our API, right, to the recommendation endpoint as a query. But we also have instructions, and it is precisely in the instruction that we tell what the model has to choose. So, we will say something like, choose the class that best teaches that user’s learning objective. And then the query is exactly that learning objective. And then we tell it to choose “no match” if no class, right, fits or if the request is too vague, okay? So, I don’t know,
21:54 if I take this, for example, and say what I want to learn today, I want to learn, and then it found a class here, which could make sense, I don’t know, let me try something else. I want to learn how to be a good programmer. And here it already shows it’s too vague, there won’t be anything like that in the course, okay? So this is exactly when the request is too vague, right? So let’s go back to the request. And look here at the cool part. We go through all the candidates. What are the candidates? They are the classes available to the user. And here we have
22:27 these candidates as an object with this schema. So, we have here, the summary, the title, and several other things that we pass as an option so that the model, receiving that information, can make the decision on which class has the best chance of helping the student, got it? And then in the end, we will have a response. And if we look here at the choose option function, which is what we showed earlier, our response, as I said, will be the one with the highest probability according to the
22:58 model, right? So, that’s basically it, guys. Once I find the class, I basically just return it to be able to build that widget for you, okay? So, very easy, really cool to use this type of model in practice. Now I’ll do the following, I’ll switch from clef to Jev and we’ll see if we can notice any difference. Wonderful, guys. We already have JV running, so let me even run that last query we did. Oh, it seemed a bit faster to me, right? I want to learn how to use AI and here it generated this one for me, right? The prompt as SDD training organization.
23:30 Wow, much faster is JV. JV is much faster. Here, look. Much better. Here is how inference works. Much better here. I want to learn how to plant potatoes. Yeah, guys, testing here in a not-very-scientific way, it seemed quite clear to me that JV is faster, okay? I’m looking here at what my cloud did. Let me even put it here so you can see. Oh, I switched here with cloud. So , basically, I changed the enviable to jeev, oh, the time difference, okay? It
24:05 was taking more or less that, a second and a bit for Clef. And here with Jev, half a second, it was the fastest, okay ? I’ll even tell him here, look. Let’s run the same request with CLV for us to see the difference in time and what the answer is. So, just so we can have a more complete test here, I’m asking Claude to switch from Jev back to Clef, run these same queries that he did here , and compare the answer and the time so we know who won. Wonderful, guys.
24:37 Claude has already finished our comparison here and look, for the request “AI is forgetting decisions from a long conversation.” Clef returned context and reasoning, and Jev returned degradation and context management. It seems to me that Jev was better here. And look at that, basically five times faster. For the request “build an agent loop without a framework,” both answered the same thing, and again Jev was four times faster than it. Then “the agent did a bunch of stuff I didn’t ask for,” and
25:07 here look, Clef, “prompt as information organization” and Jev, “vague prompts fail.” Very good as well. I’ll also go with Jev’s choice here, which was also four, five times faster. For the question “make sourdough bread,” neither of them answered anything. And again, Jev, much faster. And wow, on the request, “OK,” Clef answered something completely unrelated and Jev, “no match.” So, it seems clear to me here, guys, in the “feeling” test and here by doing this slightly better comparison with Opus, that Jev is still
25:39 the superior model for decision-making. Now, it comes with a downside. First downside, it’s closed source; you can’t host it on your own machine or run it locally, okay? Second downside, it still doesn’t accept images and has a smaller context window. So, if you need to pass more information to the model or pass an image, it’s better to use Clef because you won’t be able to do it with Jev. To use Jev, you’ll need to combine a workflow with another model
26:09 that just does, you know, the Vision part, provides the image description, and then feed that into the context with Jev. Even so, it’s possible it’s better, because we’re seeing that perhaps even in the model’s own accuracy, Jev is superior. But now I want to hear from you what you thought of this comparison and what you’ve been thinking of the new Decisions. Can you see a use case or do you still think it’s just hype? Let me know down in the comments. Also, let me know if you are using JV or Clef for anything else.
26:42 I want to know what the community is building. So go ahead and subscribe to the channel. Here we talk about everything, artificial intelligence. We review models, run practical tests, and talk about the news that comes out every week. I’m sure you’re going to like it. So, please, leave your like , and share it with your friends. If you want to learn about the fundamentals of AI engineering, agentic programming, and Harness Engineering, I invite you to check out the AI Engineer track, which is the tool from the AI
27:13 program I showed you, and soon this functionality I showed in this video will be available to students there. The link for you to check out the AI program will be in both the description and the pinned comment. I thank you immensely for staying with me until now . I thank Test Pride for being a partner and believing in our project.