Templates/Energy & Utilities/Energy demand forecaster

Energy demand forecaster

Per-interval load forecast with confidence band. Reviewer-gate on out-of-envelope predictions routes to control-room analyst.

Category: classifier·Reviewer-gate: on-low-confidence·For Energy & Utilities

What this template is

Pattern: forecast classifier producing a closed-enum load-band per zone per interval + confidence. Conservative band-boundary mapping; reviewer-gate fires when predictions exceed historical envelope (drift detection). Spec hash + modelIdentity per L12 entry feed AI Act Annex III §2 critical-infrastructure technical documentation + REMIT trading-AI reproducibility for ACER inquiries.

The template

TypeScript · BSL-1.1 · License

import { RuntimeAISpec } from '@promethean/runtime-ai';

export const demandForecasterSpec: RuntimeAISpec = {
  specId: 'demand-forecaster-v1',
  displayName: 'Energy demand forecaster',
  description:
    'Per-interval load-band forecast for grid-zone + market window.',
  category: 'classifier',
  schemaVersion: 'promethean-runtime-ai-spec-1.0',
  canonicalForm: 'v1',

  inputSchema: {
    fields: [
      { name: 'forecastId', type: 'string', required: true,
        redaction: 'hash-only' },
      { name: 'gridZone', type: 'string', required: true,
        maxLength: 32 },
      { name: 'targetIntervalIso', type: 'string', required: true,
        maxLength: 32 },
      { name: 'weatherForecastHash', type: 'string', required: true,
        redaction: 'hash-only' },
      { name: 'historicalLoadMean', type: 'number', required: true,
        min: 0, max: 100_000 },
    ],
  },

  outputSchema: {
    fields: [
      { name: 'loadBandMW', type: 'enum', required: true,
        enumValues: [
          'band-0-100', 'band-100-500', 'band-500-1000',
          'band-1000-5000', 'band-5000-plus',
        ] },
      { name: 'pointEstimateMW', type: 'number', required: true,
        min: 0, max: 100_000 },
      { name: 'confidence', type: 'number', required: true,
        min: 0, max: 1 },
      { name: 'driftFlagged', type: 'boolean', required: true },
    ],
  },

  promptTemplate: {
    system:
      'You forecast electricity demand for grid-zone + market-window. ' +
      'Output a load-band + point estimate (MW) + confidence. ' +
      'Set driftFlagged=true if the estimate is >2σ from historical mean.',
    user:
      'Forecast {{forecastId}} for zone {{gridZone}}, interval {{targetIntervalIso}}. ' +
      'Historical load mean: {{historicalLoadMean}} MW.',
  },

  modelIdentity: {
    provider: 'anthropic',
    model: 'claude-sonnet-4-5',
    version: '20250929',
  },

  reviewerGate: 'on-low-confidence',
  lowConfidenceThreshold: 0.75,
  maxLatencyMs: 2000,
  fallbackBehavior: 'queue-for-review',
};

Regulations addressed

This template's configuration choices map to specific regulatory obligations. The substrate doesn't certify compliance — but the spec hash + reviewer-verdict + modelIdentity per L12 entry give you the evidence layer for these citations:

  • ·EU AI Act Annex III §2 — critical infrastructure
  • ·NIS2 Annex I — energy as essential sector
  • ·REMIT Regulation 1227/2011 — wholesale energy markets
  • ·Network code 2017/1485 — system operation

See citations index for official source URLs →

Installation + usage

  1. Create a free Dev-tier workspace — API key + Ed25519 signing key issued instantly.
  2. Install the SDK: npm install https://promethean.software/runtime-ai/latest.tgz.
  3. Paste the template above into your codebase. Adjust modelIdentity + prompt for your context.
  4. Call runConstrainedAI(spec, input, { client, receiptLogPath, productId, signingKey }) from your service code. For local testing pass createMockRuntimeAIClient(spec); for production, an Anthropic / OpenAI / Azure adapter.
  5. Verify the chain with the Apache-2.0 verifier.