This is a good overview of how this is done: https://www.anthropic.com/engineering/demystifying-evals-for...