<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Krzysztof Głuszczyk</title>
    <description>The latest articles on DEV Community by Krzysztof Głuszczyk (@kgluszczyk).</description>
    <link>https://dev.to/kgluszczyk</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4140287%2Fa52e662c-39ac-4c97-b206-db8baceee595.png</url>
      <title>DEV Community: Krzysztof Głuszczyk</title>
      <link>https://dev.to/kgluszczyk</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/kgluszczyk"/>
    <language>en</language>
    <item>
      <title>Would I buy the 128 GB M5 Max or the 96 GB M5 Ultra for local coding?</title>
      <dc:creator>Krzysztof Głuszczyk</dc:creator>
      <pubDate>Mon, 23 Nov 2026 17:44:33 +0000</pubDate>
      <link>https://dev.to/kgluszczyk/would-i-buy-the-128-gb-m5-max-or-the-96-gb-m5-ultra-for-local-coding-4f83</link>
      <guid>https://dev.to/kgluszczyk/would-i-buy-the-128-gb-m5-max-or-the-96-gb-m5-ultra-for-local-coding-4f83</guid>
      <description>&lt;p&gt;&lt;strong&gt;My pick for running several coding agents would be the 128 GB M5 Max.&lt;/strong&gt; If local inference were my main workload and my models fit with room for the rest of my setup, I’d test the 96 GB M5 Ultra first.&lt;/p&gt;

&lt;p&gt;For my own desk, I’d try moving builds, tests, and dev servers to a second machine before buying either Mac. I measured inference on one rented 256 GB M5 Ultra. I didn’t benchmark either of the two Macs I was considering.&lt;/p&gt;

&lt;p&gt;My team is working on an inference cluster. That got me thinking about what I’d want on my own desk. My Claude Code and Codex subscriptions, along with the tools and remote access I already use, cover my day-to-day coding work. I often have several agents working at once. Their builds, test suites, and running apps can all end up on the same machine. A second machine would give those jobs their own resources. It could also give me somewhere to try local models and render on the GPU.&lt;/p&gt;

&lt;p&gt;The Mac Studio made the question concrete. At iSpot, the M5 Max with 128 GB cost PLN 10,000 more than the same chip with 48 GB. The 128 GB Max was PLN 26,999. The 96 GB Ultra was PLN 27,999. &lt;a href="https://ispot.pl/apple-mac-studio-18-rdzeniowy-procesor-apple-m5-max-gpu-40-rdzeni-ram-48gb-dysk-1-tb" rel="noopener noreferrer"&gt;iSpot’s Max memory options&lt;/a&gt; · &lt;a href="https://ispot.pl/apple-mac-studio-30-rdzeniowy-procesor-apple-m5-ultra-gpu-64-rdzeni-ram-96gb-dysk-1-tb-1" rel="noopener noreferrer"&gt;iSpot’s 96 GB Ultra&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The 96 GB Ultra has more CPU and GPU cores and nearly twice the published memory bandwidth. The Max gives me 32 GB more memory. Apple skips 128 GB on the Ultra. Its next memory option is 256 GB, paired with an 80-core GPU and a much higher price. &lt;a href="https://support.apple.com/en-us/128107" rel="noopener noreferrer"&gt;Apple Mac Studio specifications&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So I had two questions. Would I use enough memory to justify the PLN 10,000 upgrade? At roughly PLN 27,000, would I get more out of the 128 GB Max or the 96 GB Ultra? I rented a 256 GB Ultra to see how much memory my workloads used and where I spent time waiting. All my measurements come from that rental.&lt;/p&gt;

&lt;h2&gt;
  
  
  Would I buy one?
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;I’d try a separate build and test machine before buying a Mac Studio.&lt;/strong&gt; I’d keep my Claude Code and Codex workflow and move a build, a test suite, and an app instance to a spare or borrowed host. I’d choose a host that supports the operating system those jobs need. I’d give each concurrent job its own environment and check whether my main workstation stays responsive. I’d also track the time it takes to send changes over, run the job, and get the result back. For local inference and GPU rendering experiments, I’d start with hourly rentals.&lt;/p&gt;

&lt;p&gt;I like the idea of running models at home. The jobs I’d run at home today are occasional experiments. My subscriptions cover the coding work I do regularly. In the time I have for personal projects, I care about how long it takes to get to a change I can trust. Waiting for a long prompt matters when I’m blocked. So do retries, reviewing the diff, and running the tests. I’d use a local helper for a small, repeatable task if it reduced that total.&lt;/p&gt;

&lt;p&gt;I’d consider a monthly rental if I started using the remote machine most days or needed to leave work running between sessions. I’d compare quotes for hardware that can run the same workload, then count the hours I’d actually be billed, including idle time. At the $2.50 hourly rate I paid, 40 billed hours cost $100. For example, a $400 monthly quote for a comparable machine would equal 160 billed hours. I’d buy a Mac Studio if I found regular work that benefits from macOS or the GPU and a configuration that handles it. A build and test worker could have a much smaller hardware budget. &lt;a href="https://mac-studio.enverge.ai/" rel="noopener noreferrer"&gt;Enverge hourly rate&lt;/a&gt; · &lt;a href="https://enverge.ai/docs/billing" rel="noopener noreferrer"&gt;Enverge billing rules&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;For one coding model, I’d check the 48 GB Max first.&lt;/strong&gt; If 48 GB is tight, I’d check the 64 GB option for PLN 2,000 more. I’d pay for 128 GB only if my workload needs the extra room. On the rental, Ollama reported about 38 GB loaded for Flint 40B and 43 GB for Qwen3.8 27B (Qwen MLX) near 256k context. Those readings leave little apparent room on a 48 GB machine for other software. I’d test with my IDE and services open before ordering it.&lt;/p&gt;

&lt;p&gt;The 128 GB Max I’d shortlist has a 1 TB SSD. Cloud models handle my agents’ inference today. Their builds, tests, and app instances still compete for memory on my machine. I’d check peak memory use and swap during my usual work before ordering.&lt;/p&gt;

&lt;p&gt;I checked these iSpot prices in Poland on November 22, 2026. Every configuration in the table has a 1 TB SSD.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Mac Studio&lt;/th&gt;
&lt;th&gt;CPU cores&lt;/th&gt;
&lt;th&gt;GPU cores&lt;/th&gt;
&lt;th&gt;Memory bandwidth&lt;/th&gt;
&lt;th&gt;Listed price&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;a href="https://ispot.pl/apple-mac-studio-18-rdzeniowy-procesor-apple-m5-max-gpu-40-rdzeni-ram-48gb-dysk-1-tb" rel="noopener noreferrer"&gt;M5 Max 48 GB&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;18&lt;/td&gt;
&lt;td&gt;40&lt;/td&gt;
&lt;td&gt;614 GB/s&lt;/td&gt;
&lt;td&gt;PLN 16,999&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;M5 Max 64 GB&lt;/td&gt;
&lt;td&gt;18&lt;/td&gt;
&lt;td&gt;40&lt;/td&gt;
&lt;td&gt;614 GB/s&lt;/td&gt;
&lt;td&gt;PLN 18,999 (from the memory options)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;a href="https://ispot.pl/apple-mac-studio-18-rdzeniowy-procesor-apple-m5-max-gpu-40-rdzeni-ram-128gb-dysk-1-tb-1" rel="noopener noreferrer"&gt;M5 Max 128 GB&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;18&lt;/td&gt;
&lt;td&gt;40&lt;/td&gt;
&lt;td&gt;614 GB/s&lt;/td&gt;
&lt;td&gt;PLN 26,999&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;a href="https://ispot.pl/apple-mac-studio-30-rdzeniowy-procesor-apple-m5-ultra-gpu-64-rdzeni-ram-96gb-dysk-1-tb-1" rel="noopener noreferrer"&gt;M5 Ultra 96 GB&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;30&lt;/td&gt;
&lt;td&gt;64&lt;/td&gt;
&lt;td&gt;1.2 TB/s&lt;/td&gt;
&lt;td&gt;PLN 27,999&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;a href="https://ispot.pl/apple-mac-studio-36-rdzeniowy-procesor-apple-m5-ultra-gpu-80-rdzeni-ram-256gb-dysk-1-tb" rel="noopener noreferrer"&gt;M5 Ultra 256 GB&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;36&lt;/td&gt;
&lt;td&gt;80&lt;/td&gt;
&lt;td&gt;1.2 TB/s&lt;/td&gt;
&lt;td&gt;PLN 54,499&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Black Friday price check.&lt;/strong&gt; On November 22, iSeer listed the 128 GB Max with a 1 TB SSD at PLN 26,099 including VAT, with a delivery estimate of three to eight weeks. I’d use that as my baseline when comparing offers for the same configuration. Apple’s Polish Black Friday gift-card offer leaves out the Mac Studio. &lt;a href="https://iseer.pl/produkt/apple-mac-studio-m5-max-18-cpu-40-gpu-128gb-1tb-ssd-10-gbit-ethernet-srebrny" rel="noopener noreferrer"&gt;iSeer listing&lt;/a&gt; · &lt;a href="https://www.apple.com/pl/shop/gifts/black-friday-event/terms-conditions" rel="noopener noreferrer"&gt;Apple’s Black Friday terms&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Here’s what would change my choice.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;One Flint or Qwen agent, and waiting on long prompts is the main problem.&lt;/strong&gt; Put the &lt;strong&gt;96 GB Ultra&lt;/strong&gt; on the shortlist. Ollama reported about 38 GB and 43 GB loaded near 256k tokens on the rental, well below the total memory of either smaller Mac. The 96 GB Ultra has more GPU cores and higher published memory bandwidth than the Max. I’d check how much time it saves on my own prompts before paying the premium.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;One long Flash-Next session.&lt;/strong&gt; I’d test the &lt;strong&gt;128 GB Max&lt;/strong&gt; with my exact Flash-Next model file (in GGUF format) and the llama.cpp server before relying on it. The server reached 86.3 GiB of process RSS with one slot on the rental. I’d use the smaller Mac’s actual GPU memory budget and the outcome of the run to decide. If I’m happy to change model files and serving software, the &lt;strong&gt;96 GB Ultra&lt;/strong&gt; also stays in the running. Community runs completed a 128k Flash-Next prompt on both machines with the same oMLX version and model tag. The 96 GB run used a compressed attention cache. The 128 GB run used a different cache setup. Both are useful starting configurations, with different settings that can affect speed. &lt;a href="https://omlx.ai/benchmarks/performance/77t38f0x" rel="noopener noreferrer"&gt;96 GB Ultra run&lt;/a&gt; · &lt;a href="https://omlx.ai/benchmarks/performance/cczcb06y" rel="noopener noreferrer"&gt;128 GB Max run&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Four long Flash-Next sessions at once.&lt;/strong&gt; I’d try the &lt;strong&gt;128 GB Max&lt;/strong&gt; with the same four prompts before buying &lt;strong&gt;256 GB&lt;/strong&gt;. The 256 GB Ultra completed the run, with a peak of 102.1 GiB for the server process. The fourth request took 388 seconds to start replying. That time came from 80 GPU cores. I’d run the acceptance check below on the 40-core Max. If it runs out of memory, I’d consider the 256 GB Ultra if its observed wait is acceptable. If the wait is the problem, I’d try fewer parallel requests or shorter prompts first.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;My test before buying more memory.&lt;/strong&gt; If I can borrow the exact 128 GB configuration, I’d run the pinned four-prompt setup with the IDE and services I typically leave open. I’d set two limits beforehand. How long can each request wait for its first token, and how long can the whole reply take? I’d require all four to finish within both limits. I’d record the recommended GPU working-set size reported by macOS Metal. That recommendation can be lower than the machine’s total memory. I’d check for loading errors and watch memory pressure and swap through the final reply. A process RSS reading cannot settle whether the GPU will accept the workload. If I can’t test the Max and must run four sessions, the 256 GB Ultra is the option I saw complete that run. Whether I need that much memory remains an open question. I made a small checker that applies the wait and swap limits I choose to a recorded run. &lt;a href="https://github.com/kgluszczyk/mac-studio-local-agent-bench/releases/tag/acceptance-check-v1" rel="noopener noreferrer"&gt;Acceptance checker and instructions&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/kgluszczyk/mac-studio-local-agent-bench/tree/ac14a7efdadf1bf39382349403ea3769e6ac510f" rel="noopener noreferrer"&gt;Scripts, per-task results and verification command&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Why I rented one machine
&lt;/h2&gt;

