Learning resourcesReviewed · LlamaIndex

LlamaIndex Callbacks Guide

This page in the LlamaIndex Python framework documentation explains callbacks, which are hooks for tracing, timing and debugging what the library does, for developers building applications with LlamaIndex; it contains no runnable setup example. It explains event tracing, timing, token counting and available callback handlers.

Researched 14 Nov 2026

In short.

This page in the LlamaIndex Python framework documentation explains callbacks, which are hooks for tracing and debugging what the library does, for developers building applications with LlamaIndex; implementation requires details beyond this page. It describes a callback manager, nine event types and six handler options. These cover debugging traces, token usage, model inputs and outputs, and fine-tuning data recording. Event coverage varies by handler; version compatibility, performance overhead and costs are unknown.

Researched and written by an AI model and checked by a second AI model. How it works

The scope is the complete captured Callbacks page at [https://developers.llamaindex.ai/python/framework/module_guides/observability/callbacks/], including its concepts, event list, handler descriptions and surrounding notices. The documentation-access notice adds no callback API details. Linked examples, notebooks, migration guidance, repositories, other guides and external service documentation are excluded. No installation or code execution occurred; actual handler behavior, integration compatibility and performance remain untested.

The overview

Identity

This is the Callbacks component guide in the LlamaIndex Python framework documentation, under Observability. It explains a library feature and introduces existing handlers at [https://developers.llamaindex.ai/python/framework/module_guides/observability/callbacks/].

Practical assessment

The guide is useful for deciding which parts of a LlamaIndex application you want to inspect and which handler deserves further investigation. Its event descriptions make the available information concrete. It provides no imports, registration code or complete application example, so it is insufficient as a standalone implementation tutorial.

Who it helps

Python developers working with LlamaIndex can use this guide to understand debugging traces, query activity and model usage tracking. Beginners get an explanation of what can be observed; experienced developers get event names and handler responsibilities. Readers unfamiliar with LlamaIndex documents, nodes and queries will need additional background.

Documented capabilities

Callbacks can log event data and track event duration and occurrence counts. The page lists CHUNKING for text before and after splitting, NODE_PARSING for documents and resulting nodes, EMBEDDING for the number of texts embedded, and LLM for call templates and responses.

QUERY marks query starts and ends; RETRIEVE records retrieved nodes; SYNTHESIZE records synthesis results; TREE records summaries and their levels; SUB_QUESTION records a generated subquestion and answer. The page explicitly cautions that individual callbacks may not use every event type.

Using it

Requirements

The described feature applies to a Python LlamaIndex application and uses a callback manager. Developers can choose an existing callback or implement their own. Required Python and LlamaIndex versions, package dependencies, credentials and service accounts are not specified; requirements for individual integrations are unknown from this page.

How callbacks work

A callback receives information about library events so application code can record or inspect activity. The callback manager allows multiple callbacks to be added. LlamaIndex also records an event trace map that callbacks can use. The page does not define the map's structure, callback signatures, execution order or error-handling behavior.

Getting started

The setup concept is to choose callbacks and add them through the callback manager. The page links to handler examples and a token-counting migration guide, but their contents are outside this resource's scope. Installation commands, import paths and exact registration steps are not provided here.

Example use

The page's concrete example is LlamaDebugHandler, which is documented to print an event trace after most operations by default. For a question-answering application, an illustrative debugging task would be to inspect RETRIEVE data for retrieved nodes and LLM data for the call template and response. Availability in a particular handler must be confirmed. No example was executed, and no runtime output is available.

Assessment & evidence

Limitations

A listed event does not guarantee that every handler captures it. The guide supplies no benchmarks, compatibility matrix, concurrency guarantees or measured tracing overhead.

Document, prompt, retrieved-node and response logging could create additional copies of application data. Redaction, storage destinations, retention and access controls are not explained, so suitability for sensitive data is not established.

Decision rationale

The guide's practical value comes from connecting diagnostic questions to specific information: query boundaries, retrieved nodes, model exchanges and token usage. This makes it useful for planning observability in an existing LlamaIndex application. Traces and counts describe execution; the page provides no evidence that adding callbacks improves answer accuracy or reduces spending.

Handler choices

Within the documented callback system, LlamaDebugHandler provides basic event tracing, while TokenCountingHandler focuses on prompt, completion and embedding tokens. WandbCallbackHandler is described as tracking events and traces through the Wandb Prompts frontend. AimCallback tracks LLM inputs and outputs, and OpenInferenceCallbackHandler tracks model inferences.

OpenAIFineTuningHandler records LLM inputs and outputs and provides save_finetuning_events() to export them in a format intended for OpenAI fine-tuning. A custom callback is another documented option. Detailed setup, service terms and comparative performance for these choices are not established here.

Evidence basis

The evidence is the complete supplied HTML of the official Callbacks page at [https://developers.llamaindex.ai/python/framework/module_guides/observability/callbacks/]. Its substantive content describes callback concepts, event types and handler purposes. Statements about behavior are documentation claims; no code or integration was run, and runtime correctness was not assessed.

Access & freshness

Costs

Callback charges, integration subscription prices and underlying model costs are unknown. TokenCountingHandler is described as tracking prompt, completion and embedding token usage, but the page gives no prices or monetary calculation. It also provides no measurements of callback processing or storage overhead.

Licensing and reuse

The supplied page states no licence for its documentation, examples or callback implementations. Commercial-use terms and redistribution rights are unknown from this evidence. Its repository and notebook links do not supply licence terms within the page.

Version context

The supplied capture is dated 2026-11-14T21:02:45.968Z. The article gives no publication date, update date or applicable LlamaIndex release. Compatibility with a particular installed version is therefore unknown. A token-counting migration guide is linked, but its migration requirements are not included.

Next steps

Choose the information you need first: event traces, token counts, model exchanges or fine-tuning records. Then consult the relevant handler example and confirm dependencies, registration steps and event coverage for your installed LlamaIndex version.

For token counting, the page points to migration guidance at [https://developers.llamaindex.ai/python/framework/module_guides/observability/callbacks/token_counting_migration/]. Before recording application content, establish where the selected handler sends or stores it and what controls it provides. These implementation details remain unknown from this guide.

Evidence for this report

selected-page.htmlselected · checked 2026-11-14