Version, test, and optimize every prompt.
Stop guessing which prompt works best. Version control, A/B test, and cache-optimize your entire prompt pipeline.
Everything you need for prompt ops
Create, update, and organize prompt templates with rich metadata and tagging.
Every change creates a new version. Roll back instantly, compare versions, and audit changes.
Test prompt variants with configurable traffic allocation and metric tracking.
Fine-grained control over how traffic is distributed between variants.
Automatic prompt caching with hit rate analytics. Reduce latency and cost.
Declare required variables per template. Catch missing or mistyped variables before they reach your LLM.
Create and render in seconds
Define templates with variables, then render them with type-safe parameters.
// Create a prompt template
const template = await fold.prompts.create({
name: "code-review",
content: "Review this {{language}} code for {{focus_area}}: \n{{code}}",
variables: ["language", "focus_area", "code"],
metadata: { team: "engineering" },
});
// Use the template
const prompt = await fold.prompts.render("code-review", {
language: "TypeScript",
focus_area: "performance",
code: userCode,
});Test prompts like you test code
Define Variants
Create prompt variants with different content, tone, or structure. Assign weights to control traffic distribution.
Route Traffic
Fold automatically routes each request to a variant based on your weights. Sessions are sticky for consistent user experiences.
Measure Results
Track metrics per variant: response quality, user satisfaction, cost, and latency. Pick the winner with confidence.
// Create an A/B test
const test = await fold.prompts.createABTest({
name: "system-prompt-v2",
variants: [
{ id: "control", templateVersion: 3, weight: 50 },
{ id: "concise", templateVersion: 4, weight: 50 },
],
metric: "user_satisfaction",
});
// Automatically routes traffic
const prompt = await fold.prompts.resolve("system-prompt-v2");
// Returns the variant selected for this sessionCache-optimized prompts
Automatic prompt caching reduces latency and cost. Monitor cache hit rates in your dashboard.