VectifyAI/PageIndex · error · RuntimeError

Summary generation failed for all nodes (every summary call

Error message

Summary generation failed for all nodes (every summary call failed or returned empty; check the model and its context limits)

What it means

generate_summaries_for_structure raises RuntimeError when, after the asyncio.gather-style fan-out, every node's summary is either an exception (none unrecoverable) or an empty string. It is the loud-failure guard so a fully broken model does not silently produce a summary-less tree.

Source

Thrown at pageindex/utils.py:735

    Partial Document Text: {node['text']}
    
    Directly return the description, do not include any other text.
    """
    response = await llm_acompletion(model, prompt)
    return response


async def generate_summaries_for_structure(structure, model=None):
    nodes = structure_to_list(structure)
    tasks = [generate_node_summary(node, model=model) for node in nodes]
    summaries = await asyncio.gather(*tasks, return_exceptions=True)

    for node, summary in zip(nodes, summaries):
        if isinstance(summary, Exception) and _is_unrecoverable(summary):
            raise summary
        node['summary'] = "" if isinstance(summary, BaseException) else summary
    if nodes and not any(node['summary'] for node in nodes):
        raise RuntimeError(
            "Summary generation failed for all nodes "
            "(every summary call failed or returned empty; "
            "check the model and its context limits)"
        )
    return structure


SUMMARY_CONCURRENCY = 64        # simultaneous summary model calls
SUMMARY_RAW_TEXT_TOKENS = 200   # leaves under this reuse their raw text as the summary
SUMMARY_INTRO_MAX_PAGES = 3     # cap on leading pages fed into a parent summary


def get_intro_text(node, pdf_pages, max_pages=SUMMARY_INTRO_MAX_PAGES):
    """Pages of the node covered by no child: from its start to just before the
    first child starts. Empty when the first child opens on the node's own page."""
    children = node.get('nodes') or []
    first = children[0].get('start_index') if children else None
    if not isinstance(first, int) or first <= node['start_index']:

View on GitHub (pinned to afb5e11976)

Solutions

  1. Verify the summary model id and API key by running a single direct completion
  2. Log the absorbed per-node exceptions to see the underlying cause
  3. Check whether the pages exceed the model context and trim/shorten inputs
  4. If some summaries succeeded, this error will not fire — confirm all nodes really failed
Defensive patterns

Strategy: try-catch

Try / catch

try:
    structure = generate_summaries_for_structure(structure, ...)
except RuntimeError as e:
    if 'failed for all nodes' in str(e):
        logger.error('summary model unusable: %s', e)
        structure = generate_summaries_for_structure(structure, summary=False, ...)
    else:
        raise

Prevention

When it happens

Trigger: Every LLM summary call fails softly (empty replies, benign API errors absorbed per-node) or returns empty text — e.g. wrong model name, unreachable endpoint with absorbed errors, or a model that returns empty content for every prompt.

Common situations: Bad model identifier or credential that fails per-call without tripping the unrecoverable check; overlong pages prompting empty responses; misrouted base URL.

Related errors


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