Compare OpenAI and Anthropic models on the same dataset: every model answers every case in its own task run, an LLM judge grades each answer, and a parent task returns a scorecard per model.
- Fanning out one task run per model and case with
ctx.runandasyncio.gather - Capping model calls in flight per provider with a semaphore, so the fan-out stays under provider rate limits
- An LLM judge that returns a structured verdict (
messages.parse/responses.parsewith a Pydantic schema) - Retrying the tasks that call a model, and not the task that fans out
- Returning errors a retry can't fix (unknown model, missing API key) as results, and counting a model's refusal or malformed output as a failed case
- Reading the models under test and the judge from environment variables
The dataset is the support-ticket triage scenario the agent examples use. tickets.json holds the tickets; cases.json holds what a good answer must do for each one: the right category, an acceptable priority, and a rubric for the reply. The models answer with no tools and the same records in the prompt, so the eval compares the models, not an agent loop.
run_eval (fans out, no retries)
├── answer_case (one per model × case, retries on 429/5xx)
│ └── one structured-output call to the model under test
└── judge_answer (one per answered case, retries on 429/5xx)
└── one structured-output call to JUDGE_MODEL
→ scorecard per model: pass rate, average score, latency, tokens, failures, errors
A case passes when the category matches, the priority is one of the allowed values, and the judge marks every rubric criterion as met. The judge's 1–5 score is reported separately as avg_score.
- Python 3.11+
- The Render CLI
- An OpenAI API key and an Anthropic API key
pip install -r requirements.txt
cp .env.example .env
# Edit .env and set OPENAI_API_KEY and ANTHROPIC_API_KEY.The models come from .env:
| Variable | Default | Meaning |
|---|---|---|
EVAL_MODELS |
openai:gpt-6.2-sol,anthropic:claude-opus-5-5 |
Models under test, as comma-separated provider:model pairs. Providers: openai, anthropic. |
JUDGE_MODEL |
anthropic:claude-sonnet-5-5 |
The model that grades every answer. Keep it out of EVAL_MODELS so no model grades itself. |
MAX_CONCURRENT_PER_PROVIDER |
4 |
Model calls in flight per provider, answers and judging together. |
Start the local task server. It loads .env when it starts:
render workflows dev -- python main.pyIn another terminal, run the eval. Task input is a JSON array of the task's arguments, here the tickets and the cases:
render workflows tasks runs start run_eval --local --input="[$(cat tickets.json), $(cat cases.json)]"The result looks like this (trimmed):
{
"judge": "anthropic:claude-sonnet-5-5",
"cases": 5,
"scorecard": [
{
"model": "anthropic:claude-opus-5-5",
"scored": 5, "passed": 4, "pass_rate": 0.8, "avg_score": 4.2,
"latency_ms": {"p50": 6195, "max": 6526},
"tokens": {"input": 3274, "output": 1204},
"failures": [{"ticket_id": "TCK-1002", "reasons": ["not met: Gives at least one concrete step to try other than clearing cookies"]}],
"errors": []
}
],
"results": ["… every answer and verdict …"]
}To try one model on one ticket, or the judge on its own:
render workflows tasks runs start answer_case --local \
--input='["anthropic:claude-opus-5-5", {"id": "TCK-1003", "account_id": "ACC-300", "order_id": null, "subject": "Why is my account past due?", "body": "I got an email saying my account is past due. What do I owe?"}]'-
Push this folder to a Git repository Render can access.
-
In the Render Dashboard, click New > Workflow and connect the repository.
-
Set these fields:
Field Value Language Python Root Directory llm-evals(the folder that holdsmain.py). Leave it empty if this folder is the repository root.Build Command pip install -r requirements.txtStart Command python main.pyRegion Any Environment variables OPENAI_API_KEY,ANTHROPIC_API_KEY, and optionallyEVAL_MODELS,JUDGE_MODELandMAX_CONCURRENT_PER_PROVIDER -
Create the workflow. Once the first version is ready, run
run_evalfrom the Dashboard with the contents oftickets.jsonandcases.jsonas a two-element JSON array:[<tickets>, <cases>].
To compare other models, change EVAL_MODELS or JUDGE_MODEL in the service's environment and run the eval again.
client.py runs the eval with the Render SDK and prints the scorecard:
export RENDER_API_KEY=your-render-api-key
export WORKFLOW_SLUG=your-workflow-slug # defaults to llm-evals
python client.pyThe core of it:
from render import Render
render = Render() # reads RENDER_API_KEY
run = render.workflows.run_task(f"{SLUG}/run_eval", [tickets, cases])
if run.status == "completed":
report = run.results[0] # results is a list holding the return value
for s in report["scorecard"]:
print(s["model"], s["pass_rate"], s["avg_score"])run_task waits for the run to finish. To start a run and check on it later, use start_task instead.
- Render doesn't cap concurrency for you. Render queues runs only when they'd exceed your workspace's compute limits, so a large eval can start hundreds of model calls at once.
run_evalholds a semaphore per provider around eachctx.run. SetMAX_CONCURRENT_PER_PROVIDERto what your rate limits allow. See limits. - Retries are for the API, not the model.
answer_caseandjudge_answerraise on 429s, 5xx errors and connection errors, and Render retries them up to three times (2, 4 and 8 seconds apart). A refusal, a truncated answer, or output that doesn't match the schema is the model's result, so it's scored as a failed case and not retried. There's no fallback model either, since it would score a different model's answer. See retries. - Errors a retry can't fix are returned, not raised. A missing API key, an unknown model (404), or another provider 400/401/403/413/422 comes back as
{"error": ...}and is listed under the model'serrors, not scored. If the judge's key is missing,run_evalstops before calling any model. run_evaldoesn't retry. A retry would rerun every model call. Each answer and verdict is its own run, so one failure costs one call.- Chained runs are rate limited. A workspace can start up to 1,000 chained runs per minute, and
ctx.runfails past that. Each case is two chained runs (answer and verdict), so keep big datasets under that rate. - Latency is measured inside the task, around the API call. It doesn't include run startup or time spent waiting for the semaphore.
- Timeouts apply per attempt.
timeout_seconds=120bounds each attempt ofanswer_caseandjudge_answer, and a retry gets a fresh 120 seconds.run_evalhas 30 minutes for the whole eval. See timeouts. - Arguments are capped at 4 MB. The combined arguments of a run can't exceed 4 MB. For a large dataset, pass a reference (a file in object storage, a table name) and load it in the task.
- Five cases make a demo, not a benchmark. Model output varies between runs, and so does the judge's. Use enough cases, and repeat runs, before you trust a difference in pass rate. Read the judge's
explanationfor a sample of verdicts, as a judge can be wrong.