A Jev Gate in Front of Your LLM (Stas Slutsker)
External write-up by Stas Slutsker on DEV (2026-10-20): one Jev call with a choice and a noul question decides whether a Hebrew stock-review RAG assistant runs its expensive generation, tested on 134 questions in Hebrew and English.
What this guide points to
Stas Slutsker published Put a bouncer in front of your LLM: a Jev gate for your pet AI project on DEV (2026-10-20). His side project, telavivstocks.com, answers questions from a value investor’s stock reviews with a plain RAG pipeline (Gemini embeddings, pgvector, Gemini Flash). He put one Jev call in front of the generation step: a choice question for intent (stock_research, site_help, navigate, off_topic) and a noul question for prompt injection.
The call starts at the same time as the embedding, has a 1.5 s timeout, and fails open on any error. A decline needs both the probability and Jev’s confidence to clear the bar, and a simple stock-name matcher blocks off-topic declines when a question names a reviewed stock. On 134 test questions at the shipped thresholds, he reports off-topic precision 97.1% (Hebrew) and 100% (English), off-topic recall 91.7% and 97.1%, injection precision 100% in both, and p50 latency of 577 ms and 610 ms. He shipped the gate in shadow mode first.
This page is an unofficial field manual pointer — verify claims against the article and current TypeSafe docs. The site is a stock-review dashboard; nothing here is investment advice.
Takeaways
- Write criteria carefully; missing words in an option description cause wrong declines.
- Let plain code make the final call, and never let the gate pick the target page.
- Ship in shadow mode, test in your users’ language, and fail open on errors.