Publishing Prompts
Deploy your version-controlled prompts as API endpoints via the AI Gateway.
Once you have iterated and tested your prompt using the Prompt Manager and Playground, the next step is to make it available to your applications. Latitude allows you to deploy the published version of your prompts as stable API endpoints through the AI Gateway.
The AI Gateway Concept
The AI Gateway acts as a proxy between your application and the underlying AI models configured for your prompt. When you publish a new version of a prompt in Latitude:
- The AI Gateway endpoint associated with that prompt is automatically updated to use the newly published version.
- Your application continues calling the same stable endpoint URL.
- The gateway routes the request to the correct prompt version and configured model provider.
This decouples your application deployment cycle from your prompt iteration cycle.
Publishing a Prompt Version
- Ensure your desired prompt changes are saved in the current draft version.
- Thoroughly test the draft in the Playground and potentially using batch evaluations.
- Click the “Publish” button within the prompt editor or version management interface.
- Add a descriptive version note (e.g., “Added handling for Spanish language queries”).
- Confirm the publication.
Your draft is now the new “Published” version.
Referencing Deployed Endpoints
After publishing, your prompt is accessible via a unique, stable API endpoint.
Finding the Endpoint URL
- Navigate to the prompt in the Latitude UI.
- Click the “Deploy this prompt” button.
- Copy the endpoint URL under the HTTP API section.
Using the Endpoint
There are two main ways to interact with the deployed prompt endpoint:
-
Latitude SDK (Recommended):
- Use the
latitude.run('your_prompt_id', { parameters: {...} })
method (or equivalent) in our Python or TypeScript SDKs. - The SDK handles authentication and communication with the correct endpoint based on the prompt ID.
- This abstracts away the raw HTTP call.
- Use the
-
Direct HTTP API Call:
- Make a POST request directly to the endpoint URL provided in the UI.
- Include necessary authentication headers (API Key). See API Access.
- Send parameters in the request body.
- Refer to the API Reference for detailed request/response formats.
Auto-Updating Prompts (No Redeployment Needed)
The key benefit of this system is that when you publish a new version of a prompt in Latitude:
- The AI Gateway endpoint instantly starts using the new version.
- You do not need to change any code or redeploy your application.
Your application continues to call the same endpoint URL or use the same prompt ID with the SDK, and it automatically benefits from the updated prompt logic and configuration.
Next Steps
- Integrate using the Latitude SDKs
- Learn about the HTTP API
- Set up API Access Keys