AI & LLM

Prompt Template (Reusable) JSON Example

A JSON example of a reusable LLM prompt template — includes the template string with variables, input schema, model parameters, and few-shot examples. Copy-ready for prompt management.

{
  "id": "prompt_classify_ticket_v3",
  "name": "Classify support ticket",
  "version": 3,
  "model": "gpt-4o",
  "parameters": {
    "temperature": 0,
    "max_tokens": 200
  },
  "template": "Classify the support ticket into one of: billing, technical, account, other.\n\nTicket: {{ticket_text}}\n\nRespond with only the category.",
  "variables": [
    {
      "name": "ticket_text",
      "type": "string",
      "required": true,
      "description": "The raw customer ticket message"
    }
  ],
  "tags": [
    "support",
    "classification"
  ],
  "updatedAt": "2025-05-15T09:00:00Z"
}

Field Reference

idrequiredstringStable identifier used to fetch the template at runtime
versionrequiredintegerIncremented on each edit so you can pin and roll back prompts
templaterequiredstringThe prompt body with {{variable}} placeholders to interpolate
variablesrequiredarray<object>Declared inputs with types — lets you validate before rendering
parametersoptionalobjectDefault model settings (temperature, max_tokens) for this prompt

Variants

Few-shot templateIncludes example input/output pairs to steer the model's format.
{
  "id": "prompt_extract_entities_v1",
  "template": "Extract the person and company from the sentence.",
  "examples": [
    {
      "input": "Ravi joined Acme in 2021.",
      "output": {
        "person": "Ravi",
        "company": "Acme"
      }
    },
    {
      "input": "Mia leads design at Globex.",
      "output": {
        "person": "Mia",
        "company": "Globex"
      }
    }
  ],
  "model": "gpt-4o",
  "parameters": {
    "temperature": 0
  }
}

Common Use Cases

  • Versioning and storing prompts outside application code
  • A/B testing prompt variations and rolling back bad changes
  • Sharing reusable, parameterised prompts across a team
promptprompt templateprompt engineeringfew-shotllmprompt management

Validate or format this JSON

One click loads this exact example into the tool — no copy-paste needed. Format it, validate it, explore the tree, or generate TypeScript types instantly.

Frequently Asked Questions

Externalising prompts into versioned JSON lets non-engineers edit them, enables A/B testing and rollback, and decouples prompt changes from deployments. You fetch the template by id and version at runtime and interpolate the variables.

Use a clear placeholder syntax such as {{variable}} and declare each variable with a name, type, and whether it's required. Validate and escape inputs before interpolation to avoid prompt injection and malformed prompts.

Related JSON Examples