NamedProviderConfig

org.llm4s.config.ProvidersConfigModel.NamedProviderConfig
See theNamedProviderConfig companion object
final case class NamedProviderConfig

Validated and normalised configuration for a single named provider.

Value parameters

apiKey

provider-dependent credential: an API key for most providers, or a path to a service-account credentials file for VertexAI

auth

the section's workload-identity block, if any: the identity token to exchange and the keys its provider declares in ProviderConfigSpec.authExtras. Validation guarantees it is never set together with apiKey. Redacted in toString.

baseUrl

optional base URL override

extras

the provider-specific keys its descriptor declares in ProviderConfigSpec.extras, as validation leaves them: required ones present, defaults filled in, deprecated aliases resolved to the current name, and undeclared keys dropped. Values are redacted in toString, since a provider may declare a credential here. Vendor-specific settings live here rather than as fields - Azure's endpoint and apiVersion, OpenAI's organization, the generic openai-compatible provider's contextWindow and reserveCompletion - so that this type does not change as providers come and go.

headers

extra HTTP headers sent on every request; read by openai-compatible and the OpenAI-format model listers, and ignored by the rest. Values are redacted in toString.

model

the model name to use

provider

the resolved ProviderId

timeouts

the section's timeouts block: how long a request and a stream may take. Absent values leave each client on its own default (org.llm4s.llmconnect.config.ProviderTimeouts). Every provider that makes HTTP calls reads it, so it is a built-in field like headers, not an extra.

Attributes

Companion
object
Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Members list

Value members

Concrete methods

def baseUrlOrDefault(default: => String): BaseUrl

Returns the configured base URL, falling back to default when absent.

Returns the configured base URL, falling back to default when absent.

Value parameters

default

by-name fallback string used to construct a BaseUrl

Attributes

Returns

the configured or default BaseUrl

def extra(key: String): Option[String]

The value of a provider-specific key, as validation left it.

The value of a provider-specific key, as validation left it.

Value parameters

key

a key the provider declares in ProviderConfigSpec.extras

Attributes

Returns the configured API key or fails with a ConfigurationError if absent.

Returns the configured API key or fails with a ConfigurationError if absent.

Attributes

Returns

Right(ApiKey) when present, or Left with an error

Returns the configured base URL or fails with a ConfigurationError if absent.

Returns the configured base URL or fails with a ConfigurationError if absent.

Attributes

Returns

Right(BaseUrl) when present, or Left with an error

Returns this config if its provider matches expected, otherwise a ConfigurationError.

Returns this config if its provider matches expected, otherwise a ConfigurationError.

Value parameters

expected

the ProviderId that is required

Attributes

Returns

Right(this) when the provider matches, or Left with a descriptive error

override def toString: String

Returns a string representation of the object.

Returns a string representation of the object.

The default representation is platform dependent.

Attributes

Returns

a string representation of the object.

Definition Classes
Any
def withApiKey(apiKey: Option[ApiKey]): NamedProviderConfig
def withBaseUrl(baseUrl: Option[BaseUrl]): NamedProviderConfig
def withExtras(extras: Map[String, String]): NamedProviderConfig
def withHeaders(headers: Map[String, String]): NamedProviderConfig

Inherited methods

def productElementNames: Iterator[String]

Attributes

Inherited from:
Product
def productIterator: Iterator[Any]

Attributes

Inherited from:
Product