{"record":{"id":"0782a0e669d5fd45","repo":"rohitg00/ai-engineering-from-scratch","slug":"adapter-model-id-values-must-be-unique-within-a-si","errorCode":null,"errorMessage":"adapter.model_id values must be unique within a single eval run","messagePattern":"adapter\\.model_id values must be unique within a single eval run","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"phases/19-capstone-projects/75-end-to-end-eval-runner/code/main.py","lineNumber":147,"sourceCode":"        correct=bool(correct),\n        confidence=float(min(1.0, max(0.0, gen.confidence))),\n        generation=gen.text,\n        detail=detail,\n        wall_seconds=float(elapsed),\n    )\n\n\ndef run_eval(\n    adapters: Sequence[ModelAdapter],\n    tasks: Sequence[TaskSpec],\n    parallel: bool = True,\n    max_workers: int = 8,\n    code_exec_timeout_s: float = 3.0,\n) -> tuple[list[TaskResult], dict[str, list[tuple[float, float, int]]]]:\n    results: list[TaskResult] = []\n    model_ids = [a.model_id for a in adapters]\n    if len(set(model_ids)) != len(model_ids):\n        raise ValueError(\"adapter.model_id values must be unique within a single eval run\")\n    calibration_buf: dict[str, list[tuple[float, float, int]]] = {mid: [] for mid in model_ids}\n\n    if not tasks or not adapters:\n        return results, calibration_buf\n\n    work: list[tuple[ModelAdapter, TaskSpec]] = []\n    for adapter in adapters:\n        for task in tasks:\n            work.append((adapter, task))\n\n    if parallel and len(work) > 1:\n        workers = min(max_workers, len(work))\n        with ThreadPoolExecutor(max_workers=workers) as ex:\n            futures = {\n                ex.submit(_score_one, adapter, task, code_exec_timeout_s): (adapter, task)\n                for adapter, task in work\n            }\n            for fut in as_completed(futures):","sourceCodeStart":129,"sourceCodeEnd":165,"githubUrl":"https://github.com/rohitg00/ai-engineering-from-scratch/blob/39ea8a1c6d0b61f071226eff7ede4d4105fed820/phases/19-capstone-projects/75-end-to-end-eval-runner/code/main.py#L129-L165","documentation":"Error \"adapter.model_id values must be unique within a single eval run\" thrown in rohitg00/ai-engineering-from-scratch.","triggerScenarios":"Thrown at phases/19-capstone-projects/75-end-to-end-eval-runner/code/main.py:147 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"39ea8a1c6d0b61f071226eff7ede4d4105fed820","analyzedAt":"2026-08-26T03:13:46.626Z","schemaVersion":2},"datasetVersion":"2026-08-26T07:17:17.940Z"}