Skip to main content
Once you have tagged a version of a prompt as ready (e.x. “staging”) you can pull a prompt into your code base and use it to prompt an LLM.
When integrating Phoenix prompts into your application, it’s important to understand that prompts are treated as code and are stored externally from your primary codebase. This architectural decision introduces several considerations:Key Implementation Impacts
  • Network dependencies for prompt retrieval
  • Additional debugging complexity
  • External system dependencies
Current StatusThe Phoenix team is actively implementing safeguards to minimize these risks through:
  • Caching mechanisms
  • Fallback systems
Best PracticesIf you choose to implement Phoenix prompts in your application, ensure you:
  1. Implement robust caching strategies
  2. Develop comprehensive fallback mechanisms
  3. Consider the impact on your application’s reliability requirements
If you have any feedback on the above improvements, please let us know https://github.com/Arize-ai/phoenix/issues/6290
To use prompts in your code you will need to install the phoenix client library. For Python:
For JavaScript / TypeScript:

Pulling a prompt

There are three major ways pull prompts, pull by name or ID (latest), pull by version, and pull by tag.

Pulling a prompt by Name or ID

Pulling a prompt by name or ID (e.g. the identifier) is the easiest way to pull a prompt. Note that since name and ID doesn’t specify a specific version, you will always get the latest version of a prompt. For this reason we only recommend doing this during development.
Note prompt names and IDs are synonymous.

Pulling a prompt by Version ID

Pulling a prompt by version retrieves the content of a prompt at a particular point in time. The version can never change, nor be deleted, so you can reasonably rely on it in production-like use cases.

Pulling a prompt by Tag

Pulling by prompt by tag is most useful when you want a particular version of a prompt to be automatically used in a specific environment (say “staging”). To pull prompts by tag, you must Tag a prompt in the UI first.
Note that tags are unique per prompt so it must be paired with the prompt_identifier
A Prompt pulled in this way can be automatically updated in your application by simply moving the “staging” tag from one prompt version to another.

Using a prompt

The phoenix clients support formatting the prompt with variables, and providing the messages, model information, tools, and response format (when applicable). The Phoenix Client libraries make it simple to transform prompts to the SDK that you are using (no proxying necessary!)
Both the Python and TypeScript SDKs support transforming your prompts to a variety of SDKs (no proprietary SDK necessary).
  • Python - support for OpenAI, Anthropic, Gemini
  • TypeScript - support for OpenAI, Anthropic, and the Vercel AI SDK