isProviderName (config/provider-defaults.ts)

agav · source/config/provider-defaults.ts · typescript · Apache-2.0
ai

Utility for validating provider names and retrieving default models for AI providers

// Source: https://github.com/prapaa-ai/agav | License: Apache-2.0 | Copyright You must retain, in the Source form of any Derivative Works
// Provided via justclaw.it.com; keep this notice with the code.
import type { AgavConfig } from "./config.js";

/**
 * Provider identifiers and their default models.
 *
 * Kept in a tiny standalone module (no runtime deps on config/startup) so both
 * startup selection and the org-policy layer can resolve a provider's default
 * model without creating an import cycle.
 */

export type ProviderName = AgavConfig["provider"];

export const PROVIDERS: readonly ProviderName[] = [
  "anthropic",
  "openai",
  "openrouter",
  "nvidia",
  "deepseek",
  "gemini",
  "vertex-ai",
  "ollama",
];

const DEFAULT_MODELS: Record<ProviderName, string> = {
  anthropic: 

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

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

Get a free API key