detectProvider (llm/providers.ts)

clawdcursor · src/llm/providers.ts · typescript · MIT
ai, AI / Agents

Defines LLM provider profiles and utilities for selecting models.

// Source: https://github.com/AmrDab/clawdcursor | License: MIT | Copyright 2025-2026 Amr Dabbas
// Provided via justclaw.it.com; keep this notice with the code.
import { resolveApiConfig } from './credentials';

/**
 * Provider Model Map — auto-selects cheap/expensive models per provider.
 * Used by the doctor and the agent pipeline to route tasks optimally.
 */

export interface ProviderProfile {
  name: string;
  /** Base URL for API calls */
  baseUrl: string;
  /** Auth header format */
  authHeader: (key: string) => Record<string, string>;
  /** Cheap text-only model (Layer 2: accessibility reasoner) */
  textModel: string;
  /** Vision-capable model (Layer 3: screenshot fallback) */
  visionModel: string;
  /** Approximate context window of the text model in tokens.
   *  Used for d

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key