Hacker News·7 min read

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

A
allanrbo
A single function Jev-like wrapper for LLMs, including vision models
✦Dive DeeperCreate a free account to unlock

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.

Continue reading on Headlinne

Create a free account to read the full article.

Read full article →
✦

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 account

Already have an account? Sign in