In LLM applications, prompts are as important as code. They need the same discipline.
Version Control
Store prompts in source control or a prompt management system, with change history and reasons.
Separate From Code — or Not
Some teams keep prompts in code for simplicity; others use prompt registries so non-engineers can edit them. Either way, changes should be tracked and reviewed.
Testing
Run each prompt change against an evaluation set before deployment. Compare quality, cost and latency with the current version.
Deployment
- Release prompt changes gradually or with A/B tests.
- Record the prompt version with every request for traceability.
Rollback
Keep previous versions deployable in minutes.
Model Coupling
Prompts are tuned to specific models. Re-test when changing models or when providers update them.
Templates and Variables
Manage variable content separately from fixed instructions, and validate inputs.
Ownership
Assign owners for important prompts, just as for services.