Skip to main content

How do I undo a template deprecation?

Last updated 3 min read

Template deprecation in Coolhand is permanent and cannot be undone. Neither the REST API nor the agent tools provide an endpoint to restore a deprecated template. To resume routing traffic for those prompts, create a new template with the required prompt patterns or external key; pending unmatched logs will automatically rematch.

Template deprecation in Coolhand is permanent. Once a template is marked as deprecated, there is no API endpoint, dashboard action, or agent tool to un-deprecate or reactivate it.

If a template was deprecated by mistake, you can recover by creating a new active template with the same settings.

What happens when a template is deprecated

When a template is deprecated:

  • Matching stops immediately: Coolhand completely excludes deprecated templates from prompt matching. New incoming logs will never route to a deprecated template, even if their prompt text matches its patterns.
  • Traffic routes to Unmatched: If no other active template matches the incoming requests, those logs route to your client's Unmatched bucket.
  • Evaluations stop: Automated evaluations are not scheduled for deprecated templates.
  • Historical logs and metrics remain: Past logs, token counts, feedback, and metrics associated with the deprecated template are preserved and remain accessible.
  • API visibility: Deprecated templates are omitted by default from GET /api/v2/llm_request_templates, but you can include them by passing include_deprecated=true. Fetching a template directly by ID via GET /api/v2/llm_request_templates/{id} always returns the template, even when deprecated.

How to restore prompt routing

To restore log routing after an accidental deprecation, create a new replacement template.

Restoring pattern-matched templates

For templates that route logs using prompt regular expressions:

  1. Retrieve the original patterns and configuration: Fetch the deprecated template by its ID using GET /api/v2/llm_request_templates/{id} or through template search with deprecated templates included. Copy the user_prompt_pattern, system_prompt_pattern, prompt group, and workload ID.
  2. Create and publish a new template: Create a new template with the desired prompt patterns assigned to your workload, and publish it.
  3. Automatic rematching: As soon as the new template is published, Coolhand automatically runs a rematch across your Unmatched logs. Any logs that accumulated in the Unmatched bucket while the template was deprecated will be evaluated against the new template and associated accordingly.

Restoring declared templates

If the deprecated template was a declared template managed programmatically:

  1. Choose a new external key: Deprecated templates permanently hold their external_key. Attempting to recreate or update a template using a key held by a deprecated template will return an HTTP 422 Unprocessable Entity error. Select a new key (for example, appending a version suffix such as my-template:v2).
  2. Create the template via the API: Send a PUT request to /api/v2/llm_request_templates/by_key/{external_key} with the new key and the target workload_id or workload_key. For detailed instructions, see How do I create or update a template using an external key?.
  3. Update your log collection calls: Update your application or SDK configuration to send the new external key in the declared block of incoming log requests so future logs match the new template.

Related articles