VectifyAI/PageIndex · error · PageIndexAPIError
model= sets both roles at once, so no slot can absorb it — n
Error message
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. What it means
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.
Source
Thrown at pageindex/client.py:376
)
# Each side picks one spelling — its slot, or the flat arguments.
# ``model`` sets every role, so it claims both sides.
index_flat: dict[str, Any] = {
name: value for name, value in
(("api_key", api_key),
("index_model", index_model),
("summary_model", summary_model),
("index_backend", index_backend),
("storage_path", storage_path), ("model", model))
if value is not None}
chat_flat: dict[str, Any] = {
name: value for name, value in
(("chat_model", chat_model),
("retrieve_model", retrieve_model),
("chat_backend", chat_backend), ("model", model))
if value is not None}
if model is not None and (index is not None or chat is not None):
raise PageIndexAPIError(
"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.")
if index is not None and index_flat:
raise PageIndexAPIError(
"index= and the flat index-side arguments "
f"({', '.join(sorted(index_flat))}) are two spellings of "
"the same thing — use one or the other.")
if chat is not None and chat_flat:
raise PageIndexAPIError(
"chat= and the flat chat-side arguments "
f"({', '.join(sorted(chat_flat))}) are two spellings of "
"the same thing — use one or the other.")
# ``mode=`` is a cross-check, not a spelling: it combines with
# either spelling of the index side and must agree with it. The
# pinned classes declare the side by class; their errors name the
# class, never a mode= the user did not write.View on GitHub (pinned to afb5e11976)
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
Example fix
# before PageIndexClient(model="m", chat="cloud") # after PageIndexClient(index_model="m", chat="cloud")
Defensive patterns
Strategy: validation
Validate before calling
assert not (model is not None and (index is not None or chat is not None)), "model= cannot combine with index=/chat="
Prevention
- 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
When it happens
Trigger: PageIndexClient(model="m", index={...}) or PageIndexClient(model="m", chat="cloud").
Common situations: Starting with model= for a quick setup, then adding an index or chat slot as needs grow; merging example snippets that use different spellings.
Related errors
- chat declares mode "cloud" but carries ({keys}) — the manage
- chat is an empty string — pass a model name, or "cloud" for
- chat is an empty dict — chat takes "model" and "backend" (yo
- Unknown chat keys ({keys}) — chat takes "model" and "backend
- chat must be a string or a dict.
AI-assisted analysis of VectifyAI/PageIndex@afb5e11976 (2026-08-27).
Data as JSON: /api/errors/157f4acd85f65225.
Report an issue: GitHub.