HUE_API_KEY to a project service key. Both SDKs connect to Hue Cloud by default.
Choose your content policy
Telemetry capture and evaluation storage are separate choices:
Dataset inputs and reference answers are intentionally uploaded during setup. The second switch also controls target error messages, scorer evidence, arbitrary explanations, and their copies in local checkpoints. With it disabled, local scores can still be uploaded, but historical scorers skip unavailable output instead of invoking a callback on invented data. Declared metric values are always uploaded, including custom text metrics.
Create and run the experiment
Choose one language. The program creates its setup once and saves its IDs locally. Subsequent invocations use the same experiment and checkpoint directories. Add the example’s.hue-first-evaluation-* directory to .gitignore.
- TypeScript
- Python
Save this as
first-evaluation.ts, then run node first-evaluation.ts with Node.js 24.state.json is written, the next invocation stops instead of silently creating another experiment. Inspect Datasets, Scorers, and Experiments before recovering setup. Registry mutations have no automatic retry. The saved creation request can recover an uncertain experiment acknowledgement with its original idempotency key and payload.
Read the result
Open Experiments and select Uppercase baseline. The target should succeed and the exact-match metric should be true. The historical run uses the same immutable subject ID and saved output. Therescore API has no target callback, so it cannot invoke the uppercase function again.
To compare a different target configuration, create a new experiment with the same frozen dataset version and published scorer version. Use a new checkpoint directory. Do not edit the existing experiment’s frozen pins or reuse its checkpoint as a new attempt.
Preserve absence and quality failures
Read presence flags such ashasOutput and hasExpected in API responses. Do not test value truthiness: JSON null, false, 0, and "" can all be present values. TypeScript target return undefined and Python’s exported MISSING sentinel represent unavailable output. Python None is a present null.
A failed quality verdict is still a scored result, typically with passed: false. Target execution errors and scorer errors have separate states. Missing evidence produces an explicit skipped result. Exact match preserves scalar types; false is not zero.
Resume without repeating side effects
Keep the same experiment ID, content settings, and checkpoint directory when retrying an interrupted upload. The runner saves permitted completion and scoring payloads before upload and reuses their request keys. It will not automatically rerun a target whose outcome is uncertain. If the process crashes after invoking a target but before saving its outcome, the runner raisesUncertainExecutionError. Inspect the execution and its side effects. Removing the checkpoint or its lock is not permission to run the target again. Checkpoints are private local files, not encrypted storage. Confirm the old process has stopped before explicitly removing a leftover .lock.
The example requires trace evidence. The runner ends the root span and waits for trace/log acknowledgement before completing the execution. An export failure does not silently become omitted evidence, and a fresh exporter cannot prove that an earlier export succeeded. Explicit omission is a separate policy: TypeScript { mode: "omit", reason: "This local run does not retain a trace snapshot." } or Python TraceEvidence("omit", "This local run does not retain a trace snapshot."); supply a meaningful reason if you choose it.
Local built-ins also include string inclusion and JSON Schema draft 2020-12. Custom callbacks run on your machine and have no claimed side-effect cancellation. Manual and hosted-judge scorer pins stay pending for their owning workflows; this example does not dispatch them or claim live hosted-model acceptance.