Prompt Chain

Organize and label prompts across multiple providers

Label and organize prompts to run different sets against multiple providers in unified evaluations.

Works with openai

76
Spark score
out of 100
Updated 18 days ago
Version 0.121.18
Models
gpt 3 5

Add to Favorites

Why it matters

Enable developers to run organized sets of prompts against different AI providers in a single evaluation, using labels to manage which prompts run against which providers and consolidate results into unified output.

Outcomes

What it gets done

01

Label and categorize prompts into logical groups for testing

02

Route specific prompt sets to designated AI providers

03

Execute multi-provider evaluations in a single run

04

Consolidate results from multiple prompt-provider combinations

Install

Add it to your toolbox

Run in your project directory:

curl -fsSL https://spark.entire.vc/get/pfoo-config-prompt-labels | bash

Steps

Steps in the chain

01
Initialize example project
02
Set OPENAI_API_KEY environment variable
03
Edit promptfooconfig.yaml
04
Run evaluation
05
View results

Overview

Config Prompt Labels

This prompt chain demonstrates how to use prompt labels in Promptfoo to organize and execute evaluation workflows. It enables you to run one set of multiple prompts against a specific provider, another set of prompts against a different provider, and consolidate all results into a single evaluation output. Use this workflow when you need to test different prompt variations against multiple LLM providers simultaneously or organize evaluations with distinct prompt groups. This approach allows you to manage multiple prompt-provider combinations within a single configuration. Do NOT use this if you only need to test a single prompt against one provider - the labeling overhead adds unnecessary complexity for simple evaluations.

What it does

This prompt chain demonstrates how to use prompt labels in Promptfoo to organize and execute evaluation workflows. It enables you to run one set of multiple prompts against a specific provider, another set of prompts against a different provider, and consolidate all results into a single evaluation output.

When to use - and when NOT to

Use this workflow when you need to test different prompt variations against multiple LLM providers simultaneously or organize evaluations with distinct prompt groups. This approach allows you to manage multiple prompt-provider combinations within a single configuration.

Do NOT use this if you only need to test a single prompt against one provider - the labeling overhead adds unnecessary complexity for simple evaluations.

Inputs and outputs

You provide a promptfooconfig.yaml file that defines your prompt sets with labels, specifies which providers to use, and maps which labeled prompts run against which providers. You also need to set your OPENAI_API_KEY environment variable.

You receive a single evaluation result from all prompt-provider combinations, viewable through the Promptfoo interface by running promptfoo view.

Integrations

This workflow requires the Promptfoo evaluation framework and an OpenAI API key. It uses Promptfoo's configuration system via YAML files and the command-line interface for execution and result visualization.

To get started:

npx promptfoo@latest init --example config-prompt-labels
cd config-prompt-labels

After editing your configuration, run the evaluation:

promptfoo eval

View results with promptfoo view to launch the interface.

Who it's for

This workflow serves ML engineers and prompt engineers who need to organize and execute evaluations across multiple prompts and providers. The labeling system allows you to manage different prompt sets and provider combinations within a single configuration file.

Source README

config-prompt-labels (Prompt Labels)

You can run this example with:

npx promptfoo@latest init --example config-prompt-labels
cd config-prompt-labels

Usage

This example shows how to use prompt labels to organize your prompts and providers.
In a single eval, we can run one set of multiple prompts against a provider, another set
of prompts against another provider, and get back a single result.

To get started, set your OPENAI_API_KEY environment variable.

Next, edit promptfooconfig.yaml.

Then run:

promptfoo eval

Afterwards, you can view the results by running promptfoo view

FAQ

Common questions

Discussion

Questions & comments ยท 0

Sign In Sign in to leave a comment.