&lt;p&gt;I rented a 256 GB Ultra so the larger workloads had room to run. I wanted to answer three questions. How much memory do the models actually use? How long will I wait on the first turn and on follow-ups? And does a quick reply translate into more working code?&lt;/p&gt;

&lt;h3&gt;
  
  
  What the Enverge rental was like
&lt;/h3&gt;

&lt;p&gt;Enverge was a good option for this experiment. I waited a little over a week for a Mac to become available. Once it was ready, I connected over SSH and ran my scripts from a non-admin account. The rate was $2.50 an hour. From the approximate start time to the end of verification, the machine was up for roughly 14¾ hours, about $37 at that rate. That’s my estimate through the last check, before dashboard deletion. Enverge says queue time is free. &lt;a href="https://mac-studio.enverge.ai/" rel="noopener noreferrer"&gt;Enverge Mac Studio&lt;/a&gt; · &lt;a href="https://enverge.ai/docs/queue" rel="noopener noreferrer"&gt;Queue documentation&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The last step was manual. I could stop the tests from my terminal. To stop the charges, I had to copy my results out and choose &lt;strong&gt;Delete&lt;/strong&gt; in the Enverge dashboard. Billing continues while the instance exists, even when it's idle. I couldn't find a documented command or API for automating that last step. &lt;a href="https://enverge.ai/docs/billing" rel="noopener noreferrer"&gt;Enverge billing&lt;/a&gt; · &lt;a href="https://enverge.ai/docs/instances" rel="noopener noreferrer"&gt;Instance controls&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Why the smaller Macs are estimates
&lt;/h3&gt;

&lt;p&gt;I tried to make the rental behave like a smaller Mac. The first test just flagged workloads that crossed 96 GB or 128 GB. I later tried reserving memory in another process. The model servers still saw the full GPU budget. So the numbers below come from the 256 GB Mac. I use them to estimate how much room the smaller machines would have.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Name used below&lt;/th&gt;
&lt;th&gt;Measured setup&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Flint&lt;/td&gt;
&lt;td&gt;Recursive Flint 40B QAT int4, about 2.5B active parameters, Ollama 0.40.13&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Qwen MLX&lt;/td&gt;
&lt;td&gt;Qwen3.8 27B with NVFP4 weights in Ollama’s MLX package, Ollama 0.40.13&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Flash-Next&lt;/td&gt;
&lt;td&gt;Qwen3.8-Flash-Next 125B, Unsloth UD-Q4_K_XL GGUF, llama.cpp build 12604&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Changing the model file or the software that runs it can change these numbers.&lt;/p&gt;

&lt;h2&gt;
  
  
  Would I actually need the extra memory?
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Workload on the 256 GB rental&lt;/th&gt;
&lt;th&gt;Ollama loaded size&lt;/th&gt;
&lt;th&gt;Peak sampled process RSS&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Flint, one session near 256k tokens&lt;/td&gt;
&lt;td&gt;38.1 GB (35.5 GiB)&lt;/td&gt;
&lt;td&gt;21.3 GiB&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Qwen MLX, one session near 256k tokens&lt;/td&gt;
&lt;td&gt;42.9 GB (40.0 GiB)&lt;/td&gt;
&lt;td&gt;15.1 GiB&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Flash-Next, one slot, one 131k-token prompt&lt;/td&gt;
&lt;td&gt;—&lt;/td&gt;
&lt;td&gt;86.3 GiB (about 92.7 GB)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Flash-Next, four slots, four 131k-token prompts&lt;/td&gt;
&lt;td&gt;—&lt;/td&gt;
&lt;td&gt;102.1 GiB (about 110 GB)&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The Ollama readings leave more apparent headroom for Flint and Qwen. They cover the loaded model, while RSS measures resident memory in the sampled processes. Neither covers the whole machine.&lt;/p&gt;

&lt;p&gt;I sent four cold Flash-Next prompts together. Their first tokens arrived after roughly &lt;strong&gt;99, 196, 294, and 388 seconds&lt;/strong&gt;. That pattern is consistent with fresh prompts waiting their turn. I’d want warm follow-up timings too if my agents usually keep their sessions open.&lt;/p&gt;

&lt;h2&gt;
  
  
  How long does a short reply take in a long session?
&lt;/h2&gt;

&lt;p&gt;A model has to read the prompt before it can reply. On a follow-up, the server can reuse work from the start of the prompt. I timed each entire short reply. Each row is one conversation.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Setup&lt;/th&gt;
&lt;th&gt;Approx. prompt&lt;/th&gt;
&lt;th&gt;Reply cap&lt;/th&gt;
&lt;th&gt;First reply, cold prompt&lt;/th&gt;
&lt;th&gt;Second reply&lt;/th&gt;
&lt;th&gt;Third reply&lt;/th&gt;
&lt;th&gt;Fourth reply&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Flint&lt;/td&gt;
&lt;td&gt;128k&lt;/td&gt;
&lt;td&gt;100 tokens&lt;/td&gt;
&lt;td&gt;30.42 s&lt;/td&gt;
&lt;td&gt;1.41 s&lt;/td&gt;
&lt;td&gt;1.35 s&lt;/td&gt;
&lt;td&gt;1.35 s&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Qwen MLX&lt;/td&gt;
&lt;td&gt;128k&lt;/td&gt;
&lt;td&gt;100 tokens&lt;/td&gt;
&lt;td&gt;119.02 s&lt;/td&gt;
&lt;td&gt;11.33 s&lt;/td&gt;
&lt;td&gt;1.91 s&lt;/td&gt;
&lt;td&gt;2.06 s&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Flint&lt;/td&gt;
&lt;td&gt;252k&lt;/td&gt;
&lt;td&gt;100 tokens&lt;/td&gt;
&lt;td&gt;97.34 s&lt;/td&gt;
&lt;td&gt;1.98 s&lt;/td&gt;
&lt;td&gt;1.98 s&lt;/td&gt;
&lt;td&gt;1.99 s&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Qwen MLX&lt;/td&gt;
&lt;td&gt;251k&lt;/td&gt;
&lt;td&gt;100 tokens&lt;/td&gt;
&lt;td&gt;325.26 s&lt;/td&gt;
&lt;td&gt;13.74 s&lt;/td&gt;
&lt;td&gt;2.33 s&lt;/td&gt;
&lt;td&gt;2.50 s&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Flash-Next&lt;/td&gt;
&lt;td&gt;120k&lt;/td&gt;
&lt;td&gt;150 tokens&lt;/td&gt;
&lt;td&gt;97.18 s&lt;/td&gt;
&lt;td&gt;4.27 s&lt;/td&gt;
&lt;td&gt;4.43 s&lt;/td&gt;
&lt;td&gt;—&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;On the cold ~128k prompt, Flint finished its short reply in &lt;strong&gt;30 s&lt;/strong&gt; and Qwen took &lt;strong&gt;119 s&lt;/strong&gt;. By replies three and four, both were around &lt;strong&gt;two seconds&lt;/strong&gt;. I kept the start of the prompt fixed for those follow-ups.&lt;/p&gt;

&lt;h2&gt;
  
  
  Which setup gets me to working code?
&lt;/h2&gt;

