Configuration for the generic openai-compatible provider: any endpoint that speaks the OpenAI /chat/completions API, such as Groq, Together, Fireworks, a vLLM, LM Studio or llama.cpp server, or an internal gateway.
Nothing is known about the model up front, so the context window and completion reserve come from config, defaulting to the conservative OpenAICompatibleConfig.DEFAULT_CONTEXT_WINDOW and OpenAICompatibleConfig.DEFAULT_RESERVE_COMPLETION. Set them to the model's real limits so context compression neither truncates early nor overflows.
Prefer OpenAICompatibleConfig.fromValues, which validates the values, over the primary constructor.
Value parameters
- apiKey
-
sent as
Authorization: Bearer <key>;Nonesends noAuthorizationheader, for servers that need none. Redacted intoString. - baseUrl
-
API base URL; requests go to
<baseUrl>/chat/completions. - contextWindow
-
the model's total token capacity (prompt + completion).
- headers
-
extra headers sent on every request, e.g. a gateway's own auth header. Values are redacted in
toString. - model
-
model identifier sent in every request.
- reserveCompletion
-
tokens held back from prompt history for the completion.
Attributes
- Companion
- object
- Graph
-
- Supertypes
-
trait Serializabletrait Producttrait Equalstrait ProviderConfigclass Objecttrait Matchableclass Any