{"record":{"id":"e19a19132735622d","repo":"BerriAI/litellm","slug":"custom-prompt-management-does-not-support-compile","errorCode":null,"errorMessage":"Custom prompt management does not support compile prompt helper","messagePattern":"Custom prompt management does not support compile prompt helper","errorType":"exception","errorClass":"NotImplementedError","httpStatus":null,"severity":"error","filePath":"litellm/integrations/custom_prompt_management.py","lineNumber":64,"sourceCode":"\n    def should_run_prompt_management(\n        self,\n        prompt_id: str | None,\n        prompt_spec: PromptSpec | None,\n        dynamic_callback_params: StandardCallbackDynamicParams,\n    ) -> bool:\n        return True\n\n    def _compile_prompt_helper(\n        self,\n        prompt_id: str | None,\n        prompt_spec: PromptSpec | None,\n        prompt_variables: dict | None,\n        dynamic_callback_params: StandardCallbackDynamicParams,\n        prompt_label: str | None = None,\n        prompt_version: int | None = None,\n    ) -> PromptManagementClient:\n        raise NotImplementedError(\"Custom prompt management does not support compile prompt helper\")\n\n    async def async_compile_prompt_helper(\n        self,\n        prompt_id: str | None,\n        prompt_variables: dict | None,\n        dynamic_callback_params: StandardCallbackDynamicParams,\n        prompt_spec: PromptSpec | None = None,\n        prompt_label: str | None = None,\n        prompt_version: int | None = None,\n    ) -> PromptManagementClient:\n        raise NotImplementedError(\"Custom prompt management does not support async compile prompt helper\")\n","sourceCodeStart":46,"sourceCodeEnd":76,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/integrations/custom_prompt_management.py#L46-L76","documentation":"CustomPromptManagement ships _compile_prompt_helper as a NotImplementedError stub: synchronous prompt compilation is only meaningful for concrete integrations that know their backend. Calling it on the base class or on a subclass that does not override it raises immediately with this message.","triggerScenarios":"Calling handler._compile_prompt_helper(prompt_id, ...) on a CustomPromptManagement subclass that only implements get_prompt; generic orchestration code probing the sync helper unconditionally on arbitrary prompt managers.","commonSituations":"Building pluggable prompt-management abstractions over CustomPromptManagement; porting a read-only prompt integration that never compiled prompts; test harnesses iterating all helper methods.","solutions":["Use the async path (async_compile_prompt_helper) if the subclass implements it, or the higher-level prompt-management entry points","Override _compile_prompt_helper in your subclass to build and return the PromptManagementClient","Gate calls on whether the subclass actually overrides the method before invoking"],"exampleFix":"# before\nclass MyPrompts(CustomPromptManagement):\n    def get_prompt(self, *a, **k): ...\nmanager._compile_prompt_helper(...)  # NotImplementedError\n\n# after\nclass MyPrompts(CustomPromptManagement):\n    def _compile_prompt_helper(self, prompt_id, prompt_spec, prompt_variables, dynamic_callback_params, **k):\n        return PromptManagementClient(prompt=compile(prompt_id, prompt_variables))","handlingStrategy":"type-guard","validationCode":"from litellm.integrations.custom_prompt_management import CustomPromptManagement\n\nif type(manager)._compile_prompt_helper is CustomPromptManagement._compile_prompt_helper:\n    raise NotImplementedError(f'{type(manager).__name__} does not implement sync prompt compilation')","typeGuard":"from litellm.integrations.custom_prompt_management import CustomPromptManagement\n\ndef implements_sync_compile(manager) -> bool:\n    return type(manager)._compile_prompt_helper is not CustomPromptManagement._compile_prompt_helper","tryCatchPattern":"except NotImplementedError as e:\n    if 'compile prompt helper' in str(e):\n        fall back to async_compile_prompt_helper or the subclass's own compile API\n    raise","preventionTips":["Document capability per prompt-manager subclass and check it before generic dispatch","Prefer the async API as the default integration path","Cover capability probes in subclass unit tests"],"tags":["notimplementederror","prompt-management","subclass-contract","litellm"],"backgroundTag":"abstract-method-not-implemented","analyzedSha":"77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8","analyzedAt":"2026-08-18T11:44:31.656Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}