A single function Jev-like wrapper for LLMs, including vision models

A developer has created a lightweight wrapper for LLMs that utilizes token probabilities to perform classification tasks efficiently. The method allows for rapid, low-cost inference and can be extended to vision models for real-time scene analysis.
Why it matters
This approach demonstrates how developers can optimize LLM usage for specific, high-speed tasks without needing massive computational resources.
I was intrigued by Jev and the self-hostable projects appearing around it, such as OpenJev and SemIf . Reading about them introduced me to a neat trick: reading an LLM's token probabilities.
Apparently this is an old trick for some people. See e.g. OpenAI's logprobs cookbook . But it was new to me.
I believe the basic idea is to write a prompt like this:
State: My order arrived broken and I want a refund. Question: Which team should handle this? [A] billing [B] shipping [C] returns Answer with the letter of the best option only. Then add a few JSON request parameters to a compatible Chat Completions request:
{ "max_completion_tokens": 1, "logprobs": true, "top_logprobs": 20 } The LLM API will return the letter plus the model's log probabilities for alternative tokens.
Get smarter about the news
Sign up free for a feed built around what you actually care about, Dive Deeper research on any story, and the full text of every article.
Create free accountAlready have an account? Sign in