surfaceclassificationswitch_llm
Classificationscalar · returns varchar

SWITCH_LLM

LLM-backed semantic pattern matching

Per-row — runs once for each row.

classificationllmllm-escape-hatchtext

Arguments

nametypedescription
textVARCHAR
patternsVARCHAR
yieldsVARCHAR
fallback(optional)VARCHAR

About

LLM-backed escape hatch for SEMANTIC_SWITCH. Use when the zoo-backed version in SEMANTIC_SWITCH can't handle the task — when patterns require multi-step reasoning, strict first-match semantics, or subjective judgment that zero-shot NLI handles unreliably. For clean pattern sets, prefer SEMANTIC_SWITCH — it's instant and returns calibrated softmax scores from the specialist zoo.

Examples

LLM escape hatch: matches fruit pattern

SELECT
  semantic_switch_llm (
    'apple',
    '["is a fruit", "is an animal"]',
    '["fruit", "animal"]',
    'unknown'
  )

Nearby rabbit holes

same domain
Climb back to The Looking Glass