Prompt Chain

Configure Prompts for Multiple Models

Set up a custom set of promptfoo prompts targeted at specific models within a single eval.


80
Spark score
out of 100
Updated last month
Version code-scan-action-0.1

Add to Favorites

Why it matters

Streamline your AI development by configuring prompts specifically for different language models. This asset helps manage and apply model-specific prompt variations efficiently.

Outcomes

What it gets done

01

Define prompts tailored to individual LLM capabilities.

02

Organize and select appropriate prompts based on the target model.

03

Ensure consistent and effective prompt usage across various AI models.

Install

Add it to your toolbox

Run in your project directory:

curl -fsSL https://spark.entire.vc/get/pfoo-config-prompts-per-model | bash

Steps

Steps in the chain

01
Initialize example project
02
Navigate to project directory
03
Set OpenAI API key
04
Edit configuration file
05
Run evaluation
06
View results

Overview

Config Prompts Per Model

Shows how to assign specific prompts to specific models within a single promptfoo eval, instead of running one shared prompt across all models. Use when different models being compared need differently-worded prompts rather than one prompt shared across all of them.

What it does

This example shows how to set up a custom set of prompts for specific models within a single promptfoo eval, rather than running the same prompt across every configured model.

When to use - and when NOT to

Use this when different models in your eval need differently-worded or differently-structured prompts - for example, a model that responds better to a specific instruction style.

Not needed when the same prompt is meant to be compared identically across all models - that's the promptfoo default cartesian-product behavior.

Inputs and outputs

Input is promptfooconfig.yaml (edited to map specific prompts to specific models) plus OPENAI_API_KEY. Output is a normal promptfoo eval / promptfoo view run.

Integrations

Runs against OpenAI via OPENAI_API_KEY in this example; the per-model prompt mapping works with any provider set.

Who it's for

Teams comparing multiple models where each model needs its own tailored prompt rather than one shared prompt.

npx promptfoo@latest init --example config-prompts-per-model
cd config-prompts-per-model
Source README

config-prompts-per-model (Prompts Per Model)

You can run this example with:

npx promptfoo@latest init --example config-prompts-per-model
cd config-prompts-per-model

Usage

This example shows how to set up a custom set of prompts for specific models.

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.