litellm - ✅(Solved) Fix [Bug]: Prompt Studio fails to load prompts saved via UI — dotprompt_content null after UI save, only prompt_data.content populated [2 pull requests, 2 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
BerriAI/litellm#23935Fetched 2026-04-08 00:53:46
View on GitHub
Comments
2
Participants
2
Timeline
8
Reactions
0
Timeline (top)
commented ×2cross-referenced ×2labeled ×2referenced ×2

Error Message

Browser console (debug level): Error parsing existing prompt: Error: No dotprompt_content found in API response at 853e5f250e7a0af5.js:167

Root Cause

Root cause: The Prompt Studio save path writes prompt content to litellm_params.prompt_data.content (body only, no YAML frontmatter) and sets litellm_params.dotprompt_content = null. But the Prompt Studio load path (853e5f250e7a0af5.js, line 167) only reads from litellm_params.dotprompt_content:

Fix Action

Fixed

PR fix notes

PR #23968: fix(prompt_studio): fall back to dotprompt_content from DB when Prompt Studio editor loads

Description (problem / solution / changelog)

Summary

Fixes #23935

When prompts are saved via the Prompt Studio UI or PUT /prompts/{id}, the content is stored in litellm_params.dotprompt_content (and sometimes prompt_data.content). However, the GET /prompts/{id}/info endpoint only read content from the in-memory prompt callback, which is only populated for file-based dotprompt — not for UI-saved prompts.

Result: the Prompt Studio editor always opened blank after saving via the UI.

Changes

Added a fallback in get_prompt_info(): after checking the callback, read litellm_params.dotprompt_content and prompt_data.content from the stored PromptSpec to populate raw_prompt_template when the callback did not yield content.

Testing

  1. Open Prompt Studio
  2. Create and save a prompt via the UI
  3. Reopen the prompt — editor now shows the saved content instead of being blank

Changed files

  • litellm/proxy/prompts/prompt_endpoints.py (modified, +19/-0)

PR #23972: fix(prompts): Prompt Studio fails to load prompts saved via UI

Description (problem / solution / changelog)

Issue

Prompt Studio fails to load any prompt that was saved via the Prompt Studio UI "Update" button or the PUT /prompts/{id} API using prompt_data. The editor opens blank with a generic "New prompt" placeholder instead of the actual prompt content.

Root cause: The Prompt Studio save path writes prompt content to litellm_params.prompt_data.content (body only, no YAML frontmatter) and sets litellm_params.dotprompt_content = null. But the Prompt Studio load path only reads from litellm_params.dotprompt_content:

let t = e?.prompt_spec?.litellm_params?.dotprompt_content || "";
if (!t) throw Error("No dotprompt_content found in API response");

When dotprompt_content is null, it throws and silently falls back to a blank editor. The prompt data is actually persisted correctly in prompt_data.content — it's just never read back.

Fix

Modified parseExistingPrompt to:

  1. First try to parse dotprompt_content (existing behavior)
  2. If not available, fall back to parsing prompt_data with both direct and nested formats
  3. Updated error message to mention both data sources

Changes

  • Modified parseExistingPrompt in utils.ts to check for prompt_data as fallback
  • Added parsePromptData helper function to handle both direct {content, metadata} and nested {prompt_id: {content, metadata}} formats
  • Added comprehensive tests for prompt_data parsing scenarios

Testing

All 37 tests pass, including 6 new tests for prompt_data fallback:

  • Parsing prompt_data with direct format
  • Parsing prompt_data with nested format
  • Preferring dotprompt_content over prompt_data
  • Parsing developer messages from prompt_data
  • Parsing tools from prompt_data
  • Default values for empty prompt_data

Fixes #23935

Changed files

  • ui/litellm-dashboard/src/components/prompts/prompt_editor_view/utils.test.ts (modified, +138/-1)
  • ui/litellm-dashboard/src/components/prompts/prompt_editor_view/utils.ts (modified, +78/-2)

Code Example

let t = e?.prompt_spec?.litellm_params?.dotprompt_content || "";
if (!t) throw Error("No dotprompt_content found in API response");

---

Browser console (debug level):
Error parsing existing prompt: Error: No dotprompt_content found in API response
    at 853e5f250e7a0af5.js:167
RAW_BUFFERClick to expand / collapse

Check for existing issues

  • I have searched the existing issues and checked that my issue is not a duplicate.

What happened?

Prompt Studio fails to load any prompt that was saved via the Prompt Studio UI "Update" button or the PUT /prompts/{id} API using prompt_data. The editor opens blank with a generic "New prompt" placeholder instead of the actual prompt content.

Root cause: The Prompt Studio save path writes prompt content to litellm_params.prompt_data.content (body only, no YAML frontmatter) and sets litellm_params.dotprompt_content = null. But the Prompt Studio load path (853e5f250e7a0af5.js, line 167) only reads from litellm_params.dotprompt_content:

let t = e?.prompt_spec?.litellm_params?.dotprompt_content || "";
if (!t) throw Error("No dotprompt_content found in API response");

When dotprompt_content is null, it throws and silently falls back to a blank editor. The prompt data is actually persisted correctly in prompt_data.content — it's just never read back.

Steps to Reproduce

Create a prompt by uploading a .prompt file via the UI "Upload .prompt File" button (this correctly populates dotprompt_content). Confirm Prompt Studio loads it — it works. Open the prompt in Prompt Studio, make any edit (or no edit), and click "Update" to save. Close Prompt Studio and re-open the same prompt in Prompt Studio. Result: Prompt Studio shows a blank "New prompt" editor instead of the saved content. The browser console logs: Error parsing existing prompt: Error: No dotprompt_content found in API response.

Relevant log output

Browser console (debug level):
Error parsing existing prompt: Error: No dotprompt_content found in API response
    at 853e5f250e7a0af5.js:167

What part of LiteLLM is this about?

Proxy

What LiteLLM version are you on ?

v1.82.1

Twitter / LinkedIn details

No response

extent analysis

Fix Plan

To fix the issue, we need to modify the Prompt Studio load path to read from litellm_params.prompt_data.content when litellm_params.dotprompt_content is null. Here are the steps:

  • Update the 853e5f250e7a0af5.js file, line 167, to read from prompt_data.content when dotprompt_content is null:
let t = e?.prompt_spec?.litellm_params?.dotprompt_content || e?.prompt_spec?.litellm_params?.prompt_data?.content || "";
if (!t) throw Error("No prompt content found in API response");
  • Alternatively, update the save path to populate dotprompt_content when saving a prompt:
litellm_params.dotprompt_content = litellm_params.prompt_data.content;

Verification

To verify the fix, follow these steps:

  • Save a prompt using the "Update" button or the PUT /prompts/{id} API.
  • Close and re-open the prompt in Prompt Studio.
  • The prompt content should be loaded correctly, and the editor should not be blank.

Extra Tips

  • Make sure to update the relevant code files and redeploy the changes to the production environment.
  • Test the fix thoroughly to ensure that it resolves the issue and does not introduce any new bugs.
  • Consider adding a check to ensure that prompt_data.content is not null or empty before attempting to load the prompt.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

litellm - ✅(Solved) Fix [Bug]: Prompt Studio fails to load prompts saved via UI — dotprompt_content null after UI save, only prompt_data.content populated [2 pull requests, 2 comments, 2 participants]