发布

  • [OPIK-5889] perf: patch sys.modules in sandbox to skip heavy opik imports (#6319)

    frostbyte_neo 发布于 2026-04-16 11:48:51 +00:00

    • [OPIK-5889] perf: patch sys.modules in scoring_runner to use lightweight _opik

    The full opik package takes ~2.5s to import under CPU contention in sandbox
    pods, exhausting the 9s execution timeout before user code runs.

    Patch sys.modules before any user code executes so that
    from opik.evaluation.metrics import BaseMetric resolves to the pure-stdlib
    _opik package (~8ms) instead of triggering the full opik init. A _FallbackModule
    getattr transparently loads the real opik if anything beyond BaseMetric or
    ScoreResult is accessed.

    Depends on: SDK PR #6292 (_opik package) being released first.

    • [OPIK-5889] bump opik to 1.11.10 in sandbox requirements

    • [OPIK-5889] remove temporary local _opik copy, use released opik==1.11.10

    下载附件