The Prompt Registry helps get your LLM app ready for production. It allows you to easily manage your prompt templates, which are customizable prompt strings with placeholders for variables.
Specifically, a prompt template is your prompt string with variables indicated in curly brackets (This is a prompt by {author_name}
). Prompt templates can have tags and are uniquely named.
You can use this tool to programmatically retrieve and publish prompts (even at runtime!). That is, this registry makes it easy to start A/B testing your prompts. Viewed as a “Prompt Management System”, this registry allows your org to pull out and organize the prompts that are currently dispersed throughout your codebase.
PromptLayer is built to support the LangChain PromptTemplate schema standard. Learn more on LangChain’s docs: https://langchain.readthedocs.io/en/latest/modules/prompts.html
Both regular and few shot templates are supported.
You can use the UI or API to create a template.
Templates are unique by name, which means that publishing a template with the same name will overwrite old templates.
To create a template using the UI, simply navigate to the Registry and click "Create Template". This will allow you to create the template visually. You can also edit old templates from the UI.
Try dragging in a JSON PromptTemplate file. For more information about serialization, see the Langchain docs.
promptlayer.prompts.publish(
"my_template", prompt_template=my_template, tags=["my_tag"])
promptlayer.prompts.publish
to create a template. You can also use Langchain to create a template, either by pulling it from LangchainHub, creating a custom template, or providing a Python dictionary directly.See code snippets by expanding: