# Function createCompositeRouter

CLI Adapters exports - CLI integration with defensive parsing Split from index.ts for file size compliance (Issue #285)

- createCompositeRouter(
  adapters: Map<"claude" | "gemini" | "codex" | "opencode", ICliAdapter>,
  config?: Partial<
  {
  enableConfidenceCascade: boolean;
  enableBudgetFilter: boolean;
  enableCapabilityMatch: boolean;
  enableZeroRouter: boolean;
  enablePreferenceRouting: boolean;
  enableTopsisRanking: boolean;
  enableLinUCBSelection: boolean;
  enableQualityConstraint: boolean;
  enableResourceStrategy: boolean;
  enableStrategyDistillation: boolean;
  enableLatencyTracking: boolean;
  enableRoutingMemory: boolean;
  enableKnnRouting: boolean;
  latencyScoreWeight: number;
  budgetConstraints?: {
  maxTokens?: number;
  maxCostUsd?: number;
  maxLatencyMs?: number;
  };
  linucbAlpha: number;
  billingMode: "plan"
  | "api";
  enableCapacityBalancing: boolean;
  maxDecisionTimeMs: number;
  preferenceMinDataPoints: number;
  },
  >,
  logger?: ILogger,
  ): ICompositeRouter

  Creates a CompositeRouter instance.

  #### Parameters

  - adapters: Map<"claude" | "gemini" | "codex" | "opencode", ICliAdapter>
  - `Optional` config: Partial<
    {
    enableConfidenceCascade: boolean;
    enableBudgetFilter: boolean;
    enableCapabilityMatch: boolean;
    enableZeroRouter: boolean;
    enablePreferenceRouting: boolean;
    enableTopsisRanking: boolean;
    enableLinUCBSelection: boolean;
    enableQualityConstraint: boolean;
    enableResourceStrategy: boolean;
    enableStrategyDistillation: boolean;
    enableLatencyTracking: boolean;
    enableRoutingMemory: boolean;
    enableKnnRouting: boolean;
    latencyScoreWeight: number;
    budgetConstraints?: {
    maxTokens?: number;
    maxCostUsd?: number;
    maxLatencyMs?: number;
    };
    linucbAlpha: number;
    billingMode: "plan"
    | "api";
    enableCapacityBalancing: boolean;
    maxDecisionTimeMs: number;
    preferenceMinDataPoints: number;
    },
    >
  - `Optional` logger: ILogger

  #### Returns ICompositeRouter

  - Defined in packages/nexus-agents/src/cli-adapters/composite-router.ts:850