Draft Mode
Simplify version control with LangDB Virtual Models’ draft mode—safely iterate, preview, and publish model versions without impacting live traffic.
LangDB’s Virtual Models support a draft mode that streamlines version management and ensures safe, iterative changes. In draft mode, modifications are isolated from the published version until you explicitly publish, giving you confidence that live traffic is unaffected by in-progress edits.
Version Workflow
Edit in Draft
Making any change (e.g., adjusting parameters, adding guardrails, modifying messages) flips the version into a Modified draft.
Save Draft
Click Save to record your changes. The draft is saved as a new version at the top of the version list, without affecting the live version.
Live API traffic remains pointed at the last published version.
Publish Draft
Once validated, click Publish:
Saves the version as the new latest version.
Directs all live chat completion traffic to this version.
Keeps the previous published version visible in the list so you can reselect and republish if needed.
Restore & Edit Previous Version
Open the version dropdown and select any listed version.
The selected version loads into the editor.
You can further modify this draft and click Save to create a new version entry.
Re-Publish Any Version
To make any saved version live, select it from the dropdown and click Publish.
API Behavior
All chatCompletions
requests to a Virtual Model endpoint automatically target the latest published version. Drafts and restored drafts never receive live traffic until published.
from openai import OpenAI
client = OpenAI(
base_url="https://api.us-east-1.langdb.ai",
api_key=api_key,
)
# Always hits current published version
response = client.chat.completions.create(
model="openai/langdb/my-virtual-model@latest",
messages=[...],
)
To preview changes in a draft or restored draft, switch the UI or JSON view selector to that draft and experiment in the Virtual Model Editor — all without impacting production calls.
Best Practices
Iterate Safely: Leverage drafts for experimental guardrails or parameter tuning without risking production stability.
Frequent Publishing: Keep version history granular—publish stable drafts regularly to simplify tracking and rollbacks.
Use Restore Thoughtfully: Before restoring, ensure any important unsaved draft work is committed or intentionally discarded.
Last updated
Was this helpful?