{"record":{"id":"6fb665a8ac6ad04c","repo":"BerriAI/litellm","slug":"prompt-id-is-required-for-arize-phoenix-prompt-man","errorCode":null,"errorMessage":"prompt_id is required for Arize Phoenix prompt manager","messagePattern":"prompt_id is required for Arize Phoenix prompt manager","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"litellm/integrations/arize/arize_phoenix_prompt_manager.py","lineNumber":386,"sourceCode":"        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        \"\"\"\n        Compile an Arize Phoenix prompt template into a PromptManagementClient structure.\n\n        This method:\n        1. Loads the prompt version from Arize Phoenix\n        2. Renders it with the provided variables\n        3. Returns formatted chat messages\n        4. Extracts model and optional parameters from metadata\n        \"\"\"\n        if prompt_id is None:\n            raise ValueError(\"prompt_id is required for Arize Phoenix prompt manager\")\n        try:\n            # Load the prompt from Arize Phoenix if not already loaded\n            if prompt_id not in self.prompt_manager.prompts:\n                self.prompt_manager._load_prompt_from_arize(prompt_id)\n\n            # Get the rendered messages and metadata\n            rendered_messages, prompt_metadata = self.get_prompt_template(prompt_id, prompt_variables)\n\n            # Extract model from metadata (if specified)\n            template_model: Final = prompt_metadata.get(\"model\")\n\n            # Extract optional parameters from metadata\n            optional_params: Final = {}\n            for param in [\n                \"temperature\",\n                \"max_tokens\",\n                \"top_p\",\n                \"frequency_penalty\",","sourceCodeStart":368,"sourceCodeEnd":404,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/integrations/arize/arize_phoenix_prompt_manager.py#L368-L404","documentation":"The compile() method of the Arize Phoenix prompt manager turns a stored Phoenix prompt into chat messages plus model parameters. It takes prompt_id as its identifier; because there is no default or ambient prompt context, prompt_id=None fails fast with this ValueError before any Phoenix call is made. The upstream prompt_initializer in litellm/integrations/arize/__init__.py reads prompt_id from litellm_params, so None usually means it was omitted there.","triggerScenarios":"Routing a request to the Arize Phoenix prompt integration without `prompt_id` in the model's litellm_params, or calling manager.compile(None, ...) directly. Raised immediately, before the load/render steps.","commonSituations":"Configuring the model for Phoenix prompts but forgetting the prompt_id field (only api_key/api_base set); renaming the field (e.g. promptId) so litellm_params.prompt_id stays None; assuming the prompt is chosen by model_name.","solutions":["Add `prompt_id: <your-phoenix-prompt-id>` to the model's litellm_params in your config","Check for the exact field name `prompt_id` (snake_case) — other spellings are ignored","Confirm the ID contains no path characters, since it will pass through _sanitize_id next"],"exampleFix":"# before\nlitellm_params:\n  model: openai/gpt-4o\n  api_base: https://app.phoenix.arize.com/s/workspace/v1\n  api_key: os.environ/PHOENIX_API_KEY\n  # prompt_id missing -> ValueError on compile\n\n# after\nlitellm_params:\n  model: openai/gpt-4o\n  api_base: https://app.phoenix.arize.com/s/workspace/v1\n  api_key: os.environ/PHOENIX_API_KEY\n  prompt_id: UHJvbXB0OjE","handlingStrategy":"validation","validationCode":"litellm_params = {\n    \"model\": \"openai/gpt-4o\",\n    \"api_key\": os.environ[\"PHOENIX_API_KEY\"],\n    \"api_base\": \"http://localhost:6006\",\n}\nif not litellm_params.get(\"prompt_id\"):\n    raise SystemExit(\"prompt_id is required for Arize Phoenix prompt models\")","typeGuard":"def has_prompt_id(params: dict) -> bool:\n    return isinstance(params.get(\"prompt_id\"), str) and bool(params[\"prompt_id\"].strip())","tryCatchPattern":"try:\n    manager.compile(prompt_id=params.get(\"prompt_id\"), prompt_variables=vars)\nexcept ValueError as e:\n    if \"prompt_id is required\" in str(e):\n        raise SystemExit(\"Add prompt_id (the Phoenix prompt/version ID) to this model's litellm_params\") from e\n    raise","preventionTips":["Schema-validate prompt model entries: model + prompt_id + api_key + api_base are all mandatory","Use the exact snake_case field name prompt_id — variants are silently ignored and left as None"],"tags":["arize-phoenix","prompts","missing-parameter","configuration"],"backgroundTag":"missing-required-config","analyzedSha":"77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8","analyzedAt":"2026-08-18T11:44:31.656Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}