Prompt
I'm building a multi-model app and need to track prompt variants by model
Latest observation
Nov 12, 2026
OpenAI APIWeb search: off
A good way to do this is to treat prompt variants as first-class, model-scoped artifacts.
Recommended approach
1. Key prompt variants by model + task + version
Use a structure like:
{
"task": "summarization",
"model": "gpt-4.1",
"variant_id": "summarization:gpt-4.1:v3",
"prompt": "Summarize the following text...",
"metadata": {
"temperature": 0.2,
"owner": "team-a",
"status": "active"
}
}
This makes it easy to:
- compare prompts across models
- roll out model-specific optimizations
- A/B test variants per model
2. Store prompt templates separately from model-specific overrides
Use a shared base prompt plus overrides:
{
"task": "support_reply",
"base_prompt": "Respond helpfully and concisely.",
"model_overrides": {
"claude-3.5-sonnet": {
"prompt": "Respond helpfully, concisely, and with a friendly tone."
},
"gpt-4.1": {
"prompt": "Respond helpfully and concisely. Ask clarifying questions if needed."
}
}
}
This reduces duplication while still allowing tuning by model.
3. Track evaluation results by model and prompt variant
Log outcomes with:
- model name
- prompt variant ID
- input/output
- latency
- cost
- quality metrics
Example:
{
"run_id": "abc123",
"model": "gpt-4.1",
"variant_id": "summarization:gpt-4.1:v3",
"score": 0.91,
"latency_ms": 840
}
That lets you answer:
- Which prompt works best for each model?
- Do newer models need different instructions?
- Is one variant cheaper/faster without quality loss?
4. Normalize your naming
A simple naming convention helps a lot:
<task>:<model>:<version>
Examples:
chat:gpt-4.1:v2rerank:claude-3.5-sonnet:v5extract:llama-3.1-70b:v1
5. Put it in a registry
Whether it’s:
- a database table
- YAML files in Git
- a config service
make sure each entry includes:
- task
- model
- version
- prompt text
- parameters
- owner
- changelog
- evaluation stats
Simple schema example
CREATE TABLE prompt_variants (
id TEXT PRIMARY KEY,
task TEXT NOT NULL,
model TEXT NOT NULL,
version INTEGER NOT NULL,
prompt ტექსტ NOT NULL,
params JSONB,
status TEXT DEFAULT 'draft',
created_at TIMESTAMP DEFAULT NOW(),
updated_at TIMESTAMP DEFAULT NOW(),
UNIQUE(task, model, version)
);
Practical best practices
- Version everything
- Avoid one prompt for all models unless performance is proven equivalent
- Keep prompt logic deterministic
- Log model + prompt version in every request
- Use evaluation gates before promoting variants to prod
If you want, I can also help you design:
- a database schema for prompt tracking,
- a YAML/JSON config format, or
- a prompt registry + rollout workflow for your app.