llmwire - v2.2.0
    Preparing search index...

    Class OpenAICompatibleProvider

    Any server speaking the OpenAI chat-completions dialect: OpenAI itself, LM Studio, Groq, OpenRouter, DeepSeek, Mistral, xAI, Together, vLLM, ...

    Hierarchy (View Summary)

    Index
    _supportedModels: string[] = []
    apiKey?: string
    baseConfig: BaseProviderConfig
    v1: string
    • get baseURL(): string

      Origin this provider talks to; shown in PROVIDER_UNREACHABLE hints.

      Returns string

    • A fresh AIError for a failure this provider detects itself (no key, no model, blocked answer).

      Parameters

      • code: AIErrorCode
      • message: string
      • extra: { details?: unknown; hint?: string; model?: string } = {}

      Returns AIError

    • Streaming request: the body as an async iterable of bytes, idle-guarded. Non-2xx throws [HttpError].

      Parameters

      Returns Promise<AsyncIterable<Uint8Array>>

    • Streams a completion. The default runs the ordinary [process] and hands back its answer as a single chunk, so every provider can be consumed as a stream even where the upstream API has no streaming endpoint -- callers write one code path instead of two. Providers that do stream override it.

      Parameters

      Returns AsyncGenerator<AIStreamChunk, void, void>

    • Records what discovery found, keeping any seeded models first so the caller's chosen default stays the default.

      Parameters

      • ids: string[]

      Returns string[]