VectifyAI/PageIndex · error · PageIndexAPIError

index= and the flat index-side arguments ({args}) are two sp

Error message

index= and the flat index-side arguments ({args}) are two spellings of the same thing — use one or the other.

What it means

The index-side configuration was spelled twice: once via the index= slot dict and once via flat arguments like index_model=/retrieve_model=/index_backend=. The SDK forbids the duplication because there is no rule for which spelling wins.

Source

Thrown at pageindex/client.py:382

             ("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.
        declared = _declared_mode(mode, "client") or self._pin
        pinned = type(self).__name__ if self._pin else None
        if index is not None:
            cloud_key, index_conf = _resolve_index_slot(index)
            if declared == "local" and cloud_key is not None:
                raise PageIndexAPIError(

View on GitHub (pinned to afb5e11976)

Solutions

  1. Keep one spelling: either the index= dict or the flat index_model=/retrieve_model=/index_backend= arguments
  2. Delete the duplicated flat arguments from the call

Example fix

# before
PageIndexClient(index={"model": "m"}, retrieve_model="r")
# after
PageIndexClient(index={"model": "m", "retrieve_model": "r"})
Defensive patterns

Strategy: validation

Validate before calling

index_flat_used = any(v is not None for v in (index_model, retrieve_model, index_backend))
assert not (index is not None and index_flat_used)

Prevention

When it happens

Trigger: PageIndexClient(index={"model": "m"}, index_model="m2") or index={"backend": {...}, retrieve_model="r").

Common situations: Refactoring code from flat kwargs to slot dicts without removing the old arguments; copying examples that use different styles.

Related errors


AI-assisted analysis of VectifyAI/PageIndex@afb5e11976 (2026-08-27). Data as JSON: /api/errors/7538159e26fdaafa. Report an issue: GitHub.