Prompt Engineering Quick Start (UI)
This quick start will walk through how to create, test, and iterate on prompts in LangSmith.
This tutorial uses the UI for prompt engineering, if you are interested in using the SDK instead, read this guide.
1. Setup
The only setup needed for this guide is to make sure you have signed up for a LangSmith account.
2. Create a prompt
To create a prompt in LangSmith, navigate to the Prompts section of the left-hand sidebar and click on the “+ New Prompt” button. You can then modify the prompt by editing/adding messages and input variables.
3. Test a prompt
To test a prompt, set the model configuration you want to use, add your LLM provider's API key, specify the prompt input values you want to test, and then click "Start".
To learn about more options for configuring your prompt in the playground, check out this guide. If you are interested in testing how your prompt performs over a dataset instead of individual examples, read this page.
4. Save a prompt
One you have run some tests and made your desired changes to your prompt you can click the “Save” button to save your prompt for future use.
5. Iterate on a prompt
LangSmith makes it easy to iterate on prompts with your entire team. Members of your workspace can select a prompt to iterate on in the playground, and once they are happy with their changes, they can simply save it as a new commit.
To improve your prompts:
-
We recommend referencing the documentation provided by your model provider for best practices in prompt creation, such as Best practices for prompt engineering with the OpenAI API and Gemini’s Introduction to prompt design.
-
To help with iterating on your prompts in LangSmith, we've created Prompt Canvas — an interactive tool to build and optimize your prompts. Learn about how to use Prompt Canvas.
You can also tag specific commits to mark important moments in your commit history:
6. Next steps
- Learn more about how to store and manage prompts using the Prompt Hub in these how-to guides
- Learn more about how to use the playground for prompt engineering in these how-to guides