surfacecleaningnormalize_quantity_llm
Cleaningscalar · returns json

NORMALIZE_QUANTITY_LLM

LLM-backed quantity parsing (escape hatch for NORMALIZE_QUANTITY)

Per-row — runs once for each row.

cleaningllmllm-escape-hatchtext

Syntax

NORMALIZE_QUANTITY_LLM({{ value }})
NORMALIZE_QUANTITY_LLM({{ value }}, '{{ system }}')

Arguments

nametypedescription
valueVARCHAR
system(optional)VARCHAR

About

LLM-backed escape hatch for quantity parsing. Use when the canonical `pint` path (NORMALIZE_QUANTITY) misses an expression — typically domain-specific dosing ("500mg x 30 count"), unusual pack descriptions, or highly ambiguous natural language. For standard quantity expressions, prefer NORMALIZE_QUANTITY — much faster and fully deterministic.

Examples

LLM escape hatch handles pack descriptions

SELECT
  normalize_quantity_llm ('500mg x 30 tablets')

Nearby rabbit holes

same domain
Climb back to The Looking Glass