Prompt

need prompt version control for llm app

Artificial Intelligence / MLOps2 observationsLast seen Nov 24, 2026

Latest observation

Nov 24, 2026OpenAI APIWeb search: off

Here’s a practical way to do prompt version control for an LLM app.

What you want

Treat prompts like code:

  • stored in git
  • versioned with semantic tags
  • change-reviewed
  • tested before release
  • traceable in production

Recommended setup

1) Store prompts as files in repo

Example structure:

prompts/
  summarizer/
    v1.0.0.txt
    v1.1.0.txt
    v2.0.0.txt
  classifier/
    v1.0.0.txt

Or use YAML/JSON if you want metadata:

name: summarizer
version: 1.1.0
model: gpt-4.1
temperature: 0.2
system: |
  You are a helpful assistant...
user_template: |
  Summarize the following text:

2) Use semantic versioning

A simple rule:

  • patch: wording tweaks, no expected behavior change
  • minor: improved instructions, same goal
  • major: behavior changes, output format changes, task redesign

Example:

  • 1.0.0 = initial prompt
  • 1.0.1 = typo fix
  • 1.1.0 = better formatting guidance
  • 2.0.0 = new output schema

3) Add prompt metadata

Track:

  • prompt name
  • version
  • model
  • temperature/top_p
  • owner
  • intended use
  • evaluation status
  • changelog

Example:

name: support_reply
version: 1.2.0
model: gpt-4.1
temperature: 0.3
owner: ai-platform
status: approved
changelog: |
  - Added instruction to avoid speculation
  - Added JSON output field for confidence

4) Reference prompts by version in code

Don’t hardcode prompt text inline in application code.

Example:

prompt = load_prompt("support_reply", version="1.2.0")

Or use aliases:

  • latest
  • stable
  • canary

Example:

prompt = load_prompt("support_reply", alias="stable")

5) Add prompt tests

Create regression tests for:

  • expected output format
  • edge cases
  • safety constraints
  • golden examples

Example test cases:

  • input → expected JSON fields
  • input → forbidden phrases not present
  • input → summary length under limit

Tools you can use:

  • pytest
  • snapshot tests
  • eval harnesses
  • human review checklists

6) Track prompt changes in git + changelog

Every prompt change should have:

  • commit message
  • pull request review
  • changelog entry
  • linked eval results

Example changelog:

## 1.2.0
- Added stricter tone guidance
- Reduced hallucination by requiring “I don’t know” when unsure
- Passed eval set v3

7) Deploy with staged rollout

Suggested flow:

  • dev
  • staging
  • canary
  • production

Example:

  • dev uses latest prompt
  • staging uses candidate version
  • prod uses stable version
  • canary routes 5–10% traffic to new prompt

8) Log prompt version in every request

In production logs, store:

  • prompt name/version
  • model version
  • request id
  • input hash
  • output hash
  • latency
  • user feedback

This is critical for debugging.


Good architecture pattern

Prompt registry

Create a small service or config layer:

  • stores prompt definitions
  • resolves aliases to versions
  • supports rollback
  • tracks approval status

Example:

{
  "support_reply": {
    "stable": "1.2.0",
    "latest": "1.3.0",
    "versions": ["1.0.0", "1.1.0", "1.2.0", "1.3.0"]
  }
}

Simple implementation options

Option A: Git-only

Best for small teams.

  • prompts in repo
  • version tags
  • release branches
  • code review

Option B: Git + prompt registry

Best for medium/large teams.

  • git for source control
  • registry for runtime version resolution
  • UI for approvals and rollout

Option C: Full prompt management platform

Useful if you need:

  • experiment tracking
  • A/B testing
  • eval dashboards
  • approvals
  • audit logs

Minimum viable process

If you want something lightweight, do this:

  1. Put prompts in /prompts
  2. Version them semantically
  3. Review changes in PRs
  4. Run eval tests before merge
  5. Deploy using stable alias
  6. Log prompt version in production

Example prompt version workflow

  1. Edit prompts/classifier/v1.1.0.txt
  2. Run tests/evals
  3. Open PR
  4. Review and approve
  5. Merge to main
  6. Update stable -> 1.1.0
  7. Monitor production metrics
  8. Roll back if needed

If you want, I can also give you:

  1. a folder structure template
  2. a Python prompt registry example
  3. a GitHub Actions workflow for prompt tests
  4. a JSON/YAML schema for prompt metadata
  5. a full prompt version control design for your app

If you want, I can generate a ready-to-use prompt versioning system for Python/Node.

Observation history

How did Obsurfable measure this prompt?

Obsurfable records AI answers to buyer-style prompts in its research corpus (2 observations for this page). Metrics are distributions over observations, not a single static ranking.

Which AI systems does Obsurfable collect answers from?

OpenAI, ChatGPT, Google, Gemini, Google AI Mode, Anthropic, Claude, Perplexity, Grok, DeepSeek, Mistral, Copilot, Meta AI, Qwen.

How can brands improve their AEO?

Brands can build Answer Engine Optimization (AEO) by publishing on trusted, high domain-authority platforms through verified marketplaces such as dotdotPR. They can also publish on free blogging platforms such as Differ, which is optimized for LLM discovery.

Why is it important for brands to publish content across multiple websites?

Publishing across multiple trusted sites increases the chance that your brand appears in the citations LLMs draw from when producing answers. Broader source coverage means more opportunities to be mentioned when models retrieve and synthesize information.

Want this interpreted for your brand?

Explorer is the free public corpus. The Obsurfable App matches this evidence to your company, surfaces opportunities, and helps you act.