@juspay/neurolink
Version:
The pipe layer of an AI nervous system: one interface connecting provider neurons to your application, across three inference types — generate, stream and decide. `decide` returns typed, calibrated judgements from a non-generative model (~400ms, ~$0.00002
50 lines (49 loc) • 1.5 kB
TypeScript
/**
* Fallback Workflow
* =================
*
* Sequential fallback chain using layer-based execution:
* - Try fast model first
* - Fall back to mid-tier if needed
* - Final fallback to premium model
*
* Ideal for: Cost-optimization with quality guarantee
*
* @module workflow/workflows/fallbackWorkflow
*/
import type { WorkflowConfig } from "../../types/index.js";
/**
* Fast-Fallback Workflow Configuration
*
* Uses layer-based execution with sequential groups:
* 1. Fast tier: GPT-4o-mini (try first)
* 2. Mid tier: Gemini 2.0 Flash (if fast fails)
* 3. Premium tier: GPT-4o or Claude 3.5 Sonnet (last resort)
*
* Each group runs sequentially - only proceeds if previous fails
*
* @example
* ```typescript
* import { runWorkflow } from '../core/workflowRunner.js';
* import { FAST_FALLBACK_WORKFLOW } from './fallbackWorkflow.js';
*
* const result = await runWorkflow(FAST_FALLBACK_WORKFLOW, {
* prompt: 'What is 2+2?',
* verbose: true,
* });
*
* // Usually completes with fast tier, saving cost
* console.log('Executed models:', result.ensembleResponses.length);
* ```
*/
export declare const FAST_FALLBACK_WORKFLOW: WorkflowConfig;
/**
* Aggressive Fallback Workflow
*
* More aggressive fallback with parallel premium tier:
* 1. Fast tier: GPT-4o-mini (sequential)
* 2. Premium tier: GPT-4o + Claude 3.5 (parallel, both execute)
*
* Guarantees high quality if fast tier fails
*/
export declare const AGGRESSIVE_FALLBACK_WORKFLOW: WorkflowConfig;