Exact and repeatable
- Exact string matching
- Required-field validation
- Input-size limits
JEV FOR CLAIM VERIFICATION
Paste a claim, the quote you are relying on, and the surrounding source text. Code first verifies that the quote really exists. Jev then judges whether the evidence supports the claim.
01 / LIVE VERIFIER
The supported example is already filled in. Click Verify citation without editing anything. The quote check runs in your browser; only a verified quote reaches the real TypeSafe Jev model.
Switching an example changes the fields but never runs Jev.
Application code checks the exact string locally before Jev is called.
Run the populated example without changing anything.
02 / HOW IT WORKS
“Supports” is not the same as “true.” Jev judges the relationship between the supplied claim and supplied evidence. A source can support a claim and still be unreliable, outdated, or incomplete.
03 / WHY VERIFY THE QUOTE FIRST
04 / HOW TO READ THE RESULT
The selected relation comes from Jev. Its actual probability drives the local demo policy: at or above the chosen threshold the status is Auto; otherwise it is Human Review. A missing distribution always goes to Human Review. Moving the threshold never calls the model again.
05 / REAL-WORLD PATTERN
The public Paper Trellis Citation Verifier demonstrates a broader workflow: parse a manuscript, match references, locate source text, verify proposed quotes in code, use Jev for semantic support, and leave the final decision to a person. This page demonstrates only the core verification layer after the evidence has been supplied.
Attributed example: Paper Trellis Citation Verifier on GitHub (opens in a new tab).
06 / IMPLEMENTATION
This original example uses the same Vercel AI Gateway integration as Jev Playground. It stops before the model when the quote is absent, asks one Choice question when it is present, and applies a local review threshold afterward.
import { createGateway, experimental_evaluate as evaluate } from 'ai';
const gateway = createGateway({
apiKey: process.env.AI_GATEWAY_API_KEY,
});
const normalizeLines = (text: string) => text.replace(/\r\n?/g, '\n');
export async function verifyCitation(
claim: string,
quote: string,
source: string,
) {
const quoteFound = normalizeLines(source).includes(normalizeLines(quote));
if (!quoteFound) throw new Error('Exact quote not found');
const result = await evaluate({
model: gateway.evaluationModel('typesafe-ai/jev'),
state: `CLAIM:
${claim}
VERIFIED QUOTE:
${quote}
SOURCE:
${source}`,
questions: {
relation: {
type: 'choice',
instructions: 'How does the verified evidence relate to the claim?',
criteria: {
SUPPORTS: 'The evidence directly supports or clearly entails the claim.',
CONTRADICTS: 'The evidence states or clearly implies the opposite.',
INSUFFICIENT: 'Relevant, but not enough to establish the claim.',
UNRELATED: 'The evidence does not address the claim.',
},
},
},
maxRetries: 0,
abortSignal: AbortSignal.timeout(30_000),
providerOptions: { gateway: { zeroDataRetention: true } },
});
const answer = result.answers.relation;
const topProbability = answer.probabilities?.[answer.choice];
const reviewThreshold = 0.8; // Your application policy, not Jev's.
const status = topProbability !== undefined && topProbability >= reviewThreshold
? 'AUTO'
: 'HUMAN REVIEW';
return { relation: answer.choice, probabilities: answer.probabilities, status };
}For request contracts, production error handling, and server-side credentials, continue to the Jev API guide.
07 / LIMITATIONS
The demo evaluates only the relationship between the supplied claim and supplied evidence.
08 / SOURCES
Verified on .
Jev Playground is independent and is not affiliated with TypeSafe AI or the referenced community projects.
KEEP LEARNING