AI checks: assertions in plain language, judged by your own model
How do you test a response that's different every time? A chatbot reply, a generated product description, an error message that should be "helpful". pm.expect(body).to.equal(…) doesn't work, and a regex only catches the obvious. An AI check lets you write the expectation the way you'd say it to a colleague, and a language model on your own machine decides whether the response meets it.
Set up a model
Install LM Studio or Ollama, download a model, and start its server. Then in Requestarium, Settings → Profile → Local AI: pick the runtime, the address (http://localhost:1234/v1 for LM Studio, http://localhost:11434/v1 for Ollama) and the model, and press Test connection. The Local AI docs have model suggestions.
In the web app, AI checks reach your model through Requestarium Desktop or the local agent.
Add an AI check
- Open a request's Tests tab and add an assertion.
- Set its source to AI check.
- Write the criterion.
- Optionally, a JSON path such as
$.choices[0].message.contentto judge only that part. Empty means the whole body.
Send the request. The check passes or fails with a one-sentence reason from the model, for example: "Fails: the reply apologizes but doesn't mention order 4812."
Write criteria a model can judge
Good criteria are specific and checkable from the response alone:
| Vague | Better |
|---|---|
| The answer is good | The answer says the refund takes 5–10 business days |
| The error is helpful | The error names the field that is missing and says what format it expects |
| No bad content | The reply contains no email addresses, phone numbers or URLs |
| Sounds professional | The reply has no slang, no emoji and addresses the customer as "you" |
One idea per check. Three small checks give clearer failures than one long one.
Combine with ordinary tests
AI checks are slower and less certain than code. Use them only for what code can't do:
// Code checks: fast and exact
pm.test('returns 200', () => pm.response.to.have.status(200));
pm.test('reply is not empty', () => {
pm.expect(pm.response.json().reply.length).to.be.above(20);
});Plus one AI check: "The reply answers the question about shipping to Canada and gives a delivery time."
In the CLI and CI
requestarium run-collection "Support bot" --env Staging \
--ai-url http://localhost:11434/v1 --ai-model llama3.1:8bIn CI, run Ollama as a service container next to the job, or point --ai-url at a model provider with --ai-key. Without --ai-url, AI checks fail and say how to set one up, so they never pass silently.
Limits
- AI checks run on Send, in collection runs and in test suites, not in the live preview while you type. The IDE plugins don't run them.
- Responses longer than 12,000 characters are cut before they reach the model.
- A small model is fine for clear criteria; for subtle ones, use a larger model and expect some disagreement. Treat a flaky AI check like any flaky test: sharpen the criterion.