DATE:
AUTHOR:
The LangChain Team
LangSmith SaaS

🏷️ Prompt tags in LangSmith for version control

DATE:
AUTHOR: The LangChain Team

We’re excited to introduce Prompt Tagging, a new feature in LangSmith that allows users to label individual commits with version tags (e.g., "dev", "staging", "v2") directly in the LangSmith UI. Users can then pull a prompt using the tag as a commit identifier in code.

This makes it easier to:

  • Update your code's referenced commit without code changes.

  • Have non-technical users manage prompt versions effortlessly.

  • Track iterations and share specific versions across teams.

Key features of Prompt Tags:

  • Tag management: Manage tags in the following ways:

    • Create a Tag: Tag commits in the prompt’s history via the commits tab.

    • Move a Tag: Reassign tags to different commits with a simple click.

    • Delete a Tag: Remove tags as needed without affecting the commits.

  • Stable references in Code:
    Use tags instead of commit hashes for a stable way to reference prompt versions. For example, you could pull a prompt by tag in Python like in the example below:

    prompt = client.pull_prompt("joke-generator:prod")
    
    # If prod tag points to commit a1b2c3d4, this is equivalent to:
    prompt = client.pull_prompt("joke-generator:a1b2c3d4")

    This will pull the prompt associated with the "staging" tag, allowing for easy updates as tags point to new commits.

Common use cases for prompt tagging:

  • Environment-Specific Tags: Mark versions for "prod" or "staging" to switch between different environments seamlessly.

  • Version Control: Use tags to denote stable versions (e.g., v1, v2) for easy tracking and reference.

  • Collaboration: Share tagged versions ready for review to facilitate feedback and collaboration.

Learn more in our docs: https://docs.smith.langchain.com/how_to_guides/prompts/prompt_tags

Powered by LaunchNotes