run-llama/llama_index · error · ValueError
Every index in Playground should be an instance of BaseIndex
Error message
Every index in Playground should be an instance of BaseIndex.
What it means
Error "Every index in Playground should be an instance of BaseIndex." thrown in run-llama/llama_index.
Source
Thrown at llama-index-core/llama_index/core/playground/base.py:90
"""
if len(documents) == 0:
raise ValueError(
"Playground must be initialized with a nonempty list of Documents."
)
indices = [
index_class.from_documents(documents, **kwargs)
for index_class in index_classes
]
return cls(indices, retriever_modes)
def _validate_indices(self, indices: List[BaseIndex]) -> None:
"""Validate a list of indices."""
if len(indices) == 0:
raise ValueError("Playground must have a non-empty list of indices.")
for index in indices:
if not isinstance(index, BaseIndex):
raise ValueError(
"Every index in Playground should be an instance of BaseIndex."
)
@property
def indices(self) -> List[BaseIndex]:
"""Get Playground's indices."""
return self._indices
@indices.setter
def indices(self, indices: List[BaseIndex]) -> None:
"""Set Playground's indices."""
self._validate_indices(indices)
self._indices = indices
def _validate_modes(self, retriever_modes: INDEX_SPECIFIC_QUERY_MODES_TYPE) -> None:
"""Validate a list of retriever_modes."""
if len(retriever_modes) == 0:
raise ValueError(View on GitHub (pinned to afd0fef371)
Solutions
- Pass only BaseIndex instances (e.g. VectorStoreIndex) in the indices list.
- Build proper index objects before constructing the Playground.
When it happens
Trigger: Thrown at llama-index-core/llama_index/core/playground/base.py:90 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of run-llama/llama_index@afd0fef371 (2026-08-15).
Data as JSON: /api/errors/844784807c6b99fa.
Report an issue: GitHub.