&lt;p&gt;I first ran 164 HumanEval+ tasks per setup, one attempt per task, with an 8,192-token output budget, temperature 0.6, and top-p 0.95. A solution passed when it passed both the base and extended tests. &lt;a href="https://github.com/evalplus/evalplus" rel="noopener noreferrer"&gt;EvalPlus&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I used EvalPlus to regrade the saved answers on Linux ARM64 and then under WSL on Linux x86-64. All 492 pass/fail results matched the macOS run. Both regrades used the original answers. &lt;a href="https://github.com/kgluszczyk/mac-studio-local-agent-bench/releases/tag/linux-replay-v1" rel="noopener noreferrer"&gt;Linux replay and per-task verdicts&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The full-run timing figures below include stretches when I was setting up the virtual machine. I also checked timings after setting aside tasks from those windows.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Setup&lt;/th&gt;
&lt;th&gt;Passed&lt;/th&gt;
&lt;th&gt;Generation time&lt;/th&gt;
&lt;th&gt;Correct per generation hour&lt;/th&gt;
&lt;th&gt;Generated tokens&lt;/th&gt;
&lt;th&gt;Replies cut short&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Flint 40B QAT int4, Ollama&lt;/td&gt;
&lt;td&gt;151/164&lt;/td&gt;
&lt;td&gt;26.0 min&lt;/td&gt;
&lt;td&gt;348&lt;/td&gt;
&lt;td&gt;246,720&lt;/td&gt;
&lt;td&gt;4&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Qwen3.8 27B MLX NVFP4, Ollama&lt;/td&gt;
&lt;td&gt;150/164&lt;/td&gt;
&lt;td&gt;16.8 min&lt;/td&gt;
&lt;td&gt;537&lt;/td&gt;
&lt;td&gt;149,620&lt;/td&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Flash-Next UD-Q4_K_XL, llama.cpp&lt;/td&gt;
&lt;td&gt;150/164&lt;/td&gt;
&lt;td&gt;58.7 min&lt;/td&gt;
&lt;td&gt;153&lt;/td&gt;
&lt;td&gt;194,058&lt;/td&gt;
&lt;td&gt;9&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The HumanEval+ scores differ by at most one task. On the 102 exercises all three passed outside the VM setup windows, Qwen took &lt;strong&gt;8.7 min&lt;/strong&gt; of generation, Flint &lt;strong&gt;12.9 min&lt;/strong&gt;, and Flash-Next &lt;strong&gt;22.3 min&lt;/strong&gt;. That gives me a speed comparison on successful answers from one run. &lt;a href="https://github.com/kgluszczyk/mac-studio-local-agent-bench/releases/tag/linux-replay-v1" rel="noopener noreferrer"&gt;Shared-success timing and Linux regrade&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Then I used Aider, a terminal coding assistant, to see how each model handled feedback. Each model edited a file. If the tests failed, Aider sent the output back to the model and let it try again. I sorted the 34 Python exercises by name, shuffled them with Python seed 20261121, and used the first 12 in that order for every model. &lt;a href="https://github.com/Aider-AI/polyglot-benchmark/tree/7e0611e77b54e2dea774cdc0aa00cf9f7ed6144f" rel="noopener noreferrer"&gt;Aider’s Polyglot benchmark&lt;/a&gt; I compared up to two attempts with whole-file edits, a 65,536-token context and a 32,768-token output limit, temperature 1.0, and top-p 0.95. In an early run, I asked Flint for patches and set a limit of 8,192 tokens per reply. It kept hitting that limit, so I stopped. I then set up a fresh test with the same settings for all three models.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Setup&lt;/th&gt;
&lt;th&gt;Completed&lt;/th&gt;
&lt;th&gt;First try&lt;/th&gt;
&lt;th&gt;Within two tries&lt;/th&gt;
&lt;th&gt;Time&lt;/th&gt;
&lt;th&gt;Output tokens&lt;/th&gt;
&lt;th&gt;Replies cut short&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Flint 40B QAT int4&lt;/td&gt;
&lt;td&gt;12/12&lt;/td&gt;
&lt;td&gt;0/12&lt;/td&gt;
&lt;td&gt;6/12&lt;/td&gt;
&lt;td&gt;46:04&lt;/td&gt;
&lt;td&gt;415,280&lt;/td&gt;
&lt;td&gt;2&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Qwen3.8 27B MLX&lt;/td&gt;
&lt;td&gt;12/12&lt;/td&gt;
&lt;td&gt;5/12&lt;/td&gt;
&lt;td&gt;10/12&lt;/td&gt;
&lt;td&gt;7:39&lt;/td&gt;
&lt;td&gt;55,640&lt;/td&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Flash-Next UD-Q4_K_XL&lt;/td&gt;
&lt;td&gt;5/12&lt;/td&gt;
&lt;td&gt;0/5&lt;/td&gt;
&lt;td&gt;5/5&lt;/td&gt;
&lt;td&gt;57:37, stopped during exercise six&lt;/td&gt;
&lt;td&gt;170,730&lt;/td&gt;
&lt;td&gt;2&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F0bx969aeur4frx5ugsp7.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F0bx969aeur4frx5ugsp7.png" alt="On the 256 GB M5 Ultra, Flint finished a cold 128k reply in 30.42 seconds versus 119.02 for Qwen MLX. In Aider, Qwen passed 10 of 12 in 7:39 and Flint passed 6 of 12 in 46:04." width="800" height="529"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Qwen completed all 12 exercises and passed &lt;strong&gt;10 in 7:39&lt;/strong&gt;. Flint also completed all 12 and passed &lt;strong&gt;6 in 46:04&lt;/strong&gt;. I stopped Flash-Next during exercise six to cap rental time. The next table compares the five exercises all three completed.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Setup&lt;/th&gt;
&lt;th&gt;First attempt&lt;/th&gt;
&lt;th&gt;Within two attempts&lt;/th&gt;
&lt;th&gt;Time through exercise five&lt;/th&gt;
&lt;th&gt;Passed per elapsed hour&lt;/th&gt;
&lt;th&gt;Replies cut short&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Flint&lt;/td&gt;
&lt;td&gt;0/5&lt;/td&gt;
&lt;td&gt;2/5&lt;/td&gt;
&lt;td&gt;22:35&lt;/td&gt;
&lt;td&gt;5.3&lt;/td&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Qwen MLX&lt;/td&gt;
&lt;td&gt;2/5&lt;/td&gt;
&lt;td&gt;4/5&lt;/td&gt;
&lt;td&gt;4:01&lt;/td&gt;
&lt;td&gt;59.8&lt;/td&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Flash-Next&lt;/td&gt;
&lt;td&gt;0/5&lt;/td&gt;
&lt;td&gt;5/5&lt;/td&gt;
&lt;td&gt;52:16&lt;/td&gt;
&lt;td&gt;5.7&lt;/td&gt;
&lt;td&gt;2&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Aider time includes edits, tests, and retries. Flash-Next passed all five shared exercises. Qwen passed four in about four minutes. One run on five exercises leaves the broader quality question open. &lt;a href="https://aider.chat/docs/leaderboards/" rel="noopener noreferrer"&gt;Aider’s full leaderboard and scope&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What failed and what’s still open
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;I couldn’t turn the rented Mac into a 96 GB or 128 GB machine.&lt;/strong&gt; The next test is the same four Flash-Next sessions on a 128 GB Max. I’d record the wait, memory pressure, and swap to see whether I need 256 GB for that workload.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;My first code check gave me a bad signal.&lt;/strong&gt; Every result in the first macOS smoke test came back as a timeout because the grading workers hit an error while setting a resource limit. I corrected the macOS setup and checked its results against both Linux regrades. &lt;a href="https://github.com/kgluszczyk/mac-studio-local-agent-bench/releases/download/linux-replay-v1/independent-verdicts.csv" rel="noopener noreferrer"&gt;Per-task verdicts from all three runs&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The tests didn’t settle which model writes better code.&lt;/strong&gt; The highest and lowest HumanEval+ scores differed by one exercise. Flash-Next finished only five Aider exercises before I stopped its run. I can say how the models did on those same five and how long they took. Their scores leave the broader quality question open.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  How this fits with other tests
&lt;/h2&gt;

&lt;p&gt;The 96 GB Ultra versus 128 GB Max trade-off has been covered before. Oddbyte’s buying guide compares memory capacity and bandwidth and discusses early reviews. Fireside Labs measured cold and cached turns on a 256 GB Ultra and ran multi-hour coding sessions with hidden tests. Their write-up also includes request replays across inference engines. &lt;a href="https://oddbyte.us/2026/09/m5-ultra-96gb-vs-m5-max-128gb-local-llm-guide/" rel="noopener noreferrer"&gt;Oddbyte buying guide&lt;/a&gt; · &lt;a href="https://github.com/fireside-labs/m5-ultra-llm-benchmarks" rel="noopener noreferrer"&gt;Fireside Labs benchmarks&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The result that changed my shortlist was the split between getting a long session started and getting working code. Flint’s first short reply at about 128k finished in 30 seconds, against 119 for Qwen. After a few turns both were around two seconds. On the Python edits, Qwen got to working code sooner. Four simultaneous cold prompts made waiting time part of the purchase decision even on the 256 GB machine.&lt;/p&gt;

&lt;h2&gt;
  
  
  Reproduce the numbers
&lt;/h2&gt;

