Interface for LLM (Large Language Model) providers.

Implementations provide access to AI models like GPT-4, Claude, etc.

class OpenAIProvider implements LLMProvider {
readonly name = 'openai';
readonly models = ['gpt-4', 'gpt-4-turbo', 'gpt-3.5-turbo'];

async chat(params: ChatParams): Promise<ChatResponse> {
// Call OpenAI API
}
}
interface LLMProvider {
    name: string;
    models: string[];
    chat(params: ChatParams): Promise<ChatResponse>;
    streamChat(params: ChatParams): AsyncIterable<ChatChunk>;
    embeddings(params: EmbeddingParams): Promise<EmbeddingResponse>;
}

Methods

Properties

name: string

Unique name of the provider (e.g., 'openai', 'anthropic', 'local')

models: string[]

List of supported models