{"record":{"id":"dc34df6a30e63b8f","repo":"BerriAI/litellm","slug":"no-versions-found-for-prompt-id-base-prompt-id","errorCode":null,"errorMessage":"No versions found for prompt ID {base_prompt_id}","messagePattern":"No versions found for prompt ID (.+?)","errorType":"http","errorClass":"HTTPException","httpStatus":404,"severity":"error","filePath":"litellm/proxy/prompts/prompt_endpoints.py","lineNumber":539,"sourceCode":"        ]\n        for prompt in prompt_versions:\n            version_number = get_version_number(prompt_id=prompt.prompt_id)\n            versioned_prompts.append(\n                PromptSpec(\n                    prompt_id=base_prompt_id,\n                    litellm_params=prompt.litellm_params,\n                    prompt_info=prompt.prompt_info,\n                    created_at=prompt.created_at,\n                    updated_at=prompt.updated_at,\n                    version=version_number,\n                    environment=prompt.environment,\n                    created_by=prompt.created_by,\n                )\n            )\n        versioned_prompts.sort(key=lambda p: p.version or 1, reverse=True)\n\n    if not versioned_prompts:\n        raise HTTPException(status_code=404, detail=f\"No versions found for prompt ID {base_prompt_id}\")\n\n    return ListPromptsResponse(prompts=versioned_prompts)\n\n\ndef _get_prompt_template(prompt_spec: PromptSpec, base_prompt_id: str) -> PromptTemplateBase | None:\n    \"\"\"Resolve the raw prompt template from dotprompt content or the in-memory registry.\"\"\"\n    from litellm.proxy.prompts.prompt_registry import IN_MEMORY_PROMPT_REGISTRY\n\n    try:\n        dotprompt_content: Final = prompt_spec.litellm_params.dotprompt_content\n        if dotprompt_content:\n            from litellm.integrations.dotprompt import (\n                _get_prompt_data_from_dotprompt_content,\n            )\n\n            parsed: Final = _get_prompt_data_from_dotprompt_content(dotprompt_content)\n            if parsed:\n                return PromptTemplateBase(","sourceCodeStart":521,"sourceCodeEnd":557,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/proxy/prompts/prompt_endpoints.py#L521-L557","documentation":"After querying the prompt table for all versions of base_prompt_id, no rows came back — the prompt has no stored versions (wrong ID, or the prompt only exists under a different base ID); returned as a 404 from the versions endpoint.","triggerScenarios":"Thrown at litellm/proxy/prompts/prompt_endpoints.py:539 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Create a version of the prompt first; verify the base prompt ID via the prompts list endpoint."],"exampleFix":null,"handlingStrategy":"type-guard","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8","analyzedAt":"2026-08-18T11:44:31.656Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}