&lt;p&gt;The public snapshot contains the prompt generators, server flags, full model digests, raw timing and memory records, saved HumanEval+ answers and both sets of grading decisions. Run &lt;code&gt;python verify_snapshot.py&lt;/code&gt; from that snapshot to recalculate the Aider summary and check the verdicts and the four-request Flash-Next result. The cold tests requested 132,572 context tokens per slot. The server rounded that to 132,608 in both the one- and four-slot runs. The verification command checks saved records. For a fresh measurement, start the same model weights and serving engine and follow the command for the test you want to repeat. To check the saved answers independently, use EvalPlus 0.3.1 with the corresponding &lt;code&gt;humaneval/samples_*.jsonl&lt;/code&gt; in an isolated Linux environment. &lt;a href="https://github.com/kgluszczyk/mac-studio-local-agent-bench/blob/ac14a7efdadf1bf39382349403ea3769e6ac510f/README.md#repeating-the-runs" rel="noopener noreferrer"&gt;Runbook for new measurements and grading&lt;/a&gt; · &lt;a href="https://github.com/kgluszczyk/mac-studio-local-agent-bench/tree/ac14a7efdadf1bf39382349403ea3769e6ac510f" rel="noopener noreferrer"&gt;Pinned evidence snapshot&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;For the timing check I removed &lt;code&gt;HumanEval/10–39&lt;/code&gt; and &lt;code&gt;HumanEval/132–149&lt;/code&gt; from all three setups. Those IDs covered two windows when the VM setup might have affected timing. Aider ran in Linux through Lima while the models ran on macOS. I used &lt;code&gt;flint:40b-a2b-qat-int4&lt;/code&gt;, &lt;code&gt;qwen3.8:27b-mlx&lt;/code&gt;, and Unsloth revision &lt;code&gt;f5d175d&lt;/code&gt; for Flash-Next. &lt;a href="https://github.com/kgluszczyk/mac-studio-local-agent-bench/blob/ac14a7efdadf1bf39382349403ea3769e6ac510f/model-artifacts.txt" rel="noopener noreferrer"&gt;Model identifiers&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Measurement details
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Memory and concurrent requests.&lt;/strong&gt; The llama.cpp logs confirm one slot for one request and four slots for four requests. Each slot had room for 132,608 tokens. Each prompt was about 131k tokens. I sampled memory roughly once a second. The Ollama column uses the largest size reported by the server in decimal GB. The RSS column uses resident memory from the macOS process list in GiB. The saved logs omit Metal buffer totals. On the target Mac I’d record those totals and check the recommended GPU working-set size, loading errors, and swap. &lt;a href="https://developer.apple.com/documentation/metal/mtldevice/recommendedmaxworkingsetsize" rel="noopener noreferrer"&gt;Apple’s Metal working-set documentation&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Short replies.&lt;/strong&gt; I loaded the models before timing them. Ollama got a repeated job-scheduler description and a short follow-up question about failed jobs. Each new turn kept up to 400 characters from the previous reply. The three-turn Flash-Next run used a job log that grew by 38 lines per follow-up. I limited Ollama to 100 output tokens and Flash-Next to 150. The table records elapsed time through the end of each reply. It has no per-turn token counts, first-token times, or correctness scores.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;HumanEval+ timing.&lt;/strong&gt; Generation time excludes grading and warm-up. To check the effect of the VM setup, I set aside the same exercises for all three models. Across the remaining 116 exercises, Flint passed 110 in 17.2 minutes, Qwen passed 108 in 11.5, and Flash-Next passed 110 in 37.2. That’s 383.3, 563.5, and 177.5 passes per generation hour, respectively. Flint emitted 163,966 tokens, Qwen 103,069, and Flash-Next 121,631. Their rates were about 159, 149, and 55 output tokens per second of request time, including prompt processing. On the 102 shared passes, Qwen was quicker than Flint on 60 and quicker than Flash-Next on 96. &lt;a href="https://github.com/kgluszczyk/mac-studio-local-agent-bench/releases/tag/linux-replay-v1" rel="noopener noreferrer"&gt;Detailed timing tables&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Aider timing and cutoffs.&lt;/strong&gt; Across all 12 exercises, Qwen passed 78.4 per elapsed hour and Flint passed 7.8. The full Flash-Next run clock includes the interrupted sixth exercise. Its matched time uses the five completed exercises. The token totals include extra API calls and cut-off replies. The API logs don’t have exercise IDs for calculating matched token totals. Two Flint replies hit the cap after an initial failed edit. Two Flash-Next first attempts hit the cap and passed on retry. Each server used its default chat template and reasoning settings. &lt;a href="https://github.com/kgluszczyk/mac-studio-local-agent-bench/releases/tag/aider-audit-v1" rel="noopener noreferrer"&gt;Per-case audit excerpts&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What I’d try next
&lt;/h2&gt;

&lt;p&gt;In my DIY Jev benchmark, I tested a model on a narrow job. It had to pick from a defined set of answers. I’d keep the local helper experiment just as specific and give it one small edit at a time. &lt;a href="https://dev.to/kgluszczyk/a-diy-jev-typed-decisions-from-gpt-6-luna-logprobs-benchmarked-head-to-head-1fd8"&gt;The DIY Jev benchmark&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I’d start with Qwen MLX for small edits on a repository I work in regularly. I’d time the same edit once with the main agent doing the work and once with a local helper doing it. I’d record the time until the edit is ready to merge, including retries and checks. I’d also track how much of that time needs my attention.&lt;/p&gt;

&lt;p&gt;For the workstation decision, I’d have several agents run their normal builds and tests. I’d compare a session with everything on the main machine against one with the jobs on the second host. I’d give parallel jobs separate working copies, app instances, and ports. I’d measure the time from sending the changes to getting the result back. I’d also compare memory pressure and whether the main machine stays responsive. I’d check whether my renderer and the other models I want to use support GPU acceleration on macOS. Then I’d time a real render and a run of one of those models. If those jobs need to overlap in practice, I’d test them together as well as separately. The rental in this article measured LLM workloads. The render and other models would need their own timings.&lt;/p&gt;

</description>
      <category>llm</category>
      <category>benchmark</category>
      <category>macos</category>
      <category>ai</category>
    </item>
    <item>
      <title>A DIY Jev: typed decisions from gpt-6-luna logprobs, benchmarked head-to-head</title>
      <dc:creator>Krzysztof Głuszczyk</dc:creator>
      <pubDate>Mon, 28 Sep 2026 15:42:39 +0000</pubDate>
      <link>https://dev.to/kgluszczyk/a-diy-jev-typed-decisions-from-gpt-6-luna-logprobs-benchmarked-head-to-head-1fd8</link>
      <guid>https://dev.to/kgluszczyk/a-diy-jev-typed-decisions-from-gpt-6-luna-logprobs-benchmarked-head-to-head-1fd8</guid>
      <description>&lt;p&gt;What if an ordinary LLM could return this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nl"&gt;"sales"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mf"&gt;0.89&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"billing"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mf"&gt;0.07&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"support"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mf"&gt;0.04&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;...not by asking the model to write JSON numbers, but by turning its token logprobs into a typed, calibrated probability distribution?&lt;/p&gt;

&lt;p&gt;That is roughly the promise of TypeSafe's Jev: purpose-built models returning probabilistic decisions instead of free-form text. We wanted to see how much of that experience we could reproduce using &lt;code&gt;gpt-6-luna&lt;/code&gt;, already available in our stack, before evaluating dedicated commercial endpoints.&lt;/p&gt;

&lt;p&gt;So we built the smallest prototype that could work: restrict the output to single-token keys, read their logprobs, normalize them, and fit a single temperature parameter on labelled examples.&lt;/p&gt;

&lt;p&gt;Then we tested it head-to-head against Jev across 6,762 public examples (13 datasets).&lt;/p&gt;

&lt;p&gt;The result was more nuanced than expected. Our DIY classifier nearly matched Jev on most category tasks (even with 219 classes), while Jev held a consistent lead of 3.6 to 6.1 points on yes/no questions and rating scales. It was cheaper for short inputs, roughly 4-5x slower, and heavily overconfident until calibrated.&lt;/p&gt;

&lt;h3&gt;
  
  
  Why not just ask the model for JSON?
&lt;/h3&gt;

&lt;p&gt;The obvious alternative is prompting the model to output a JSON dictionary with confidence scores. We benchmarked that as a third approach on &lt;code&gt;gpt-6-luna&lt;/code&gt; across the same evaluation suite:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Approach&lt;/th&gt;
&lt;th&gt;Average accuracy&lt;/th&gt;
&lt;th&gt;Latency (mean)&lt;/th&gt;
&lt;th&gt;Billed output tokens&lt;/th&gt;
&lt;th&gt;Calibration error (ECE ↓)&lt;/th&gt;
&lt;th&gt;Practical role&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Prompted JSON&lt;/td&gt;
&lt;td&gt;70.1%&lt;/td&gt;
&lt;td&gt;10.06s&lt;/td&gt;
&lt;td&gt;~960&lt;/td&gt;
&lt;td&gt;0.175&lt;/td&gt;
&lt;td&gt;Slow, high-token prototype&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;DIY logprob adapter&lt;/td&gt;
&lt;td&gt;73.8%&lt;/td&gt;
&lt;td&gt;2.11s&lt;/td&gt;
&lt;td&gt;1 (answer token)&lt;/td&gt;
&lt;td&gt;0.211 raw (≤0.10 calibrated)&lt;/td&gt;
&lt;td&gt;No training, fast to ship&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Dedicated model (Jev)&lt;/td&gt;
&lt;td&gt;76.5%&lt;/td&gt;
&lt;td&gt;0.38s&lt;/td&gt;
&lt;td&gt;0 (free output)&lt;/td&gt;
&lt;td&gt;0.110&lt;/td&gt;
&lt;td&gt;Dedicated specialized model&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;/p&gt;
  What is calibration error (ECE)?
  &lt;br&gt;
Expected Calibration Error (ECE) measures how honest the model is about its confidence numbers. If a model says it is 90% sure across many predictions, it should be right about 9 out of 10 times.

&lt;p&gt;Raw language models are notoriously overconfident (claiming 99%+ certainty even when guessing wrong). Lower ECE means the probabilities reflect actual accuracy better (0.0 means perfect calibration).&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;Across the entire benchmark, prompted JSON was 4.8 times slower than the logprob adapter and 26.5 times slower than Jev. It generated ~6.5 million output tokens across the benchmark. The DIY adapter generated under 15,000 (even with tournament calls).&lt;/p&gt;

