unified-llm-client
    Preparing search index...

    Class LLMClient

    Unified entry point for provider-agnostic completions, streaming, conversations, routing, and usage logging.

    const client = LLMClient.fromEnv({
    defaultModel: 'gpt-4o',
    });

    const response = await client.complete({
    messages: [{ content: 'Say hello.', role: 'user' }],
    });
    Index

    Constructors

    Properties

    models: {
        get: (modelId: string) => ModelInfo;
        list: () => ModelInfo[];
        listRemote: (options: RemoteModelListOptions) => Promise<RemoteModelInfo[]>;
        register: (model: ModelInfo) => ModelInfo;
    }
    googleCaches: {
        create: (
            options: GeminiCreateCacheOptions,
        ) => Promise<GeminiCachedContent>;
        delete: (name: string) => Promise<void>;
        get: (name: string) => Promise<GeminiCachedContent>;
        list: (
            options?: GeminiListCachesOptions,
        ) => Promise<GeminiCachedContentPage>;
        update: (
            name: string,
            options: GeminiUpdateCacheOptions,
        ) => Promise<GeminiCachedContent>;
    }

    Methods

    • Creates a client that reads provider credentials from the current environment.

      Parameters

      • options: Omit<LLMClientOptions, "anthropicApiKey" | "geminiApiKey" | "openaiApiKey"> = {}

      Returns LLMClient