Post-release continuous evaluation
Recipe — post-release continuous evaluation on production traces.
Per-run pattern
from layerlens import Stratix
client = Stratix()
# Pull a sample of recent production traces
recent = client.traces.get_many(
page=1,
page_size=50,
sort_by="created_at",
sort_order="desc",
# plus any source / judge_id / search filters relevant to your feature
)
# Score each with your continuous-eval judge
import asyncio
from layerlens import AsyncStratix
async def score_batch():
aclient = AsyncStratix()
creates = [aclient.trace_evaluations.create(trace_id=t.id, judge_id=CONTINUOUS_JUDGE_ID)
for t in recent.traces]
evals = await asyncio.gather(*creates)
return await asyncio.gather(*[aclient.trace_evaluations.wait_for_completion(e.id) for e in evals])
results = asyncio.run(score_batch())
fails = [r for r in results if not r.passed]
if len(fails) / max(len(results), 1) > 0.05:
alert_oncall(fails)Wire to a scheduler
See also
Last updated
Was this helpful?