{"record":{"id":"ff3ece6dd3f2d27a","repo":"BerriAI/litellm","slug":"prompt-version-prompt-version-id-not-found","errorCode":null,"errorMessage":"Prompt version '{prompt_version_id}' not found","messagePattern":"Prompt version '(.+?)' not found","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"litellm/integrations/arize/arize_phoenix_prompt_manager.py","lineNumber":106,"sourceCode":"            comment_start_string=\"{#\",\n            comment_end_string=\"#}\",\n        )\n\n        # Load prompt from Arize Phoenix if prompt_id is provided\n        if self.prompt_id:\n            self._load_prompt_from_arize(self.prompt_id)\n\n    def _load_prompt_from_arize(self, prompt_version_id: str) -> None:\n        \"\"\"Load a specific prompt version from Arize Phoenix.\"\"\"\n        try:\n            # Fetch the prompt version from Arize Phoenix\n            prompt_data: Final = self.arize_client.get_prompt_version(prompt_version_id)\n\n            if prompt_data:\n                template: Final = self._parse_prompt_data(prompt_data, prompt_version_id)\n                self.prompts[prompt_version_id] = template\n            else:\n                raise ValueError(f\"Prompt version '{prompt_version_id}' not found\")\n        except Exception as e:\n            raise Exception(f\"Failed to load prompt version '{prompt_version_id}' from Arize Phoenix: {e}\")\n\n    def _parse_prompt_data(self, data: dict[str, Any], prompt_version_id: str) -> ArizePhoenixPromptTemplate:\n        \"\"\"Parse Arize Phoenix prompt data and extract messages and metadata.\"\"\"\n        template_data: Final = data.get(\"template\", {})\n        messages: Final = template_data.get(\"messages\", [])\n\n        # Extract invocation parameters\n        invocation_params: Final = data.get(\"invocation_parameters\", {})\n        provider_params = {}\n\n        # Extract provider-specific parameters\n        if \"openai\" in invocation_params:\n            provider_params = invocation_params[\"openai\"]\n        elif \"anthropic\" in invocation_params:\n            provider_params = invocation_params[\"anthropic\"]\n        else:","sourceCodeStart":88,"sourceCodeEnd":124,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/integrations/arize/arize_phoenix_prompt_manager.py#L88-L124","documentation":"Inside _load_prompt_from_arize, if the client successfully fetched a response but it contained no prompt data (the 404 branch of get_prompt_version returns None), the manager raises ValueError('Prompt version … not found'). It distinguishes 'asked Phoenix, got nothing' from transport/auth failures, which take the other branches.","triggerScenarios":"Loading a prompt_id/prompt_version_id that does not exist in the target Phoenix workspace — wrong ID, deleted prompt, or an ID copied from another environment (dev ID used against prod). Also when Phoenix returns an envelope whose 'data' is null/empty.","commonSituations":"Environment mismatch (test prompt IDs against prod Phoenix); prompt deleted or recreated with a new version ID after a config was written; base64-style IDs truncated in copy-paste.","solutions":["Open the prompt in the Phoenix UI and copy the exact current prompt/version ID into prompt_id","Confirm you are pointing at the same Phoenix instance/workspace the prompt lives in (check api_base)","If the prompt was recreated, update your litellm model config to the new identifier"],"exampleFix":"# before\nlitellm_params:\n  model: openai/gpt-4o\n  prompt_id: UHJvbXB0OjE  # deleted in Phoenix -> not found\n\n# after\nlitellm_params:\n  model: openai/gpt-4o\n  prompt_id: UHJvbXB0OjI  # current ID from Phoenix UI","handlingStrategy":"validation","validationCode":"import httpx, os\n\nresp = httpx.get(\n    f\"{api_base}/prompt_versions/{prompt_version_id}\",\n    headers={\"Authorization\": f\"Bearer {os.environ['PHOENIX_API_KEY']}\"},\n    timeout=5,\n)\nif resp.status_code == 404:\n    raise SystemExit(f\"prompt version {prompt_version_id} does not exist in this Phoenix workspace\")","typeGuard":null,"tryCatchPattern":"try:\n    manager.compile(prompt_id=prompt_id, prompt_variables=vars)\nexcept Exception as e:\n    if \"not found\" in str(e):\n        raise SystemExit(f\"prompt {prompt_id} missing in Phoenix — verify ID and workspace, then update config\") from e\n    raise","preventionTips":["Pin prompt IDs in config and re-verify them in CI against the target Phoenix workspace","Keep separate config files per environment so dev prompt IDs never point at prod Phoenix"],"tags":["arize-phoenix","prompts","not-found","http-404","configuration"],"backgroundTag":"resource-not-found","analyzedSha":"77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8","analyzedAt":"2026-08-18T11:44:31.656Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}