Llm4sSettings

org.llm4s.config.Llm4sSettings
@Experimental
final class Llm4sSettings

The llm4s settings of one configuration the application supplied, from Llm4sConfig.from.

Each method reads that configuration exactly as the method of the same name on Llm4sConfig reads the process-wide one: the same keys, the same validation (only the section being loaded), the same credential fallback to llm4s.credentials.<providerId>.apiKey and the same errors. Instances are immutable and independent, so an application can hold one per tenant, or a test one per case, in the same JVM.

Attributes

Example
// appConfig: the com.typesafe.config.Config the application loaded, with an
// llm4s.providers block such as  provider = "main", main { provider = "openai", model = "gpt-4o-mini" }
for {
 settings <- Llm4sConfig.from(appConfig)
 registry <- settings.modelRegistryService()
 cfg      <- settings.defaultProvider()
 client   <- LLMConnect.getClient(cfg)(using registry)
} yield client

Experimental, as Llm4sConfig.from is.

Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Value members

Concrete methods

As Llm4sConfig.apiKeySources: where each chat section's API key comes from.

As Llm4sConfig.apiKeySources: where each chat section's API key comes from.

Attributes

As Llm4sConfig.defaultProvider: the default section; only that section is validated.

As Llm4sConfig.defaultProvider: the default section; only that section is validated.

Attributes

As Llm4sConfig.defaultProviderName: the name llm4s.providers.provider sets.

As Llm4sConfig.defaultProviderName: the name llm4s.providers.provider sets.

Attributes

As Llm4sConfig.embeddings: the embedding provider llm4s.embeddings.model selects.

As Llm4sConfig.embeddings: the embedding provider llm4s.embeddings.model selects.

Attributes

As Llm4sConfig.exchangeLogging: the optional llm4s.exchangeLogging block.

As Llm4sConfig.exchangeLogging: the optional llm4s.exchangeLogging block.

Attributes

As Llm4sConfig.httpNetwork: the proxy and TLS settings of the llm4s.http block.

As Llm4sConfig.httpNetwork: the proxy and TLS settings of the llm4s.http block.

Attributes

As Llm4sConfig.listModels: the default provider's models.

As Llm4sConfig.listModels: the default provider's models.

Attributes

def listModels(name: String)(using ProviderRegistry): Result[List[DiscoveredModel]]

As Llm4sConfig.listModels: the models of the section name.

As Llm4sConfig.listModels: the models of the section name.

Attributes

As Llm4sConfig.modelRegistryConfig: the llm4s.modelRegistry block.

As Llm4sConfig.modelRegistryConfig: the llm4s.modelRegistry block.

Attributes

As Llm4sConfig.modelRegistryService: the model registry llm4s.modelRegistry selects.

As Llm4sConfig.modelRegistryService: the model registry llm4s.modelRegistry selects.

Attributes

def provider(name: String)(using ProviderRegistry): Result[ProviderConfig]

As Llm4sConfig.provider: the named section llm4s.providers.<name>.

As Llm4sConfig.provider: the named section llm4s.providers.<name>.

Attributes

As Llm4sConfig.providerConfigs: every section, each section's error reported separately.

As Llm4sConfig.providerConfigs: every section, each section's error reported separately.

Attributes

As Llm4sConfig.providers: the whole llm4s.providers block, every section validated.

As Llm4sConfig.providers: the whole llm4s.providers block, every section validated.

Attributes

As Llm4sConfig.textEmbeddingModel: the active embedding model and its dimensions.

As Llm4sConfig.textEmbeddingModel: the active embedding model and its dimensions.

Attributes

As Llm4sConfig.tracing: the llm4s.tracing block.

As Llm4sConfig.tracing: the llm4s.tracing block.

Attributes