LLM Cascade
HYRE enriches every endpoint through a tiered multi-model cascade. Each endpoint picks a tier based on what its output is — a cheap data listing, a heavier analysis, or a genuine analytical decision. Within a tier, models are tried in priority order: if one fails (timeout, rate limit, content policy), the next is tried automatically. If all models fail, raw data is returned withinsight: null and HTTP 206 status.
Tiers
Every tier shares the same fallback chain, so a failure in the primary model
degrades gracefully to the next provider rather than failing the request.
Reasoning Tier — OpenServ SERV
Decision endpoints use OpenServ SERV Reasoning as their primary model. SERV is an OpenAI-compatible gateway that runs a bounded reasoning pass (BRAID) over an underlying model before answering, which improves multi-factor judgments and arithmetic-heavy comparisons.Reasoning tokens share the completion budget, so
max_tokens is raised to 2500
on this tier (vs 800 on fast/quality) to avoid truncating the answer. The
12s timeout gives the reasoning pass headroom above the 8s used elsewhere.
If
SERV_API_KEY is not configured, these endpoints fall back to the Gemini
cascade automatically — no request fails.
Cascade Order
The fallback chain, in order, after the tier’s primary model:fast starts at Flash-Lite then escalates to Flash; quality and reasoning
fall back through Flash first. All tiers end with OpenRouter then Venice.Chat Agent (Playground)
The Playground chat agent uses a separate model:Failure Modes
HTTP 206 (Partial Content) indicates the data was fetched successfully but the
LLM enrichment failed. The
data field contains the full upstream data. The
signal field falls back to neutral with confidence: 0.LLM Call Configuration
Every LLM call uses these parameters:- Low temperature (0.3) — Prioritizes consistent, factual output over creative variation.
- JSON mode — Forces the model to return valid JSON, parsed into the response envelope.
- 800 token limit — Keeps insights concise (1–2 sentences) and response times fast.
reasoning tier, max_tokens is raised to 2500 and
reasoning_effort: "low" is added, since reasoning tokens share the completion
budget.
System Prompts
Each endpoint segment has a dedicated system prompt that instructs the LLM:Response Format
The LLM returns JSON matching this structure:enrich() function merges this with the raw data. model_used reflects the
model that actually answered — e.g. serv/google/gemini-3.5-flash on the
reasoning tier, or gemini-2.5-flash-lite on the fast tier: