{"record":{"id":"bdf6efefecb13371","repo":"run-llama/llama_index","slug":"literal-ai-handler-is-not-installed-please-instal","errorCode":null,"errorMessage":"Literal AI Handler is not installed. Please install it using `pip install llama-index-callbacks-literalai`","messagePattern":"Literal AI Handler is not installed\\. Please install it using `pip install llama-index-callbacks-literalai`","errorType":"exception","errorClass":"ImportError","httpStatus":null,"severity":"error","filePath":"llama-index-core/llama_index/core/callbacks/global_handlers.py","lineNumber":130,"sourceCode":"        handler = langfuse_callback_handler(**eval_params)\n    elif eval_mode == \"agentops\":\n        try:\n            from llama_index.callbacks.agentops import (\n                AgentOpsHandler,\n            )  # pants: no-infer-dep\n        except ImportError:\n            raise ImportError(\n                \"AgentOpsHandler is not installed. \"\n                \"Please install it using `pip install llama-index-instrumentation-agentops`\"\n            )\n        AgentOpsHandler.init(**eval_params)\n    elif eval_mode == \"literalai\":\n        try:\n            from llama_index.callbacks.literalai import (\n                literalai_callback_handler,\n            )  # pants: no-infer-dep\n        except ImportError:\n            raise ImportError(\n                \"Literal AI Handler is not installed. \"\n                \"Please install it using `pip install llama-index-callbacks-literalai`\"\n            )\n        handler = literalai_callback_handler(**eval_params)\n    elif eval_mode == \"opik\":\n        try:\n            from llama_index.callbacks.opik import (\n                opik_callback_handler,\n            )  # pants: no-infer-dep\n        except ImportError:\n            raise ImportError(\n                \"Opik Handler is not installed. \"\n                \"Please install it using `pip install llama-index-callbacks-opik`\"\n            )\n        handler = opik_callback_handler(**eval_params)\n    else:\n        raise ValueError(f\"Eval mode {eval_mode} not supported.\")\n","sourceCodeStart":112,"sourceCodeEnd":148,"githubUrl":"https://github.com/run-llama/llama_index/blob/afd0fef371831f9bda13e5af7167cf4e981278ab/llama-index-core/llama_index/core/callbacks/global_handlers.py#L112-L148","documentation":"Raised by create_global_handler() when eval_mode is 'literalai' but llama-index-callbacks-literalai is not installed. The Literal AI (Langtail/Literal) tracing handler is an optional integration imported lazily; missing wheels surface as this ImportError.","triggerScenarios":"create_global_handler('literalai', ...) or set_global_handler('literalai') in an env without the wheel; `from llama_index.callbacks.literalai import literalai_callback_handler` fails.","commonSituations":"Enabling Literal AI tracing per their docs in an environment that only pinned llama-index-core; CI caches missing newer integration wheels.","solutions":["pip install llama-index-callbacks-literalai","Verify: python -c \"from llama_index.callbacks.literalai import literalai_callback_handler\"","Provide Literal API credentials if tracing proceeds","Unset the literalai eval mode if it was enabled by mistake"],"exampleFix":"# before\nset_global_handler('literalai')  # ImportError\n\n# after\n# pip install llama-index-callbacks-literalai\nset_global_handler('literalai')","handlingStrategy":"validation","validationCode":"import importlib.util\nif importlib.util.find_spec('llama_index.callbacks.literalai') is None:\n    raise SystemExit('pip install llama-index-callbacks-literalai')","typeGuard":null,"tryCatchPattern":"try:\n    handler = create_global_handler('literalai')\nexcept ImportError as e:\n    handler = None","preventionTips":["Mirror local and production dependency lists to catch missing extras","Version-pin all optional callback packages"],"tags":["llama-index","callbacks","import-error","optional-dependency","literalai"],"backgroundTag":null,"analyzedSha":"afd0fef371831f9bda13e5af7167cf4e981278ab","analyzedAt":"2026-08-15T05:42:58.429Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}