{"record":{"id":"97e7af33b347279d","repo":"zylon-ai/private-gpt","slug":"openai-like-responses-llm-dependencies-are-not-ins","errorCode":null,"errorMessage":"OpenAI-like Responses LLM dependencies are not installed. Install with `uv sync --inexact --extra llm-openai-compatible`.","messagePattern":"OpenAI-like Responses LLM dependencies are not installed\\. Install with `uv sync --inexact --extra llm-openai-compatible`\\.","errorType":"exception","errorClass":"ImportError","httpStatus":null,"severity":"error","filePath":"private_gpt/components/llm/custom/openailikeresponses.py","lineNumber":23,"sourceCode":"    from llama_index.llms.openai_like import (  # type: ignore[import-not-found,import-untyped]  # ty:ignore[unresolved-import]\n        OpenAILikeResponses as OpenAILikeResponsesBase,\n    )\n\n    from private_gpt.components.llm.custom.openairesponses import (\n        PatchedOpenAIResponsesLLM,\n    )\n\n\ndef _load_openai_like_responses_base() -> type[Any]:\n    try:\n        return cast(\n            type[Any],\n            importlib.import_module(\"llama_index.llms.openai_like\").OpenAILikeResponses,\n        )\n    except (ImportError, AttributeError) as e:\n        from private_gpt.utils.dependencies import format_missing_dependency_message\n\n        raise ImportError(\n            format_missing_dependency_message(\n                \"OpenAI-like Responses LLM\",\n                extras=\"llm-openai-compatible\",\n            )\n        ) from e\n\n\ndef _load_patched_openai_responses() -> type[Any]:\n    from private_gpt.components.llm.custom.openairesponses import (\n        PatchedOpenAIResponsesLLM,\n    )\n\n    return PatchedOpenAIResponsesLLM\n\n\nif not TYPE_CHECKING:\n    OpenAILikeResponsesBase = _load_openai_like_responses_base()\n    PatchedOpenAIResponsesLLM = _load_patched_openai_responses()","sourceCodeStart":5,"sourceCodeEnd":41,"githubUrl":"https://github.com/zylon-ai/private-gpt/blob/4a030776a31a901ad80b1bf4d7faa2c1a367efbb/private_gpt/components/llm/custom/openailikeresponses.py#L5-L41","documentation":"ImportError raised lazily by _load_openai_like_responses_base when importing llama_index.llms.openai_like fails or lacks the OpenAILikeResponses attribute. The message tells you exactly which optional extra to install (llm-openai-compatible). Raised at class-definition time via _load_patched_openai_responses usage paths.","triggerScenarios":"Selecting/configuring the OpenAI-like Responses LLM backend while the llama-index openai-like integration package is not installed — e.g. profile set to openai_like_responses without the extra, or a deployment installed with a trimmed dependency set.","commonSituations":"Custom docker images built with only some LLM extras; upgrading/downgrading llama-index breaking the integration module; typos in profiles that fall back to this backend.","solutions":["Install the extra exactly as the message says: uv sync --inexact --extra llm-openai-compatible.","Verify the import works in the same environment: python -c \"import llama_index.llms.openai_like; print(llama_index.llms.openai_like.OpenAILikeResponses)\".","If the attribute is missing rather than the module (AttributeError path), pin llama-index to the version this project expects.","Rebuild the deployment image after adding the extra."],"exampleFix":"# before\nuv sync --inexact\n\n# after\nuv sync --inexact --extra llm-openai-compatible","handlingStrategy":"try-catch","validationCode":"def openai_like_responses_available() -> bool:\n    try:\n        import llama_index.llms.openai_like  # noqa: F401\n        return hasattr(llama_index.llms.openai_like, 'OpenAILikeResponses')\n    except ImportError:\n        return False","typeGuard":null,"tryCatchPattern":"try:\n    from private_gpt.components.llm.custom.openailikeresponses import OpenAILikeResponsesLLM\nexcept ImportError as e:\n    if 'llm-openai-compatible' in str(e):\n        raise RuntimeError('run: uv sync --inexact --extra llm-openai-compatible') from e","preventionTips":["Install extras per configured LLM profile at image build time, not at runtime.","Guard optional-backend imports behind availability checks so unrelated code paths don't crash."],"tags":["llm","openai","dependencies","installation"],"backgroundTag":null,"analyzedSha":"4a030776a31a901ad80b1bf4d7faa2c1a367efbb","analyzedAt":"2026-08-15T03:51:26.951Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}