evaluators icon indicating copy to clipboard operation
evaluators copied to clipboard

feat: add Inspect AI integration package (learning-commons-inspect-scorers)

Open adnanrhussain opened this issue 5 months ago • 0 comments

Summary

Adds integrations/inspect-python (learning-commons-inspect-scorers) — the Inspect AI integration for the LC evaluators SDK.

Stacked on #100 (LLMGeneratorProtocol). Merge #100 first, then retarget this to main.

This is split out from the combined integrations PR (#101) so the Inspect path — the only one with a real consumer (edu-panda-skill-harness) — can be validated and merged independently. The speculative observability integrations (Arize, Langfuse, Braintrust) remain on #101 to be revisited per-vendor once each is validated against a real account.

What's here

  • InspectModelAdapter — wraps Inspect's get_model() to satisfy LLMGeneratorProtocol, so the GLA evaluator runs through Inspect's own model system (no separate API keys).
  • gla_scorer() — an Inspect @scorer for grade-level appropriateness. Reads target_grade from sample metadata, scores completion or artifacts, returns CORRECT/INCORRECT with Score.unscored() for skip/error paths.
  • Entry-point registration so the scorer is discoverable via inspect score --scorer learning_commons_inspect_scorers/gla_scorer.

Review fixes already applied

  • inspect-ai>=0.3.214 — Score.unscored() (used in every skip/error path) was added in 0.3.214; the previous >=0.3.2 bound would AttributeError at runtime on older installs.
  • Import sorting / formatting cleaned (no CI was running ruff on integration packages — see CI note below).

Test plan

  • [ ] 33 tests pass (unit: score routing, band logic, artifact reading; integration: eval() with mockllm/model)
  • [ ] Follow-up: wire integration-package CI (ruff + pytest) — triggered only when the Python SDK version is bumped or integrations/inspect-python/** changes.

🤖 Generated with Claude Code

adnanrhussain avatar Jun 12 '26 17:06 adnanrhussain