Who it is forA developer shipping an agent whose replies must pass scope and relevance checks before they go out.
The problemOffline evals catch problems after users see them, and slow judges are too expensive to run on every reply.
The outcomeA gate in the request path that checks each reply and can stop or retry it, using the same eval definitions you used offline.
What you need first
- Python 3.10 or newer
- An API key for one backend: AI_GATEWAY_API_KEY (Jev through Vercel AI Gateway), TYPESAFE_API_KEY, or OPENROUTER_API_KEY
- A trace to evaluate: a messages list in the OpenAI chat format plus the tools you gave the model
Steps
pip install jevalsexport AI_GATEWAY_API_KEY=...- Define your checks with
StayedInScope()andAnswerRelevancy()fromjevals.agentandjevals.quality - Inside your async agent loop, await
aevaluate()on the current messages and tools, or call a gate'sacheck() - Branch on the result: return the reply if it passes, otherwise regenerate or fall back
Prompt for your agent
Wire jevals into the async agent loop in <agent_file>. Use aevaluate() with StayedInScope() and AnswerRelevancy() on each reply before it is returned. Report the latency added per reply. Verify that a reply that fails either check is not sent to the user.
Caveat. Calibrated probabilities depend on the backend, so run Jevals calibrate again if you switch backends before relying on a gate threshold.
Every Monday: the 5 hottest repos and exactly how to use them. Free, one email a week, unsubscribe anytime.
Get them freeShare: X LinkedIn Hacker News Email Copy link
Disclaimer
Deduped lists open-source repositories that belong to other people. We do not own, maintain, audit, or vouch for any of them, and a repo appearing here is not an endorsement or a safety check. The use cases, steps, and prompts are written by AI and may be incomplete, outdated, or just wrong. Where a use case is marked "Seen in the wild", we link to public posts where someone described something similar, but we have not verified those posts and the use case itself is still our AI's own write-up. Use all of this at your own risk. Only run code, commands, or agents on systems and accounts you are authorized to use, and read the code and every command before you run it, especially anything that touches credentials, files, or the network. Nothing here is professional, security, legal, or financial advice. All trademarks and project names belong to their respective owners, and their use here does not imply affiliation. Content is provided as is, without warranties of any kind. Found a mistake, a safety problem, or something you want removed? Email [email protected] and we will look at it promptly. Full disclaimer page