Typesafe's JEV model work as an LLM [P]
Mirrored from r/MachineLearning for archival readability. Support the source by reading on the original site.
| I built a conversational AI that doesn't generate a single token — it selects from 400 pre-written responses using TypeSafe's Jev, a non-generative model that returns probabilistic judgments instead of text. The technical approach: Traditional LLMs generate responses token by token. I flipped this — I wrote 400 responses by hand and let the AI pick the best match. Here's the architecture: Step 1: Classification (400ms, 1 API call) I ask Jev 18 questions in parallel about the user's message: All 18 run in one API call using speculative fan-out — code only reads the subcategory answer for whichever intent wins. This eliminates a round trip without extra cost. Step 2: Candidate Fetch (0ms, pure code) The response bank is structured as: Code looks up Step 3: Scoring (400ms, 1 API call) Each candidate gets scored on 6 dimensions in parallel: Then I apply context-aware weights: Winner = highest weighted score. Step 4: Output If final score < 0.4 or intent confidence < 0.3, optional LLM fallback kicks in (I use Claude Haiku). Otherwise, return the selected response. Example flow: User: "I'm frustrated, my order has been wrong three times" Total: ~800ms, ~$0.0001 per message Why this works: Philosophical questions nail it. Philosophy is about picking the right framing, not generating insights. "What's the purpose of life?" has many valid perspectives — selection feels natural. No hallucinations. Every word was pre-written. Perfect for customer support or anywhere brand safety matters. Full transparency. You see intent → scores → winner. No "the model decided" black box. 100x cheaper. ~$0.0001 vs ~$0.01-0.10 per message. Where it breaks: Can't generate anything. No coding, writing, creative tasks. If it's not in the bank, I got nothing. Limited to 400 responses. Works for bounded conversations (support, FAQs, onboarding). Scaling needs manual work or template responses with dynamic slots. Factual Q&A is rough unless you template responses with live data. I added an LLM fallback for low confidence, but 90% is pure selection. What Jev is NOT doing: It doesn't read the response bank — I fetch candidates in code. Jev only classifies the message and scores the candidates. No reasoning, no generation, just fast probabilistic judgments. Links:
Would love feedback — especially if anyone's tried similar selection-based approaches or has ideas for scaling the response bank! [link] [comments] |
Discussion (0)
Sign in to join the discussion. Free account, 30 seconds — email code or GitHub.
Sign in →No comments yet. Sign in and be the first to say something.