Developer adds a lightweight gate to cut LLM costs on a Hebrew stock-review chatbot
A developer running telavivstocks.com, a Hebrew dashboard for Tel Aviv Stock Exchange stocks, found that their AI assistant ran a full embedding, vector search and generation for every question, including off-topic ones. To fix this, they placed a small decision model, TypeSafe's Jev, in front of the expensive model to decide whether it should be called at all. The gate classifies each question by intent and checks for prompt-injection attempts, returning probabilities that can be compared against a threshold. The developer estimates the cost at about two cents per thousand questions, and wrote the gate instructions in English while keeping visitors' Hebrew questions unchanged.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in