{"record":{"id":"157f4acd85f65225","repo":"VectifyAI/PageIndex","slug":"model-sets-both-roles-at-once-so-no-slot-can-abs","errorCode":null,"errorMessage":"model= sets both roles at once, so no slot can absorb it — name the model inside the slot ({\"model\": ...}) and use index_model= / chat_model= for a side written flat.","messagePattern":"model= sets both roles at once, so no slot can absorb it — name the model inside the slot \\((.+?)\\) and use index_model= / chat_model= for a side written flat\\.","errorType":"validation","errorClass":"PageIndexAPIError","httpStatus":null,"severity":"error","filePath":"pageindex/client.py","lineNumber":376,"sourceCode":"            )\n        # Each side picks one spelling — its slot, or the flat arguments.\n        # ``model`` sets every role, so it claims both sides.\n        index_flat: dict[str, Any] = {\n            name: value for name, value in\n            ((\"api_key\", api_key),\n             (\"index_model\", index_model),\n             (\"summary_model\", summary_model),\n             (\"index_backend\", index_backend),\n             (\"storage_path\", storage_path), (\"model\", model))\n            if value is not None}\n        chat_flat: dict[str, Any] = {\n            name: value for name, value in\n            ((\"chat_model\", chat_model),\n             (\"retrieve_model\", retrieve_model),\n             (\"chat_backend\", chat_backend), (\"model\", model))\n            if value is not None}\n        if model is not None and (index is not None or chat is not None):\n            raise PageIndexAPIError(\n                \"model= sets both roles at once, so no slot can absorb \"\n                'it — name the model inside the slot ({\"model\": ...}) '\n                \"and use index_model= / chat_model= for a side written \"\n                \"flat.\")\n        if index is not None and index_flat:\n            raise PageIndexAPIError(\n                \"index= and the flat index-side arguments \"\n                f\"({', '.join(sorted(index_flat))}) are two spellings of \"\n                \"the same thing — use one or the other.\")\n        if chat is not None and chat_flat:\n            raise PageIndexAPIError(\n                \"chat= and the flat chat-side arguments \"\n                f\"({', '.join(sorted(chat_flat))}) are two spellings of \"\n                \"the same thing — use one or the other.\")\n        # ``mode=`` is a cross-check, not a spelling: it combines with\n        # either spelling of the index side and must agree with it. The\n        # pinned classes declare the side by class; their errors name the\n        # class, never a mode= the user did not write.","sourceCodeStart":358,"sourceCodeEnd":394,"githubUrl":"https://github.com/VectifyAI/PageIndex/blob/afb5e119766630af6014b04fe8b53357527bc05e/pageindex/client.py#L358-L394","documentation":"model= is a shorthand that sets both the index and chat roles, so it cannot coexist with the per-side slots index=/chat= — there is no slot left for it to absorb. The SDK requires you to spell per-side configuration explicitly.","triggerScenarios":"PageIndexClient(model=\"m\", index={...}) or PageIndexClient(model=\"m\", chat=\"cloud\").","commonSituations":"Starting with model= for a quick setup, then adding an index or chat slot as needs grow; merging example snippets that use different spellings.","solutions":["Move the model into the slot: index={\"model\": ...} / chat={\"model\": ...}","Or use the flat per-side arguments index_model= / chat_model=","If both sides genuinely need the same model, set it separately per side"],"exampleFix":"# before\nPageIndexClient(model=\"m\", chat=\"cloud\")\n# after\nPageIndexClient(index_model=\"m\", chat=\"cloud\")","handlingStrategy":"validation","validationCode":"assert not (model is not None and (index is not None or chat is not None)), \"model= cannot combine with index=/chat=\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Pick one spelling up front: model= for both sides, or per-side index/chat config","In shared builders, branch on whether slots are used before setting model"],"tags":["config","conflicting-options","model"],"backgroundTag":"conflicting-config-options","analyzedSha":"afb5e119766630af6014b04fe8b53357527bc05e","analyzedAt":"2026-08-27T11:20:48.519Z","schemaVersion":2},"datasetVersion":"2026-08-27T13:17:12.746Z"}