/** * OpenAI-compatible provider adapter. * * Creates an OpenAI client pointed at a custom base URL, enabling use with * any OpenAI-compatible API server (e.g. Ollama, LM Studio, vLLM, Together AI). * * Reuses all tool conversion, message conversion, and response normalisation * logic from OpenAIAdapter by extending it with a custom base URL and a * default API key of "not-needed" (required by the openai SDK but ignored * by servers like Ollama that don't require authentication). */ import { OpenAIAdapter } from "./openai.js"; import type { ChatParams, ChatResponse, LLMClient } from "./types.js"; /** * LLMClient implementation for OpenAI-compatible endpoints. * * Extends OpenAIAdapter with a required `endpoint` (baseURL) parameter. * All tool conversion and response normalisation is inherited from * OpenAIAdapter — only the client configuration differs. * * Usage example (Ollama): * ```ts * const client = new OpenAICompatAdapter( * "http://localhost:11434/v1", * "llama3", * ); * ``` */ export declare class OpenAICompatAdapter extends OpenAIAdapter implements LLMClient { /** * CostMeter lookups from the inherited `chat()` must use DeepSeek/Grok * prices, not OpenAI's — override the discriminator (sc-2-3). */ protected readonly costProvider: "openai-compat"; /** * @param endpoint - Required base URL of the OpenAI-compatible server * (e.g. "http://localhost:11434/v1" for Ollama). * @param model - Model identifier to use with this server. * @param apiKey - Optional API key. Defaults to "not-needed" for servers * that do not require authentication (e.g. Ollama). */ constructor(endpoint: string, model: string, apiKey?: string); /** * OpenAI-compatible endpoints (DeepSeek, Grok, Ollama, LM Studio, …) have no * standard file/document-input surface. Rather than inherit OpenAIAdapter's * `file` content-part rendering and let the upstream endpoint reject it (or, * worse, silently ignore it), fail loudly so the caller routes documents to a * provider that supports them. Requests without `documents` delegate * unchanged to OpenAIAdapter. */ chat(params: ChatParams): Promise; } //# sourceMappingURL=openai-compat.d.ts.map