Registration for the generic openai-compatible provider: any endpoint speaking the OpenAI /chat/completions API, with no module and no code.
A named provider section with provider = "openai-compatible" needs a baseUrl and a model; apiKey is optional (local servers need none), and contextWindow, reserveCompletion and headers may be set. Several sections can use it side by side:
The client is OpenAICompatibleClient with the standard dialect: no reasoning parameters and no provider-specific decoding. A provider that needs those gets its own OpenAICompatibleDialect and descriptor in this module.
Constructs the client for a ProviderConfig this provider produced.
Constructs the client for a ProviderConfig this provider produced.
config is whatever the caller passed, so implementations must check the type rather than cast — ProviderDescriptor.expectConfig does that and produces the standard mismatch error.
Turns a validated config section into the runtime ProviderConfig for this provider.
Turns a validated config section into the runtime ProviderConfig for this provider.
The section has already been checked against configSpec, so required fields are present; a Left here means something configSpec cannot express (a malformed value, say).
Value parameters
providerName
the user's instance name (llm4s.providers.<name>), for error messages.