{"record":{"id":"0961fe3b848e01ae","repo":"zylon-ai/private-gpt","slug":"openai-responses-llm-dependencies-are-not-installe-0961fe","errorCode":null,"errorMessage":"OpenAI Responses LLM dependencies are not installed. Install with `uv sync --inexact --extra llm-openai`.","messagePattern":"OpenAI Responses LLM dependencies are not installed\\. Install with `uv sync --inexact --extra llm-openai`\\.","errorType":"exception","errorClass":"ImportError","httpStatus":null,"severity":"error","filePath":"private_gpt/components/llm/factories/responses/openailike.py","lineNumber":19,"sourceCode":"from typing import Any, cast\n\nfrom llama_index.core.llms import LLM\n\nfrom private_gpt.components.llm.factories.base import LLMFactory\nfrom private_gpt.components.llm.tokenizers.tokenizer_base import TokenizerBase\nfrom private_gpt.settings.settings import LLMModelConfig, Settings\nfrom private_gpt.utils.dependencies import format_missing_dependency_message\n\n\ndef _load_patched_openai_like_responses() -> type[Any]:\n    try:\n        from private_gpt.components.llm.custom.openailikeresponses import (\n            PatchedOpenAILikeResponsesLLM,\n        )\n\n        return PatchedOpenAILikeResponsesLLM\n    except ImportError as e:\n        raise ImportError(\n            format_missing_dependency_message(\n                \"OpenAI Responses LLM\",\n                extras=\"llm-openai\",\n            )\n        ) from e\n\n\nclass OpenAILikeResponsesFactory(LLMFactory):\n    \"\"\"Responses API factory for OpenAI-compatible endpoints (vLLM, Ollama, etc.).\"\"\"\n\n    def __init__(self, settings: Settings):\n        super().__init__(settings)\n        self.openai_settings = settings.openai\n\n    def _create_llm(\n        self, model_config: LLMModelConfig, tokenizer: TokenizerBase | None = None\n    ) -> tuple[LLM, str | None]:\n        PatchedOpenAILikeResponsesLLM = _load_patched_openai_like_responses()","sourceCodeStart":1,"sourceCodeEnd":37,"githubUrl":"https://github.com/zylon-ai/private-gpt/blob/4a030776a31a901ad80b1bf4d7faa2c1a367efbb/private_gpt/components/llm/factories/responses/openailike.py#L1-L37","documentation":"ImportError from the lazy loader in the OpenAI-like Responses factory: importing PatchedOpenAILikeResponsesLLM failed. Despite serving OpenAI-compatible endpoints (vLLM, Ollama), this factory's patched class depends on the 'llm-openai' extra, not llm-openai-compatible, because it builds on the OpenAI SDK's Responses implementation.","triggerScenarios":"Routing Responses-API traffic to an OpenAI-compatible endpoint without the llm-openai extra installed, or with an openai SDK lacking the classes the custom openailikeresponses module imports.","commonSituations":"Assuming the 'openai-like' route needs only the llm-openai-compatible extra; slim installs; older pinned openai SDK versions predating Responses support.","solutions":["Run `uv sync --inexact --extra llm-openai` (this Responses variant needs the openai extra even for like-endpoints).","Upgrade the openai package if the extra is present but old.","Alternatively route OpenAI-compatible endpoints through the completions factories with the llm-openai-compatible extra if you don't need the Responses API."],"exampleFix":"# before\nuv sync --inexact --extra llm-openai-compatible\n\n# after\nuv sync --inexact --extra llm-openai-compatible --extra llm-openai","handlingStrategy":"validation","validationCode":"def openai_extra_available() -> bool:\n    try:\n        import openai  # noqa: F401\n        return True\n    except ImportError:\n        return False","typeGuard":null,"tryCatchPattern":"try:\n    factory = OpenAILikeResponsesFactory(settings)\nexcept ImportError as e:\n    if 'llm-openai' in str(e):\n        raise SystemExit('Run: uv sync --inexact --extra llm-openai') from e\n    raise","preventionTips":["Remember the Responses-API 'like' factory needs the llm-openai extra, not llm-openai-compatible.","Codify mode-to-extra requirements in CI so mispaired installs fail the build.","Add a dependency audit step to Docker builds that imports every configured factory."],"tags":["dependencies","responses-api","openai-compatible","import-error"],"backgroundTag":null,"analyzedSha":"4a030776a31a901ad80b1bf4d7faa2c1a367efbb","analyzedAt":"2026-08-15T03:51:26.951Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}