Skip to content

Enhanced ChatGPT Clone: Features Agents, MCP, Skills, DeepSeek, Anthropic, AWS, OpenAI, Responses API, Azure, Groq, o1, GPT-5, Mistral, OpenRouter, Vertex AI, Gemini, Artifacts, AI model switching, message search, Code Interpreter, langchain, DALL-E-3, OpenAPI Actions, Functions, Secure Multi-User Auth, Presets, open-source for self-hosting. Active

691 B
Raw Blame
import type { AppConfig } from '@librechat/data-schemas';

/** Bounds on parallel per-request lookups, used when `concurrency` omits a key. */
export const DEFAULT_LOOKUP_CONCURRENCY = {
  connectedAgentLoads: 4,
  mcpCatalogLookups: 4,
  skillNameLookups: 8,
  skillFileInspections: 4,
  resumeAgentLoads: 4,
} as const;

export type LookupConcurrency = keyof typeof DEFAULT_LOOKUP_CONCURRENCY;

/** The `librechat.yaml` `concurrency` value for `key`, else its default. */
export function getLookupConcurrency(
  appConfig: Pick<AppConfig, 'concurrency'> | null | undefined,
  key: LookupConcurrency,
): number {
  return appConfig?.concurrency?.[key] ?? DEFAULT_LOOKUP_CONCURRENCY[key];
}