Prerequisites
- First, you’ll need a Parea API key. See Authentication to get started.
- For any model you want to use with the SDK, set up your Provider API keys.
How to deploy a prompt
Visit the Playground to view or create prompts. After testing your prompt, you can click the blue rocket icon to deploy it. Afterward, optionally provide a name and commit message for the deployment and copy the deployment ID. (Don’t worry; you can get the deployment ID later from the Deployments tab) Prompt deployments are specific to the selected version. In the Playground, when you change a prompt or its parameters and save it, a new version will automatically be created. You can bump or rollback deployment versions while maintaining the same deployment ID. This makes it easy to change your prompt without updating your code.Bumping / Revert a deployment
In the Playground, if a prompt has been previously deployed, and you click the rocket icon on a new version, you will be prompted to confirm whether to bump (if the current version is > than the deployed) or revert (if the current version is < than the deployed) the deployment. (You could also create an entirely new deployment with a new deployment name and ID.)A/B test, or QA a prompt
Sometimes you may want to have two branches of the same prompt. One for production, and one for testing. With the drop-down menu, when bumping or reverting a deployment you can choose which branch should change.Common Workflow:
- Deploy prompt v0 to dev and test using experiments
- After you are happy with performance, deploy the same prompt version as a new prod branch
- Continue to iterate on the dev branch by selectively bumping or reverting that branch only
- When ready, bump the prod branch to the latest and greatest version
How to use a deployed prompt
You can interact with your deployed prompts in two ways. Use the prompt directly or fetch the prompt’s data to use in your code.Use deployed prompt
Using the completion endpoint, you can set thedeployment_id
parameter and provide the prompt template inputs.
Fetch deployed prompt
You can fetch the prompt data and utilize it in your code using the get deployed prompt endpoint. The response will include the raw prompt and the prompt filled in with the provided inputs and other metadata. If you fetch a deployed prompt to use with your own LLM API, but still want traced logs associated with the deployment, you can either add
deployment_id to the trace decorator, or use trace_insert({"deployment_id": "p-PSOwRyIPaQRq4xQW3MbspVz"}) in your code.Response Object
Response Object