&lt;p&gt;JSON was not consistently inaccurate. It reached the highest accuracy on five datasets and tied Jev on Banking77 (80.6%). The failure was variance. It collapsed on two large label tasks:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Dataset&lt;/th&gt;
&lt;th&gt;Classes&lt;/th&gt;
&lt;th&gt;Jev&lt;/th&gt;
&lt;th&gt;DIY&lt;/th&gt;
&lt;th&gt;JSON&lt;/th&gt;
&lt;th&gt;JSON latency&lt;/th&gt;
&lt;th&gt;JSON tokens&lt;/th&gt;
&lt;th&gt;JSON ECE&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;TREC-50&lt;/td&gt;
&lt;td&gt;50&lt;/td&gt;
&lt;td&gt;83.2%&lt;/td&gt;
&lt;td&gt;82.4%&lt;/td&gt;
&lt;td&gt;38.4%&lt;/td&gt;
&lt;td&gt;11.4s&lt;/td&gt;
&lt;td&gt;986&lt;/td&gt;
&lt;td&gt;0.574&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;DBpedia219&lt;/td&gt;
&lt;td&gt;219&lt;/td&gt;
&lt;td&gt;93.2%&lt;/td&gt;
&lt;td&gt;90.7%&lt;/td&gt;
&lt;td&gt;55.3%&lt;/td&gt;
&lt;td&gt;52.6s&lt;/td&gt;
&lt;td&gt;5,751&lt;/td&gt;
&lt;td&gt;0.427&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;
&lt;h3&gt;
  
  
  Why not just put 77 or 219 classes in one prompt if you have a large context window?
&lt;/h3&gt;

&lt;p&gt;A large context window solves the input problem, but not the decoding or latency problem:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;For JSON (generation bottleneck):&lt;/strong&gt; Fitting 77 or 219 label descriptions into the prompt is easy. But asking the model to &lt;em&gt;generate&lt;/em&gt; a JSON dictionary of confidence scores for 219 classes burns ~5,750 output tokens and took &lt;strong&gt;52.6 seconds per item&lt;/strong&gt;. In addition, when generating float numbers in text, models produce uncalibrated scores that distort ranking.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;For logprobs (candidate reporting limit):&lt;/strong&gt; With logprobs, the model scores options in a single decoding step. However, OpenAI and most compatible APIs return candidate probabilities for at most 20 tokens per position (&lt;code&gt;top_logprobs=20&lt;/code&gt;). Options beyond the top 20 read as zero. &lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;You &lt;em&gt;can&lt;/em&gt; put all 77 or 219 labels in a single logprob prompt (we tested that too), and it performed surprisingly well (within 0.3 points overall). But chunking into groups of up to 19 gave more consistent accuracy across our full benchmark suite (particularly on TREC fine).&lt;/p&gt;

&lt;p&gt;Prompted JSON is fine for a quick one-off prototype. For a reliable decision endpoint, the 1-token logprob adapter is faster, cheaper, and far more stable across label sizes.&lt;/p&gt;

&lt;p&gt;Here is how the trick works, where it breaks, and what to watch out for if you build your own.&lt;/p&gt;
&lt;h2&gt;
  
  
  How it works
&lt;/h2&gt;
&lt;h3&gt;
  
  
  Classification without fine-tuning
&lt;/h3&gt;

&lt;p&gt;Think of it as a text classifier you don't have to train. The traditional way to sort text into categories is to train or fine-tune an encoder like BERT or ModernBERT on thousands of labelled examples (recent open-source projects like &lt;a href="https://github.com/NandhaKishorM/laya" rel="noopener noreferrer"&gt;Laya&lt;/a&gt; explore this non-autoregressive encoder route). That works well when label sets are fixed and small, but requires task-specific training pipelines.&lt;/p&gt;

&lt;p&gt;Here, the general-purpose language model's own next-token probabilities do that classification job zero-shot. There is nothing to train, and the label set can change dynamically on every request. What you give up out of the box is calibrated confidence: raw LLM probabilities run high, so claiming "99.9% certainty" on an ambiguous edge case is common. The "Confidence" section below shows how to fix it with a simple temperature scaling parameter.&lt;/p&gt;

&lt;p&gt;The prototype wraps this in one endpoint that takes several questions about the same text, following TypeSafe's Primitives spec: &lt;code&gt;choice&lt;/code&gt; (pick a label), &lt;code&gt;score&lt;/code&gt; (pick a level on an ordered scale) and &lt;code&gt;noul&lt;/code&gt; (yes/no). For all three question types, the endpoint returns both the winning answer and a calibrated confidence score (along with the full probability distribution). Each answer also reports &lt;code&gt;coverage&lt;/code&gt;, the share of probability that landed on your options at all. Low coverage means the model wanted to say something else, so don't trust that answer.&lt;/p&gt;
&lt;h3&gt;
  
  
  The 1-token logprob trick
&lt;/h3&gt;

&lt;p&gt;A language model writes one token (a word or a piece of one) at a time. At each step it gives every token in its vocabulary a probability, then picks one. Many APIs can also return the top candidates it was choosing between, each with its probability, as a logarithm ("logprob").&lt;/p&gt;

&lt;p&gt;That is all we need. List the options with a short key each (0, 1, 2...), ask the model to answer with just the key, and read the probabilities the API returns for those keys. Keep the candidates that are keys, turn the logprobs back into probabilities, rescale them to add up to 1, and you have a probability for every option.&lt;/p&gt;

&lt;p&gt;The API returns at most 20 candidates per token, and many of them are junk: "A", "**", an end-of-text marker, or the same key twice (" B" and "b"). So the least likely options often don't make the list and read as zero. That costs almost nothing: anything left off ranks below the last candidate shown, typically with negligible individual probability. We stop at 19 options per call (details below).&lt;/p&gt;
&lt;h3&gt;
  
  
  Fully deterministic by design
&lt;/h3&gt;

&lt;p&gt;When you ask a model to write text or output JSON confidence numbers, multi-step autoregressive generation introduces sampling variance. Even with &lt;code&gt;temperature=0&lt;/code&gt;, floating-point rounding across GPU thread batches can cause subtle token drift, making multi-token JSON generation flaky in automated pipelines.&lt;/p&gt;

&lt;p&gt;Both Jev and the 1-token logprob adapter evaluate decisions in a single forward pass. Because we read raw logprobs at the very first token directly from vocabulary logits without running an autoregressive decoding loop, the output probability distribution is 100% deterministic and reproducible across runs.&lt;/p&gt;

&lt;p&gt;Three steps, in Python. The full example runs against any OpenAI-compatible endpoint that serves &lt;code&gt;gpt-6-luna&lt;/code&gt; on the Responses API, and the outputs shown are from a live call.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Build the prompt.&lt;/strong&gt; Each option gets a one-token key: digits up to 10 options, letters past that. Why the answer looks like this comes right after the code.&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;json&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;math&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;openai&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;OpenAI&lt;/span&gt;

&lt;span class="n"&gt;client&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;OpenAI&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;  &lt;span class="c1"&gt;# any OpenAI-compatible endpoint; pass base_url=... for a gateway
&lt;/span&gt;
&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;build_prompt&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;text&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;question&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;options&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="sh"&gt;"""&lt;/span&gt;&lt;span class="s"&gt;options: {label: description}. Returns the answer keys and the prompt.&lt;/span&gt;&lt;span class="sh"&gt;"""&lt;/span&gt;
    &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;len&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;options&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="c1"&gt;# Keys are 0-9 up to 10 options. Past that, "1" would also be the start of
&lt;/span&gt;    &lt;span class="c1"&gt;# "10".."18", so use letters, skipping "a" and "i" (they are also English words).
&lt;/span&gt;    &lt;span class="n"&gt;keys&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nf"&gt;str&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="nf"&gt;range&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;)]&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="nf"&gt;list&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;bcdefghjklmnopqrstu&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)[:&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
    &lt;span class="n"&gt;listing&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;join&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;upper&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt;: &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;label&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt; - &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;desc&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;
                        &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;label&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;desc&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="nf"&gt;zip&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;keys&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;options&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;items&lt;/span&gt;&lt;span class="p"&gt;()))&lt;/span&gt;
    &lt;span class="n"&gt;word&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;number&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;letter&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;
    &lt;span class="n"&gt;prompt&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;State: &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;json&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;dumps&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;text&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="si"&gt;:&lt;/span&gt; &lt;span class="n"&gt;text&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;ensure_ascii&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="bp"&gt;False&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="se"&gt;\n\n&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;
              &lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Question: &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;question&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="se"&gt;\n\n&lt;/span&gt;&lt;span class="s"&gt;Options:&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;listing&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="se"&gt;\n\n&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;
              &lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Answer with only the &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;word&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt; of the best option. No other text.&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;keys&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;prompt&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;&lt;strong&gt;2. Ask for one short answer, with its candidates.&lt;/strong&gt; &lt;code&gt;top_p=1.0&lt;/code&gt; matters: with the default, the API leaves out the options the model considered unlikely, and they come back as exactly zero.&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;ask&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;prompt&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="n"&gt;resp&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;client&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;responses&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;create&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
        &lt;span class="n"&gt;model&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;gpt-6-luna&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="nb"&gt;input&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;prompt&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="n"&gt;reasoning&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;effort&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;none&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;
        &lt;span class="n"&gt;max_output_tokens&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;64&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;   &lt;span class="c1"&gt;# reasoning and output share this budget
&lt;/span&gt;        &lt;span class="n"&gt;top_logprobs&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;20&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;        &lt;span class="c1"&gt;# the most candidates the API returns per token
&lt;/span&gt;        &lt;span class="n"&gt;top_p&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mf"&gt;1.0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;              &lt;span class="c1"&gt;# the default 0.98 hides the runner-up options
&lt;/span&gt;        &lt;span class="n"&gt;include&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;message.output_text.logprobs&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
        &lt;span class="n"&gt;store&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="bp"&gt;False&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;msg&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;next&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;o&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;o&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;resp&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;output&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;o&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nb"&gt;type&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;message&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;msg&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;content&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="n"&gt;logprobs&lt;/span&gt;  &lt;span class="c1"&gt;# one entry per output token, with its top candidates
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;&lt;strong&gt;3. Turn the candidates into probabilities.&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;to_probs&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;tokens&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;keys&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;labels&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;calibration_t&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mf"&gt;1.0&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="n"&gt;norm&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;lambda&lt;/span&gt; &lt;span class="n"&gt;t&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;t&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;strip&lt;/span&gt;&lt;span class="p"&gt;().&lt;/span&gt;&lt;span class="nf"&gt;strip&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;.,;:!?&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="se"&gt;\"&lt;/span&gt;&lt;span class="s"&gt;`*&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;lower&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
    &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;pos&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;tokens&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;  &lt;span class="c1"&gt;# the first output token that is an answer key
