Conversation Playground
Insert user or assistant messages, edit turns without triggering model generation, and delete individual messages directly in a conversation.
Conversation Playground lets a conversation owner edit a thread's history directly without triggering model generation. While playground mode is active, you can insert user or assistant messages after any eligible turn, edit existing messages in place, and delete turns from the message action row before returning to normal chat.
Use playground mode when you want to shape a multi-turn conversation, supply synthetic user or assistant turns, or adjust earlier replies before continuing with the model. Each conversation opens with playground mode off.
Enable playground mode
Playground mode is opt-in and off by default. Turn it on in librechat.yaml under interface.playground:
interface:
playground: true
messages:
playgroundRepairBatchSize: 32| Key | Type | Accepted values | Default | Purpose |
|---|---|---|---|---|
interface.playground | Boolean | true, false | false | Enables conversation playground mode across the deployment. |
messages.playgroundRepairBatchSize | Integer | 1 to 1000 | 32 | Maximum pending playground operations and orphaned staging records visited per 30-second recovery batch. |
There are no dedicated playground environment variables and no dedicated playground role permission. Unlike permission-seeding fields under interface, interface.playground is a deployment-level switch. When it is false or omitted, the playground UI is hidden and both playground routes (GET and POST /api/messages/playground/:conversationId) return 404 before loading conversation history.
Permissions and authorization
- Ownership: Only the authenticated owner of a conversation can check playground eligibility or insert messages into it.
- Edits, deletes and content filters: Editing and deleting messages in playground mode use LibreChat's standard message edit and delete endpoints and permissions. Inserted text is checked against any configured content filters (
filters). - Inserted assistant identity: When you insert an Assistant message, its endpoint, model or agent, sender name, and icon come from the selection currently active in the chat header and are authorized on the server:
- When an Agent is selected, you must have the
AGENTSUSEpermission andVIEWaccess to that agent. - When
modelSpecs.enforceis enabled or a model spec is selected, the selection must match a configured model spec and its endpoint and model. - On standard endpoints without
userProvide, the selected model must exist in the endpoint's model catalog. - Assistants endpoints are not accepted.
- When an Agent is selected, you must have the
When playground mode is available
Playground mode is only offered on an existing saved conversation (not on a new empty chat or search view). It is unavailable in these cases:
- Read-only conversations, including subagent threads.
- Conversations using the Assistants endpoint, or conversations that contain Assistants messages.
- Agent event actor conversations that have a saved checkpoint, summary, or an active, pending, or claimed suspension.
- Conversations with a response currently generating or a message deletion in progress (the option is temporarily disabled and offers Retry once the conversation is idle).
- Turns already covered by a saved compaction summary cannot have new messages inserted after them. Messages after the summary remain eligible.
Enter and leave playground mode
- Open an eligible conversation and select the conversation options menu (
...) in the chat header. - Choose Playground mode. The menu item is disabled while a response is still generating.
While playground mode is active, a removable Playground mode chip appears above the chat composer (sharing the composer header area with the selected-agent chip if one is active). The composer input is paused with the placeholder "Edit or add messages above. Exit playground to chat.". Sending and dictation from the composer are suspended while playground mode is active, and any draft you already typed in the composer is preserved and restored when you exit.
To leave playground mode, click the close button (Exit playground) on the composer chip or toggle Playground mode off in the conversation header menu. If you have unsaved changes in an open insert card or inline message edit, LibreChat asks you to confirm (Discard unsaved changes? / Discard and exit) before exiting or navigating away.
Add, edit and remove messages
Add a message
Between turns, hovering over the space below an eligible message or moving keyboard focus to it reveals a small round + button (Add message). On touch devices without hover, the button remains visible at reduced opacity so you can tap it directly.
Selecting + opens an inline editor card in the conversation column:
- Role toggle: Switch between Assistant and User. The toggle defaults to the role opposite the message directly above it.
- Text field: An autosizing textarea that accepts non-empty trimmed text up to 16,000 characters.
- Actions and shortcuts: Choose Save or Cancel. Press Ctrl+Enter (Cmd+Enter) or Ctrl+S (Cmd+S) to save, and Escape to cancel.
Saving inserts the message directly after the chosen turn without starting model generation. Existing replies to the anchor message move under the newly inserted message so later turns stay connected, and the UI selects the new branch. To change a turn's role after inserting it, delete the turn and insert a new one with the desired role.
Only one insert card or inline message edit can be open at a time. While a draft is open, other add and edit controls and row deletion stay disabled until you save or cancel. If the message a draft was attached to is removed while you are writing, LibreChat re-anchors the draft to a surviving parent or neighboring message with a notice, or keeps your draft visible if no messages remain in the conversation.
Edit a message
Original and inserted messages share LibreChat's standard inline message editor (Edit in the message action row). While playground mode is active:
- Saving updates the stored message text only; Update & rerun and Rerun are withheld so edits do not start model generation.
- Removing attached files from a user message is disabled inside the editor.
Remove a message and the action row
While playground mode is active, every message's action row stays visible at all times (instead of appearing only on hover) and shows only Copy, Edit, and Delete message (when deletion is permitted for that message). Playground mode hides the message overflow menu (...), Read aloud, Regenerate, and Continue.
Putting Delete message directly in the row lets you remove turns without leaving playground mode. It uses the same confirmation dialog ("Delete this message? Later messages will stay in the conversation.") and reconnects later replies to the deleted turn's parent.
Outside playground mode, Delete message, Fork, ratings (Love this and Needs improvement), and turn usage live in the per-message overflow menu (...), where Fork, ratings, and turn usage open in side panels. See Message Actions.
How changes are saved and what readers see
Publication and concurrency
- Idempotency and optimistic concurrency: Each insertion carries a client-generated UUID (
requestId) and the conversation's currentmessageHistoryRevision. If the conversation changed while you were editing, the server returns409(playground_stale), refreshes the branch, and prompts you to review and try again. - Serialization: Playground writes take a 30-second conversation history lease, serializing with message deletion and shared-link updates. If a generation job or concurrent mutation is active, the server returns
409(conversation_busy). - Staged write flow: The server stages the turn in a private
playgroundStagingcollection (outsideconversations,messages, and Meilisearch), reserves the new message row and affected child edges under an operation token, snapshots affected existing shared links, pins expiration deadlines, and publishes the revision in one lease-checked update on the conversation document. It then materializes the message row, moves the reserved child edges to point to the new message, attaches the message to the conversation, releases the publication lock, and discards the staging record.
What concurrent readers see
History readers (conversation transcript GET /api/messages/:conversationId, branch link lookups, cursor pagination, and direct message lookups) hide partially materialized playground writes:
- Conversations never modified by playground take the ordinary read path with no extra publication checks. When
interface.playgroundis off, transcript reads also keep their parallel ownership check. - For conversations with playground history, readers check the conversation's
messageHistoryRevision,playgroundSequence, andplaygroundPublicationbefore and after loading message rows. If a committed publication is still materializing, the reader finishes materializing it before returning; if publication state changes mid-read, the reader retries up to three times before returning409(conversation_busy). - A read that overlaps publication returns either the complete previous revision or the complete new revision. Any read that starts after publication sees the new revision.
Tool, audio, resume, and fork readers, as well as readers on a deployment where interface.playground is turned off, rely on the background recovery worker to finish or clear an insertion interrupted by a server crash.
Shared links and retention
- Shared links: Existing shared links keep their original messages and parent structure. Before child edges move in the private conversation, the server pins the original parent links in
publicParentson each affected share so existing shared links do not show inserted turns unless the owner updates the share. Creating or updating a shared link while a playground publication is in progress is rejected with a retryable conflict. - Retention: Under
retentionMode: allorephemeral, inserted turns follow the conversation's temporary/expiration rules and cannot outlive an earlier parent message or conversation expiration deadline. Crash recovery reuses the staged deadline.
MongoDB behavior and operator notes
Standalone MongoDB and replica sets
Playground mode works on both standalone MongoDB and replica sets and does not require MongoDB multi-document transactions. Both deployments use the same single-document conditional writes and staged publication protocol.
Collections and indexes
- On the first playground write, LibreChat creates a
playgroundStagingcollection with a TTL index ondeadline(expireAfterSeconds: 0) and a sparse index oncheckAt. Unclaimed staging records expire automatically after the 30-second lease window (or sooner if the turn's retention deadline is earlier). - Conversation documents store hidden publication metadata (
playgroundSequence,playgroundPublication,playgroundReceipt) supported by sparse and partial indexes. Existing conversations, messages, and shared links require no database migration. - Staged text is kept out of Meilisearch until the inserted message row is materialized.
Background recovery and limitations
At startup, the server starts a bounded background recovery worker that runs every 30 seconds (the lease TTL) and visits up to messages.playgroundRepairBatchSize (default 32, range 1 to 1000) expired publications and orphaned staging records per tick:
- If a writer crashes after publishing a revision, recovery finishes materializing the message and moving child edges.
- If a writer crashes before publishing, recovery rolls back the reserved row and edges and expires the staging record.
- If a conversation is deleted while a staging record remains, recovery removes the orphan staging record and any unattached inserted row.
- Recovery continues running even after you disable
interface.playground, so writes interrupted before turning the feature off still settle.
Keep these operational limits in mind:
- Recovery latency after a crash: Readers that depend on background repair (tool, audio, resume, fork, or default-off readers after disabling
interface.playground) may not see a crashed write until the 30-second lease expires and the next recovery sweep completes (which can take multiple ticks if pending records exceedmessages.playgroundRepairBatchSize). - Lease store availability: Concurrent history writes coordinate across API replicas through MongoDB resource locks. If the lock store is unavailable, playground write requests return
503.
How is this guide?