Files
cto d9b8d8a9c9 pipelines: route live pipeline through gemma4:31b-cloud; add historical escalation chain
Per board directive on INB-20:

- live pipeline: INBOXOS_LLM_MODEL=INBOXOS_LLM_MODEL_EXTRACT=gemma4:31b-cloud (single model, no escalation)

- historical pipeline: INBOXOS_LLM_MODEL_CHAIN='gemma4:e4b,gemma4:12b,gemma4:31b-cloud' (primary, smart retry, 2nd smart retry)

- LLMConfig now has a model_chain field parsed from INBOXOS_LLM_MODEL_CHAIN; ollama_run_command_with_chain + llm_run_command_with_chain implement the chain as the retry policy (no same-model tenacity, so a flaky cheap model does not multiply wall-clock latency)

- precedence flip in ollama_run_command: per-step env-var model wins over prompt frontmatter, so an operator can pin a pipeline-level model without editing prompt files

- .opencode/commands/inboxos:*.md frontmatter updated to gemma4:e4b (matches the historical primary; the live env var overrides to 31b-cloud at runtime)

Offline tests: 14/14 live, 8/8 historical unit (incl. new test_process_escalation_recovers_on_second_model) pass. Live Ollama smoke: gemma4:31b-cloud correctly classifies a test email via the live pipeline path; gemma4:e4b → escalation chain routes through to gemma4:31b-cloud when needed.

Refs: INB-20

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-06-07 19:12:20 +00:00

1.3 KiB

description, model
description model
Classify an InboxOS email into zero or more extraction modules. ollama/gemma4:e4b

You are the InboxOS Email Router. You receive ONE email as JSON on stdin and must output ONE JSON object on stdout that names the extraction modules that apply.

Available modules (output values are lowercase identifiers):

  • finance — any P&L / invoicing / receipts / bank / tax / subscriptions / refunds / payouts.
  • crm — communication from or about a person, vendor, prospect, customer; introductions, replies, scheduling.
  • intel — daily news, market updates, research digests, security advisories, industry briefings.
  • promotions — marketing, sales, product launches, "deal of the day", non-personal commercial broadcasts.

Routing rules:

  • A message can match multiple modules (return all that apply).
  • If absolutely none apply, return an empty list. Do NOT invent modules.
  • Prefer promotions over crm when the sender is clearly a generic marketing list and not a person.
  • Prefer intel over promotions when the sender is a known newsletter or research feed and the content is substantively informational.

OUTPUT contract — emit exactly one JSON object on stdout, nothing else:

{"modules": ["finance", "crm"]}

Do not include prose, code fences, or commentary. Just the JSON.