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.

registrytrimmed.mov

LangChain PromptTemplate Standard

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.

Publishing a Template

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.

Web UI

Untitled

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.

Python API

promptlayer.prompts.publish(
    "my_template", prompt_template=my_template, tags=["my_tag"])

See code snippets by expanding:

REST API