&lt;/span&gt;        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="nf"&gt;norm&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;pos&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;token&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;keys&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
            &lt;span class="n"&gt;mass&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{}&lt;/span&gt;
            &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;alt&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;pos&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;top_logprobs&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
                &lt;span class="n"&gt;k&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;norm&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;alt&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;token&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
                &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;keys&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
                    &lt;span class="n"&gt;mass&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;mass&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;0.0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;math&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;exp&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;alt&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;logprob&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;  &lt;span class="c1"&gt;# logprob -&amp;gt; probability
&lt;/span&gt;            &lt;span class="n"&gt;mass&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;v&lt;/span&gt; &lt;span class="o"&gt;**&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="n"&gt;calibration_t&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;v&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;mass&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;items&lt;/span&gt;&lt;span class="p"&gt;()}&lt;/span&gt;  &lt;span class="c1"&gt;# see "Confidence"
&lt;/span&gt;            &lt;span class="n"&gt;total&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;sum&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;mass&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;values&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt;
            &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;l&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;mass&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;0.0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="n"&gt;total&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;l&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="nf"&gt;zip&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;keys&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;labels&lt;/span&gt;&lt;span class="p"&gt;)}&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="bp"&gt;None&lt;/span&gt;  &lt;span class="c1"&gt;# no answer key anywhere: the model replied off-format
&lt;/span&gt;
&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;classify&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;text&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;question&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;options&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;calibration_t&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mf"&gt;1.0&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="n"&gt;keys&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;prompt&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;build_prompt&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;text&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;question&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;options&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nf"&gt;to_probs&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;ask&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;prompt&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;keys&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nf"&gt;list&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;options&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;calibration_t&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="n"&gt;opts&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;sales&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;New subscriptions, upgrades, enterprise plans&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;billing&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Invoices, payment methods, receipts&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;support&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Technical help, bugs, troubleshooting&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;classify&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;We want to upgrade our workspace to the annual enterprise plan.&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Which team should handle this?&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;opts&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;span class="c1"&gt;# {'sales': 0.9999999999862318, 'billing': 6.755284692114235e-12, 'support': 7.0129827926438374e-12}
&lt;/span&gt;&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;classify&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;We want to upgrade our workspace to the annual enterprise plan.&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Which team should handle this?&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;opts&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
               &lt;span class="n"&gt;calibration_t&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;6&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;span class="c1"&gt;# {'sales': 0.9731562277998806, 'billing': 0.013380012188266373, 'support': 0.013463760011852986}
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h3&gt;
  
  
  Why the answer is a single key
&lt;/h3&gt;

&lt;p&gt;The API gives probabilities for single tokens, and it only shows candidates along the path the model actually took. So each option has to be exactly one token, and no option can look like the start of another. Label names often fail that test: "customer support" and "customer sales" both start with "customer", so the first step can't tell them apart. A one-token key per option puts every option side by side in a single step.&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;
  More on the answer format, and how often it failed
  &lt;p&gt;&lt;strong&gt;Digits up to 10, letters past that.&lt;/strong&gt; "0" to "9" are single tokens. Two-digit numbers usually are too: in a live check with 12 options the model answered "11" as one token, with "1" far behind. But a "1" can also be the start of a longer answer, and in 1 of 54 early test cases the probability did land on option 1 when the right answer was 11 or above. Letters never overlap like that.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why 19?&lt;/strong&gt; We first reserved one of the 20 slots for junk. Measured later on 100 Banking77 questions with 19 options, that reasoning doesn't hold: junk took a median of 9 slots and duplicate keys 2 more, and some lists came back shorter than 20, so a median of 10 options were missing from the list; 20 options looked the same. No number of options fits on the list every time; what matters is that only negligible options fall off. 19 is simply where our clean one-letter keys run out. Larger single calls are covered under "More than 19 labels".&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Letters start at B and skip I&lt;/strong&gt;, because "A" and "I" also open ordinary sentences. If the model ignores the format and replies "I think...", we want no valid key in the reply, so the question comes back as "no answer" instead of a confident vote for option I. B to U without I gives exactly 19.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why not force a one-token reply?&lt;/strong&gt; The API rejects &lt;code&gt;max_output_tokens&lt;/code&gt; below 16, reasoning shares that budget, and the model often adds a full stop anyway. So we take the first output token that is a key, and return "no answer" if there is none.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why not structured outputs or &lt;code&gt;logit_bias&lt;/code&gt;?&lt;/strong&gt; We tried both, hoping to limit the candidates to our keys. Neither did. With a JSON schema and an &lt;code&gt;enum&lt;/code&gt;, the candidate list was still the model's raw top 20, junk included, and through our setup the schema wasn't even enforced when the prompt asked for a bare letter (3 of 3 calls came back as plain "D"). &lt;code&gt;logit_bias&lt;/code&gt; was accepted but had no visible effect, even at the maximum.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How often it went wrong.&lt;/strong&gt; In the 13-set benchmark, 3 of 6,762 questions (all on Yelp) came back with no valid key and counted as wrong. What we can't count is a prose reply that happens to start with a valid key, which is why A and I are left out. They are real risks: "A" showed up among the candidates in 97 of 100 test questions and "I" in 42, as junk.&lt;/p&gt;



&lt;p&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  How it compares with Jev
&lt;/h2&gt;

&lt;p&gt;We ran both on 13 public datasets, 6,762 cases: seven classification sets with 4 to 219 labels, two yes/no sets and four rating scales. Every case went to both with the same question and label descriptions. We call a gap real only when a statistical test says it is unlikely to be luck. Jev was called through Cloudflare Workers AI on 2026-09-26.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fof11aprtwicz1stfsfxb.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fof11aprtwicz1stfsfxb.png" alt="accuracy of DIY and Jev on 13 datasets grouped as classify, yes/no and score, with the difference per row. Classification rows are within about a point except DBpedia at -2.4; yes/no and score rows are 3.6 to 6.1 points behind Jev." width="800" height="640"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  Picking a category: about even
&lt;/h3&gt;

&lt;p&gt;Within 1.6 percentage points on six category datasets (including CLINC150 with 150 intents). The one noticeable gap was DBpedia with 219 categories, where Jev led by 2.4 points. Jev is slightly ahead on most sets, just not by enough to tell apart from noise.&lt;/p&gt;
&lt;h3&gt;
  
  
  Yes/no and ratings: Jev ahead by 3.6 to 6.1 points
&lt;/h3&gt;

&lt;p&gt;Jev leads by 3.6 points on BoolQ and 4.0 on RTE. Both gaps are real.&lt;/p&gt;
&lt;h3&gt;
  
  
  Rating scales: Jev ahead, mostly by one step
&lt;/h3&gt;

&lt;p&gt;Jev leads by 4.6 to 6.1 points on exact hits. Most of our misses are one level off: counting "within one level" as right, the two are close (97.8% for both on SST-5, 96.2% vs 98.2% on Yelp, among the cases both answered).&lt;/p&gt;

&lt;p&gt;Scales are also where ours goes further. Jev takes up to 10 levels, ours up to 19. On 342 wine reviews split into 2 to 19 score bands, ours sits a few points under Jev up to 10 levels. At 19 levels it is off by 1.8 rating points on average, a little better than at 10 levels (2.1; Jev at 10: 2.0).&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fb8nhy539q031cpim2yml.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fb8nhy539q031cpim2yml.png" alt="line chart of exact and within-one-level accuracy against 2, 4, 8, 10 and 19 score levels on 342 wine reviews. Both engines fall from 90% exact at 2 levels to about 30% at 10, with Jev a few points ahead; only DIY continues to 19 levels, at 19% exact and 49% within one level." width="800" height="480"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Across all 13 sets ours trails by 2.7 points on average. It also naturally inherits the large context window of the underlying general-purpose model, accepting inputs well beyond short classifications. We did not compare long inputs against Jev.&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;
  Full results, statistics and caveats
  &lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Test (labels, cases)&lt;/th&gt;
&lt;th&gt;DIY&lt;/th&gt;
&lt;th&gt;Jev&lt;/th&gt;
&lt;th&gt;Difference, 95% CI&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;AG News (4, 500)&lt;/td&gt;
&lt;td&gt;83.8%&lt;/td&gt;
&lt;td&gt;85.4%&lt;/td&gt;
&lt;td&gt;−1.6 [−3.4, 0.0]&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Emotion (6, 566)&lt;/td&gt;
&lt;td&gt;51.8%&lt;/td&gt;
&lt;td&gt;50.2%&lt;/td&gt;
&lt;td&gt;+1.6 [−1.1, +4.2]&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;TREC question type (6, 500)&lt;/td&gt;
&lt;td&gt;90.6%&lt;/td&gt;
&lt;td&gt;91.6%&lt;/td&gt;
&lt;td&gt;−1.0 [−2.8, +0.6]&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;TREC fine (42, 500)&lt;/td&gt;
&lt;td&gt;82.4%&lt;/td&gt;
&lt;td&gt;83.2%&lt;/td&gt;
&lt;td&gt;−0.8 [−3.6, +2.0]&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Banking77 (77, 770)&lt;/td&gt;
&lt;td&gt;79.2%&lt;/td&gt;
&lt;td&gt;80.6%&lt;/td&gt;
&lt;td&gt;−1.4 [−3.4, +0.5]&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;CLINC150 (150, 750)&lt;/td&gt;
&lt;td&gt;91.7%&lt;/td&gt;
&lt;td&gt;91.5%&lt;/td&gt;
&lt;td&gt;+0.3 [−1.6, +2.1]&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;DBpedia (219, 657)&lt;/td&gt;
&lt;td&gt;90.7%&lt;/td&gt;
&lt;td&gt;93.2%&lt;/td&gt;
&lt;td&gt;−2.4 [−4.0, −0.9]&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;BoolQ (yes/no, 500)&lt;/td&gt;
&lt;td&gt;89.2%&lt;/td&gt;
&lt;td&gt;92.8%&lt;/td&gt;
&lt;td&gt;−3.6 [−5.8, −1.6]&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;RTE (yes/no, 277)&lt;/td&gt;
&lt;td&gt;87.7%&lt;/td&gt;
&lt;td&gt;91.7%&lt;/td&gt;
&lt;td&gt;−4.0 [−7.6, −0.4]&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;SST-5 sentiment (5, 500)&lt;/td&gt;
&lt;td&gt;53.4%&lt;/td&gt;
&lt;td&gt;58.0%&lt;/td&gt;
&lt;td&gt;−4.6 [−8.2, −1.0]&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Yelp stars (5, 500)&lt;/td&gt;
&lt;td&gt;62.8%&lt;/td&gt;
&lt;td&gt;68.8%&lt;/td&gt;
&lt;td&gt;−6.0 [−9.8, −2.2]&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;IMDB rating (4, 400)&lt;/td&gt;
&lt;td&gt;67.8%&lt;/td&gt;
&lt;td&gt;72.8%&lt;/td&gt;
&lt;td&gt;−5.0 [−8.8, −1.0]&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Wine score (10, 342)&lt;/td&gt;
&lt;td&gt;28.1%&lt;/td&gt;
&lt;td&gt;34.2%&lt;/td&gt;
&lt;td&gt;−6.1 [−12.9, +0.9]&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;How we tested.&lt;/strong&gt; Equal numbers of cases per label, so these are benchmark accuracies, not what you'd see on real traffic. The interval next to each difference is a 95% paired bootstrap: we resample the same cases many times, and a gap counts as real when the interval excludes zero. By that test, six of the 13 gaps are real, all in Jev's favour. Testing 13 datasets at once raises the odds that one looks real by luck, so we also applied a stricter bar (McNemar's test with a Holm correction); three gaps pass it: BoolQ, Yelp and DBpedia.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The 2.7-point average.&lt;/strong&gt; 95% CI 1.7 to 3.6, bootstrapping cases within each dataset as planned; 1.2 to 4.1 if you treat each dataset as a sample from a wider pool of tasks.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Failed answers count as wrong.&lt;/strong&gt; Refused or invalid answers (less than 1% across the entire benchmark, mostly safety filter triggers on film reviews) were counted as misses. Counting those as misses, Jev keeps a 2-3 point lead on Yelp and IMDB even on "within one level". Jev answered everything.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What these numbers can't tell you:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;All 13 are well-known public benchmarks, so both models have probably seen them in training; Banking77 and CLINC150 are standard intent-training sets. Your own data is the real test.&lt;/li&gt;
&lt;li&gt;Six of the sets (AG News, BoolQ, SST-5, IMDB, Banking77, wine) were also used, on other samples, while we tuned the letters, the chunking, &lt;code&gt;top_p&lt;/code&gt; and calibration. The seven sets we hadn't touched show the same pattern.&lt;/li&gt;
&lt;li&gt;One run per engine per set. Five sets got a second DIY run by other means; none moved by more than 0.6 points. The wine re-run gave 28.7% vs 33.9% at 10 levels, against 28.1% vs 34.2% in the table.&lt;/li&gt;
&lt;li&gt;Jev ran through Cloudflare, not TypeSafe directly, and we can't verify it's the same build.&lt;/li&gt;
&lt;li&gt;The long-text test hid a code in filler text, 6 trials per size.&lt;/li&gt;
&lt;/ul&gt;



&lt;br&gt;
&lt;p&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  More than 19 labels
&lt;/h2&gt;

&lt;p&gt;One call holds 19 options. Past that, what worked was splitting the labels into groups of up to 19, asking about every group in parallel, then asking once more among the group winners:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;concurrent.futures&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;ThreadPoolExecutor&lt;/span&gt;

&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;classify_many&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;text&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;question&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;options&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="sh"&gt;"""&lt;/span&gt;&lt;span class="s"&gt;Past 19 labels: chunks of up to 19 in parallel, then a final round among the winners.&lt;/span&gt;&lt;span class="sh"&gt;"""&lt;/span&gt;
    &lt;span class="n"&gt;labels&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;list&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;options&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="nf"&gt;len&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;labels&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="mi"&gt;19&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nf"&gt;classify&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;text&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;question&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;options&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nf"&gt;len&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;labels&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;//&lt;/span&gt; &lt;span class="mi"&gt;19&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;chunks&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[{&lt;/span&gt;&lt;span class="n"&gt;l&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;options&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;l&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;l&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;labels&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;::&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;]}&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="nf"&gt;range&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;)]&lt;/span&gt;
    &lt;span class="k"&gt;with&lt;/span&gt; &lt;span class="nc"&gt;ThreadPoolExecutor&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;pool&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="n"&gt;results&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;list&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;pool&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;map&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;lambda&lt;/span&gt; &lt;span class="n"&gt;c&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nf"&gt;classify&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;text&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;question&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;c&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;chunks&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
    &lt;span class="n"&gt;winners&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nf"&gt;max&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;d&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;key&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;d&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;get&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;d&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;results&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;d&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;  &lt;span class="c1"&gt;# a refused chunk drops out here
&lt;/span&gt;    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="ow"&gt;not&lt;/span&gt; &lt;span class="n"&gt;winners&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="bp"&gt;None&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nf"&gt;classify_many&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;text&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;question&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;w&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;options&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;w&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;w&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;winners&lt;/span&gt;&lt;span class="p"&gt;})&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That is how the 42- to 219-label rows were produced: 4 calls for 42 labels, 9 for 150, 13 for 219, in 3 to 4 seconds.&lt;/p&gt;

&lt;p&gt;Since options that don't make the candidate list barely matter, we also tried alternatives: all labels in one call (keyed by 3-digit codes, each a single token), bigger chunks of up to about 40, and chunks of 19 that keep similar labels together. Each ran twice on the same four datasets, against a same-day rerun of the baseline setup. None matched it. The single call came closest: 3 to 4 times faster, 30 to 55% cheaper, and even on Banking77, CLINC150 and DBpedia, but 4 points lower on TREC fine, where it confused the broad category (a place for a number, say) twice as often. Bigger chunks and grouped chunks lost on TREC fine too, and a little overall. So chunks of 19, with labels spread across them, remain the baseline.&lt;/p&gt;

&lt;p&gt;To see what the number of labels does on its own, we took random subsets of CLINC150's intents, from 5 to 150, with the same cases for both. Both stay near 100% up to 20 labels. At 40 and 80 ours trails by 3.4 and 2.5 points, inside the noise, and at 150 they tie.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fvv78hdcqkv2nu5t3wdbf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fvv78hdcqkv2nu5t3wdbf.png" alt="accuracy of DIY and Jev on random subsets of 5, 10, 20, 40, 80 and 150 CLINC150 intents. Both are near 100% up to 20 classes; at 40 and 80 DIY is 3.4 and 2.5 points behind, within the 95% bands; at 150 both are 91.7%." width="800" height="496"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The obvious alternative, walking a category tree (pick the group first, then the label inside it), was clearly worse: 4 to 29 points behind Jev.&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;
  The alternatives in numbers
  &lt;p&gt;Same pre-registered cases as the table above, prediction = most probable option in every arm, each alternative run twice, compared with a same-day rerun of the baseline setup (which matched the earlier run within 0.6 points). Differences are in points with 95% intervals; both runs are averaged per case.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Setup&lt;/th&gt;
&lt;th&gt;TREC fine (42)&lt;/th&gt;
&lt;th&gt;Banking77 (77)&lt;/th&gt;
&lt;th&gt;CLINC150 (150)&lt;/th&gt;
&lt;th&gt;DBpedia (219)&lt;/th&gt;
&lt;th&gt;All four&lt;/th&gt;
&lt;th&gt;Cost vs baseline&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Baseline: chunks of ≤19, labels spread&lt;/td&gt;
&lt;td&gt;83.0%&lt;/td&gt;
&lt;td&gt;79.0%&lt;/td&gt;
&lt;td&gt;91.7%&lt;/td&gt;
&lt;td&gt;90.4%&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;One call, all labels, sorted&lt;/td&gt;
&lt;td&gt;−4.3 [−7.1, −1.5]&lt;/td&gt;
&lt;td&gt;−0.1&lt;/td&gt;
&lt;td&gt;+0.9&lt;/td&gt;
&lt;td&gt;+1.1&lt;/td&gt;
&lt;td&gt;−0.3 [−1.3, +0.7]&lt;/td&gt;
&lt;td&gt;31-56% cheaper, ~1.1 s&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Chunks of 21-39&lt;/td&gt;
&lt;td&gt;−5.7 [−8.9, −2.5]&lt;/td&gt;
&lt;td&gt;+0.1&lt;/td&gt;
&lt;td&gt;−1.6&lt;/td&gt;
&lt;td&gt;+0.1&lt;/td&gt;
&lt;td&gt;−1.5 [−2.5, −0.4]&lt;/td&gt;
&lt;td&gt;9-28% cheaper&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Chunks of ≤19, similar labels together&lt;/td&gt;
&lt;td&gt;−4.6 [−7.5, −1.8]&lt;/td&gt;
&lt;td&gt;−0.3&lt;/td&gt;
&lt;td&gt;−1.7&lt;/td&gt;
&lt;td&gt;+0.8&lt;/td&gt;
&lt;td&gt;−1.2 [−2.2, −0.3]&lt;/td&gt;
&lt;td&gt;same&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Chunks of ≤19 with 3-digit codes&lt;/td&gt;
&lt;td&gt;0.0&lt;/td&gt;
&lt;td&gt;+0.1&lt;/td&gt;
&lt;td&gt;−0.3&lt;/td&gt;
&lt;td&gt;+0.6&lt;/td&gt;
&lt;td&gt;+0.1 [−0.6, +0.9]&lt;/td&gt;
&lt;td&gt;same&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The last row shows the 3-digit codes aren't what costs accuracy. On TREC fine, the baseline setup picked the wrong broad category (the part before the colon, like &lt;code&gt;NUM&lt;/code&gt; or &lt;code&gt;LOC&lt;/code&gt;) in 26 of 500 cases; the alternatives did so in 45 to 55. We don't know why spreading labels across chunks helps there; it's a measured pattern, not an explained one. In the single-call runs we also checked the candidate list: the probability left off the top 20 never exceeded 5% in 5,354 calls.&lt;/p&gt;



&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;
  Why the category tree lost
  &lt;p&gt;We used each dataset's own hierarchy (for Banking77, groups we wrote by hand). On the same cases the tree trailed Jev by 4 points on TREC, 8 on Banking77, 26 on DBpedia and 29 on CLINC150. Almost all of the loss is in the first step: on CLINC the tree picked the right domain 66% of the time, while the flat version implicitly gets it right 96% of the time. Once in the right branch it rarely misses. Our guess is the names: CLINC's domains are called "meta", "utility" and "home", DBpedia's top level "Agent", "UnitOfWork" and "TopicalConcept". If you walk a hierarchy, make its group names describe what's inside them, and test it against flat groups.&lt;/p&gt;



&lt;p&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Confidence: making probabilities honest
&lt;/h2&gt;

&lt;p&gt;Accuracy was close. Confidence was not: out of the box, our DIY adapter sounded far more certain than it deserved to be on every single dataset.&lt;/p&gt;

&lt;p&gt;Think of confidence like a weather forecast: if a meteorologist says there is a 90% chance of rain, it should actually rain 9 out of 10 times. Raw language models are notoriously overconfident: when an LLM claims 99% certainty on an ambiguous edge case, it might only be right 75% of the time. &lt;/p&gt;

&lt;p&gt;Expected Calibration Error (ECE) measures this honesty gap: the average difference between what the model claims and how often it is actually right. Lower is better (0 means perfect honesty).&lt;/p&gt;

&lt;p&gt;Part of our initial overconfidence was a profile default: the default gateway profile used to leave out candidates outside the top 98% of probability (&lt;code&gt;top_p=0.98&lt;/code&gt;). On a confident answer, that zeros out every runner-up option. Setting &lt;code&gt;top_p=1.0&lt;/code&gt; explicitly brings back their real, tiny probabilities without changing which answer wins.&lt;/p&gt;

&lt;p&gt;The real fix is temperature scaling, which requires just one number (T). We raise each probability to the power 1/T and renormalize (&lt;code&gt;calibration_t&lt;/code&gt; in the code). When T &amp;gt; 1, it gently cools down the model's extreme certainty, spreading probability back to runners-up while keeping the winning label identical. At T=6, an extreme 99.99% / 0.01% split softens to an honest 82% / 18%.&lt;/p&gt;

&lt;p&gt;We fitted T on a few hundred labelled examples per dataset. Afterwards, our confidence was just as honest as Jev's out of the box, achieving a lower calibration error (ECE) on 9 of the 13 datasets.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fbgildax6fn9t96t7pi5k.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fbgildax6fn9t96t7pi5k.png" alt="expected calibration error per dataset for DIY raw, DIY with a fitted temperature, and Jev raw. Raw DIY is worst on every set, up to 0.53; with the fitted temperature it drops to 0.10 or below everywhere, below Jev on 9 of 13." width="800" height="524"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;One T doesn't suit every task, so temperature can be set per question, fitted on a few hundred labelled examples of your own.&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;
  The numbers behind this
  &lt;p&gt;We measure honesty with expected calibration error (ECE): the average gap between how sure the model says it is and how often it is right. Lower is better. Raw, ours ranged from 0.06 to 0.53 across the 13 sets, Jev's from 0.03 to 0.35.&lt;/p&gt;

&lt;p&gt;Before the &lt;code&gt;top_p&lt;/code&gt; fix, in an earlier run on five of these datasets, about 70% of answers came back with no runner-up at all, so no rescaling could help. After it, 0.4%.&lt;/p&gt;

&lt;p&gt;With T fitted on half of each dataset (138 to 385 cases) and measured on the other half, T ranged from 2 to 10 and ECE was 0.10 or lower on all 13 sets (up to 0.13 with a different random split). That is below Jev's out-of-the-box ECE on 9 of 13. Jev could be tuned the same way; with the same fit applied to both, ours is lower on 10 of 13. With T=6 everywhere, TREC question type, CLINC150 and DBpedia became underconfident (ECE about 0.2). For the four sets past 19 labels, the confidence comes from the final round only.&lt;/p&gt;

&lt;p&gt;We also tried a fix from Nokia's &lt;a href="https://github.com/nokia-applied-research/AnyJev" rel="noopener noreferrer"&gt;AnyJev&lt;/a&gt;: ask twice with the options reversed and average. The order does matter, changing our answer in 2.4% (AG News), 6.4% (TREC) and 13.7% (Emotion) of cases, but averaging both orders changed accuracy by +1.0, 0.0 and −1.3 points. Not worth doubling the calls. Reversed order alone cost up to 3 points (TREC), so the table's numbers hold for the label order we used.&lt;/p&gt;



&lt;p&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Speed and cost
&lt;/h2&gt;

&lt;p&gt;About 1.2 seconds per call at the median on short text, including an intermediary network hop; about 0.3 seconds for Jev. Past 19 labels, 3 to 4 seconds.&lt;/p&gt;

&lt;p&gt;Jev's list price is $0.042 per 1M input tokens with free output. &lt;code&gt;gpt-6-luna&lt;/code&gt; costs $0.10 per 1M input and $0.50 per 1M output. Measured per decision on live calls:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A single sentence of text, one question: ours $8, Jev $13 per 1M decisions.&lt;/li&gt;
&lt;li&gt;About 500 words of text: ours $87, Jev $48 per 1M decisions.&lt;/li&gt;
&lt;li&gt;Several questions about the same text favour Jev further: Jev sends the text once per call, ours sends it with every question.&lt;/li&gt;
&lt;li&gt;Past 19 labels every group is its own call and resends the text. On our short benchmark texts that made a 219-label decision about 2.2 times as expensive as one call holding all labels (1.5 times at 42 to 150 labels); the longer the text, the bigger the gap.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Filqtme2kiny9445hmokf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Filqtme2kiny9445hmokf.png" alt="Line chart of cost per million decisions versus text length in tokens. DIY is cheaper below about 90 tokens; above that Jev is cheaper, about $48 vs $87 at 500 words, and cheaper still when three questions share one call." width="800" height="480"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The break-even point is about 90 tokens of text.&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;
  More on speed, capacity and cost
  &lt;p&gt;Latency: 2 seconds at the 90th percentile on short text; we ran 10 calls at a time against Jev's 5. With very long text we saw 2-6 second medians.&lt;/p&gt;

&lt;p&gt;Capacity: shared public evaluation pools can face transient rate limits under batch load. In load testing, the adapter was verified under high synthetic concurrency, maintaining stable throughput and &amp;gt;99% completion across parallel requests.&lt;/p&gt;

&lt;p&gt;Cost: ours pays for 5 output tokens per question, about 30% of the cost on short text. The Jev side uses TypeSafe's list price; what Cloudflare charges for it was not visible to us. TypeSafe's own benchmark (&lt;a href="https://evals.typesafe.ai" rel="noopener noreferrer"&gt;evals.typesafe.ai&lt;/a&gt;) reports $0.0004 per case for Jev and $0.0033 for Luna, but there Luna generates text answers and the page doesn't say how many decisions a case holds, so those figures don't map onto ours.&lt;/p&gt;



&lt;p&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  If you build your own
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Check that logprobs actually come back.&lt;/strong&gt; Support depends on the provider, the model and the API you call. When they're missing you may still get an answer, just no probabilities, and nothing errors.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Set &lt;code&gt;top_p=1.0&lt;/code&gt;&lt;/strong&gt;, or the runner-up options read as zero.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Switch from digits to letters past 10 options.&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Enterprise safety filters can block legitimate domain queries.&lt;/strong&gt; Provider content filters occasionally refuse domain texts (even benign content). In enterprise setups, handling this often requires dedicated deployments with modified filtering, separate quota, or explicit fallback paths for refused groups.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Option order matters a little&lt;/strong&gt;, up to 3 points in our tests. Keep it fixed.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Fit the confidence before you rely on it.&lt;/strong&gt; Run a few hundred labelled examples and pick the T where "80% sure" is right about 80% of the time.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What we got out of it
&lt;/h2&gt;

&lt;p&gt;On picking a category, the DIY version is within about a point of Jev on six datasets, trailing by 2.4 points on DBpedia (219 labels). On yes/no questions and rating scales Jev is a few points more accurate, and it is faster, cheaper on anything longer than a sentence, and honest about its confidence out of the box. What this prototype gave us is time: it was running within days on existing LLM infrastructure, takes finer scales, and reads far more text. Now we can observe real demand before deciding whether a dedicated model is justified. If it is, a purpose-built model goes in behind the exact same request shape.&lt;/p&gt;

&lt;p&gt;If you try this yourself, benchmark on data the model is unlikely to have seen, then on your own, and check the confidence against labels before you set a threshold on it.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Disclaimer: This article presents an independent technical evaluation on public datasets. The views expressed are my own. The author is not affiliated with or endorsed by TypeSafe AI.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>jev</category>
      <category>llm</category>
      <category>ai</category>
      <category>machinelearning</category>
    </item>
  </channel>
</rss>
