Renderify

Generation evals

Renderify is only as useful as the plans models produce for it. The generation eval runs a fixed prompt suite through the real pipeline — structured generation, repair, security policy, and runtime rendering — for every configured provider, and reports how often the result is usable.

One contract for every provider

All built-in providers share the RuntimePlan contract exported by @renderify/ir:

  • RUNTIME_PLAN_JSON_SCHEMA (or createRuntimePlanJsonSchema()) is the structured-output schema sent to OpenAI, OpenAI Codex, Anthropic, Google, and LM Studio. Ollama requests JSON mode for compatibility with older local servers and relies on the same local validation.
  • acceptRuntimePlanCandidate() accepts canonical plans unchanged, normalizes recoverable variants such as a missing id, and rejects everything else.
  • diagnoseRuntimePlanCandidate() explains rejections in terms a model can act on, such as root.tag must be a non-empty string for an element node. Those diagnostics feed the structured repair prompt for every provider.

Because the schema is shared, a provider test fails if any provider sends a different schema.

Metrics

MetricMeaning
RenderedThe pipeline produced a plan that passed policy and rendered.
Valid on first tryThe first structured response was a valid RuntimePlan, with no repair.
Checks passedThe rendered plan also met the case's structural checks (for example, a button exists or the source uses useState).
Policy rejectionsPlans the active security profile rejected. Declarative cases run under balanced; source cases under trusted.
Avg. model callsModel calls per case, including repairs and text fallback. Lower is better.
p50 / p95 latencyEnd-to-end time per case, including rendering.

Run locally

Without credentials, the harness runs deterministic fixtures that still exercise generation, repair, policy, and rendering:

pnpm eval:generation -- --mock

For live providers, set credentials and optionally pick providers and cases:

RENDERIFY_EVAL_OPENAI_API_KEY=sk-... \
RENDERIFY_EVAL_ANTHROPIC_API_KEY=sk-ant-... \
RENDERIFY_EVAL_CASES=counter,jsx-todo \
pnpm eval:generation
VariablePurpose
RENDERIFY_EVAL_PROVIDERSComma-separated openai, anthropic, google, ollama, lmstudio, openai-codex. Defaults to every hosted provider with an API key.
RENDERIFY_EVAL_<PROVIDER>_API_KEYProvider credential, for example RENDERIFY_EVAL_GOOGLE_API_KEY. Codex uses RENDERIFY_EVAL_OPENAI_CODEX_ACCESS_TOKEN and ..._ACCOUNT_ID.
RENDERIFY_EVAL_<PROVIDER>_MODELModel override.
RENDERIFY_EVAL_<PROVIDER>_BASE_URLEndpoint override, required for local Ollama or LM Studio hosts that are not on their defaults.
RENDERIFY_EVAL_CASESComma-separated case ids.
RENDERIFY_EVAL_OUTPUT_DIRReport directory; defaults to .artifacts/evals.

Each run writes a JSON report and a Markdown summary, and appends the summary to $GITHUB_STEP_SUMMARY when present.

Nightly results

.github/workflows/generation-eval.yml runs every night and on demand. It evaluates each provider whose RENDERIFY_EVAL_*_API_KEY repository secret is set (model overrides come from repository variables of the same name). The summary table is published on the workflow run page, and the JSON report is attached as the generation-eval artifact.

Add a case

Cases live in tests/evals/generation-cases.json:

{
  "id": "counter",
  "prompt": "Build a counter with increment, decrement, and reset buttons.",
  "lane": "declarative",
  "checks": { "tags": ["button"], "minTransitions": 2 }
}

lane selects the security profile and the expected output: declarative plans must not contain source, and source plans must. Keep checks structural so they stay stable across models; pnpm unit verifies that ids are unique and that the harness itself works.

Edit this page on GitHub

On this page