{"record":{"id":"a228100b54875d8e","repo":"BerriAI/litellm","slug":"litellm-params-cannot-be-none","errorCode":null,"errorMessage":"litellm_params cannot be None","messagePattern":"litellm_params cannot be None","errorType":"http","errorClass":"HTTPException","httpStatus":400,"severity":"error","filePath":"litellm/proxy/prompts/prompt_endpoints.py","lineNumber":1144,"sourceCode":"        # Use existing prompt from memory or build from DB row for field merging\n        if existing_prompt:\n            current_litellm_params = existing_prompt.litellm_params\n            current_prompt_info = existing_prompt.prompt_info\n        else:\n            current_spec: Final = create_versioned_prompt_spec(db_prompt=target_row)\n            current_litellm_params = current_spec.litellm_params\n            current_prompt_info = current_spec.prompt_info\n\n        # Update fields if provided\n        updated_litellm_params: Final = (\n            request.litellm_params if request.litellm_params is not None else current_litellm_params\n        )\n\n        updated_prompt_info: Final = request.prompt_info if request.prompt_info is not None else current_prompt_info\n\n        # Ensure we have valid litellm_params\n        if updated_litellm_params is None:\n            raise HTTPException(status_code=400, detail=\"litellm_params cannot be None\")\n\n        # Build update data dict\n        update_data: Final[dict[str, str]] = {\n            \"litellm_params\": updated_litellm_params.model_dump_json(),\n            \"prompt_info\": updated_prompt_info.model_dump_json(),\n        }\n        if user_api_key_dict.user_id:\n            update_data[\"created_by\"] = user_api_key_dict.user_id\n\n        # Update by primary key (id) to target exactly one row\n        updated_prompt_db_entry: Final = await _prompt_table(prisma_client).update(\n            where={\"id\": target_row.id},\n            data=update_data,\n        )\n\n        updated_prompt_spec: Final = create_versioned_prompt_spec(db_prompt=updated_prompt_db_entry)\n\n        return _reload_prompt_in_registry(IN_MEMORY_PROMPT_REGISTRY, versioned_id, updated_prompt_spec)","sourceCodeStart":1126,"sourceCodeEnd":1162,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/proxy/prompts/prompt_endpoints.py#L1126-L1162","documentation":"Merge guard during prompt patching: after merging the request's litellm_params with the existing prompt's params the result is None, meaning no usable litellm_params exist to build the updated prompt spec; the merge is aborted before any write.","triggerScenarios":"Thrown at litellm/proxy/prompts/prompt_endpoints.py:1144 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Provide a non-null litellm_params object in the prompt request payload."],"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"}