---
title: "How we optimized LLM use for cost, quality, and safety to facilitate writing postmortems"
description: "Datadog's Bits AI drafts incident postmortems by feeding structured Incident Management metadata and scrubbed Slack discussions into a mix of GPT-3.5 and GPT-4 models, one query per template section."
url: "https://swe.quest/articles/how-we-optimized-llm-use-for-cost-quality-and-safety-to-facilitate-writing-0fb0adf546328aa2"
canonical: "https://www.datadoghq.com/blog/engineering/llms-for-postmortems/"
source: "Datadog Engineering"
published: "2024-09-23"
difficulty: "medium"
kind: "Case study"
reading_minutes: 13
tags: ["llms","evals","incident-response","cost-optimization","privacy"]
---

# How we optimized LLM use for cost, quality, and safety to facilitate writing postmortems

A post on [Datadog Engineering](https://swe.quest/sources/datadog.md), published 2024-09-23, 13 min read, Case study. Original: [https://www.datadoghq.com/blog/engineering/llms-for-postmortems/](https://www.datadoghq.com/blog/engineering/llms-for-postmortems/)

## Summary

Datadog's Bits AI drafts incident postmortems by feeding structured Incident Management metadata and scrubbed Slack discussions into a mix of GPT-3.5 and GPT-4 models, one query per template section. Generating sections in parallel cut draft time from over 12 minutes to under one minute, but the sections overlapped, so follow-up LLM passes remove repetition and restructure the text. Assigning models per section kept costs down, and lower temperature and frequency penalty helped reduce hallucinations and repetition. Quality was judged mainly through author surveys on accuracy, conciseness, coherence, coverage and objectivity, since ROUGE/BLEU proved of limited use; secrets are swapped for placeholders before the model sees them, and claims cite source Slack messages.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [LLMs](https://swe.quest/tags/llms.md) (AI & ML)
- [Evaluation](https://swe.quest/tags/evals.md) (AI & ML)
- [Incidents & postmortems](https://swe.quest/tags/incident-response.md) (Reliability & operations)
- [Cost optimization](https://swe.quest/tags/cost-optimization.md) (Reliability & operations)
- [Privacy](https://swe.quest/tags/privacy.md) (Security)

## Prerequisites

- LLM prompting basics ([easy posts on LLMs](https://swe.quest/tags/llms.md?difficulty=easy))
- incident postmortems ([easy posts on Incidents & postmortems](https://swe.quest/tags/incident-response.md?difficulty=easy))

## Keywords

Bits AI, Datadog Incident Management, GPT-4, GPT-3.5 Turbo, Slack, ROUGE, BLEU, Confluence

## Related posts

- [Dead Ends or Data Goldmines? Investment Insights from Two Years of AI-Powered Postmortem Analysis](https://swe.quest/articles/dead-ends-or-data-goldmines-investment-insights-from-two-years-of-ai-powered-8637215027e4eee6.md): Zalando Engineering · 2025-09-24 · Medium · 18 min read · LLMs, SRE, Incidents & postmortems, Databases
  Zalando built a multi-stage LLM pipeline (summarization, classification, analyzer digests, cross-incident patterns, investment opportunities) to mine thousands of postmortems for recurring failure patterns in its datastores: Postgres, DynamoDB, ElastiCache, S3 and Elasticsearch.
- [Detecting malicious pull requests at scale with LLMs](https://swe.quest/articles/detecting-malicious-pull-requests-at-scale-with-llms-18b7d45442154d44.md): Datadog Engineering · 2025-10-21 · Medium · 12 min read · Supply chain security, Threat detection, LLMs, Code review, Evaluation
  Datadog's SDLC Security team built BewAIre, an LLM-based reviewer that classifies the diff of every merged PR (nearly 10,000 a week) as benign or malicious, with a written rationale emitted as a security signal for real-time triage.
- [We used GPT-4 during a hackathon—here's what we learned](https://swe.quest/articles/we-used-gpt-4-during-a-hackathon-here-s-what-we-learned-8311f49bf32b65c6.md): incident.io · 2023-07-25 · Medium · 9 min read · LLMs, Product engineering
  A two-day hackathon at incident.io prototyped GPT-3.5/GPT-4 features: incident handover summaries generated from full Slack channels, a reply-with-❓ jargon explainer, and natural-language incident filters.
- [Introducing the Enterprise Scenarios Leaderboard: a Leaderboard for Real World Use Cases](https://swe.quest/articles/introducing-the-enterprise-scenarios-leaderboard-a-leaderboard-for-real-world-3fa64534d04586f5.md): Hugging Face · 2024-01-31 · Easy · 6 min read · Evaluation, LLMs
  Patronus and Hugging Face's Enterprise Scenarios Leaderboard evaluates language models on six enterprise-oriented tasks: FinanceBench, Legal Confidentiality, Creative Writing, Customer Support Dialogue, Toxicity and Enterprise PII.
- [Can LLMs replace on call SREs today?](https://swe.quest/articles/can-llms-replace-on-call-sres-today-892e82a344776e7f.md): ClickHouse · 2025-08-14 · Medium · 57 min read · SRE, Observability, LLMs, AI agents, Evaluation
  LLMs were tested on autonomous root cause analysis of production incidents and fell short of replacing on-call SREs.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
