Inferensys

Prompts

Example-Based Output Repair and Error Recovery

Prompt playbooks for showing the model how to fix common output errors, normalize malformed responses, and recover from validation failures through corrective examples. Useful for production engineers because repair examples reduce retry loops and improve self-correction accuracy.
ML engineer managing model training cluster on laptop, GPU utilization visible, technical deep learning setup.
Prompts

Example-Based Output Repair and Error Recovery

Prompt playbooks for showing the model how to fix common output errors, normalize malformed responses, and recover from validation failures through corrective examples. Useful for production engineers because repair examples reduce retry loops and improve self-correction accuracy.

Malformed JSON Repair Prompt Template

For production engineers handling LLM outputs that fail JSON.parse. Uses few-shot corrective examples to fix unescaped characters, trailing commas, and bracket mismatches before retry. Includes eval checks for structural validity and schema compliance.

Schema Validation Failure Recovery Prompt

For integration engineers when structured output passes JSON parse but fails schema validation. Demonstrates field type coercion, missing required field injection, and enum correction through worked examples. Includes harness for measuring repair accuracy against a golden schema.

Hallucinated Field Detection and Removal Prompt

For teams building extraction pipelines where models invent plausible but unsourced fields. Uses counterexamples showing hallucinated vs. grounded output pairs to teach field-level skepticism. Includes eval for precision-recall tradeoff on field removal decisions.

Tool Call Argument Repair Prompt

For agent developers when function calling produces invalid argument types, missing required parameters, or hallucinated parameter names. Few-shot examples show argument coercion, default injection, and safe fallback patterns. Includes test harness for multi-tool argument validation.

Output Truncation Recovery Prompt

For engineers handling max_token cutoffs mid-JSON, mid-sentence, or mid-code-block. Demonstrates completion strategies from partial output context, including safe structural closing and explicit truncation markers. Includes eval for completion correctness vs. hallucination risk.

Factual Inconsistency Flagging Prompt

For RAG and summarization teams detecting when model output contradicts source evidence or contains internal contradictions. Uses paired examples of consistent vs. inconsistent outputs with explicit contradiction markers. Includes eval for contradiction detection recall.

Citation Format Normalization Prompt

For legal and research teams standardizing inconsistent citation styles, missing fields, and malformed references. Few-shot examples map common citation errors to corrected formats across APA, Bluebook, and custom styles. Includes validation against citation schema.

PII Redaction Repair Prompt

For privacy engineers when automated redaction misses context-dependent PII or over-redacts non-sensitive data. Demonstrates boundary cases through examples: partial redaction, context-preserving replacement, and false-positive correction. Includes eval for redaction precision and recall.

Agent Action Sequence Repair Prompt

For agent developers when multi-step tool calls execute in wrong order, skip required steps, or include redundant actions. Few-shot examples show correct sequencing, dependency resolution, and step pruning. Includes harness for plan validity checking.

Classification Label Correction Prompt

For triage and routing systems when model assigns wrong labels, inconsistent confidence, or conflicting multi-label sets. Demonstrates label correction through examples showing boundary cases, hierarchy constraints, and confidence recalibration. Includes eval for classification accuracy improvement.

Code Snippet Syntax Repair Prompt

For coding agents and documentation tools fixing generated code with syntax errors, missing imports, or language mismatches. Few-shot examples show common syntax fixes across Python, JavaScript, SQL, and shell. Includes harness for syntax validation and execution safety checks.

Date Format Standardization Prompt

For data engineering teams normalizing inconsistent date representations, timezone offsets, and relative date expressions. Demonstrates conversion patterns through examples covering ISO 8601, locale formats, and ambiguous date resolution. Includes eval for format compliance and timezone correctness.

Enum Value Correction Prompt

For API integration engineers when model outputs values outside allowed enum sets or uses near-miss variants. Few-shot examples map common misspellings, synonyms, and case variants to canonical enum values. Includes validation against closed enum schemas.

Markdown Block Extraction from Malformed Output Prompt

For developers when LLM wraps structured output in inconsistent markdown fences, mixes content types, or nests code blocks incorrectly. Demonstrates extraction patterns for JSON, XML, CSV, and plain text from noisy markdown. Includes eval for extraction accuracy and content preservation.

SQL Injection Sanitization Prompt

For security-conscious teams repairing generated SQL that contains injection risks, unquoted identifiers, or unsafe concatenation. Few-shot examples show parameterization fixes, identifier quoting, and safe pattern rewrites. Includes harness for SQL injection vulnerability testing.

API Response Wrapping Fix Prompt

For integration engineers when model generates API responses with wrong envelope structure, missing status fields, or incorrect content types. Demonstrates wrapping and unwrapping patterns through examples matching OpenAPI and GraphQL response schemas. Includes validation against API contracts.

Confidence Score Recalibration Prompt

For ML engineers when model outputs overconfident or miscalibrated probability scores. Few-shot examples show recalibration patterns: temperature scaling, verbal-to-numeric mapping, and uncertainty expression normalization. Includes eval against calibration curves and Brier scores.

Duplicate Key Resolution Prompt

For data pipeline engineers when structured output contains duplicate keys in JSON objects or YAML mappings. Demonstrates resolution strategies through examples: first-wins, last-wins, merge, and error-flagging approaches. Includes validation for key uniqueness and semantic correctness.

Encoding Artifact Removal Prompt

For text processing teams cleaning BOM characters, mojibake, mixed encodings, and control characters from LLM output. Few-shot examples show detection and normalization patterns for UTF-8, ASCII, and Latin-1 artifacts. Includes eval for character-level cleaning accuracy.

GraphQL Query Repair Prompt

For API developers fixing generated GraphQL queries with invalid field names, missing required arguments, or type mismatches. Demonstrates repair through examples referencing schema introspection results. Includes harness for query validation against GraphQL schema.

Tone Drift Correction Prompt

For content and support teams when model output shifts between formal, casual, technical, or brand-inappropriate registers. Few-shot examples show tone normalization while preserving content meaning. Includes eval for tone consistency scoring and content preservation.

Incomplete Thought Completion Prompt

For production systems handling mid-sentence cutoffs, dangling clauses, and unfinished reasoning chains. Demonstrates safe completion strategies that avoid hallucinating conclusions while providing useful partial output. Includes eval for completion appropriateness and hallucination rate.