org.llm4s.llmconnect.spi.ProviderDescriptor
See theProviderDescriptor companion object
trait ProviderDescriptor
Everything llm4s needs to know about one LLM provider, supplied by the provider itself.
A descriptor is the whole extension point: implement it, register it (by listing it in an Llm4sProviderModule, or by handing it to ProviderRegistry.of), and the provider becomes reachable from configuration, validation, client construction and model discovery without editing anything in llm4s-core. Before this existed, adding a provider meant edits to roughly eight shared files — see #1131.
Attributes
- Example
-
object BedrockProvider extends ProviderDescriptor: val id = ProviderId("bedrock") val configSpec = ProviderConfigSpec(requiresApiKey = true, requiresEndpoint = true) def buildConfig(providerName: String, section: NamedProviderConfig)(using ContextWindowResolver ): Result[ProviderConfig] = ... def buildClient(config: ProviderConfig, options: LlmClientOptions)(using ModelRegistryService ): Result[LLMClient] = ProviderDescriptor.expectConfig[BedrockConfig](id, config).flatMap(BedrockClient(_, options.metrics)) - Companion
- object
- Graph
-
- Supertypes
-
class Objecttrait Matchableclass Any
- Known subtypes
-
object AnthropicProviderobject AzureProviderobject CohereProviderobject DeepSeekProviderobject GeminiProviderobject MistralProviderobject OllamaProviderobject OpenAIProviderobject OpenRouterProviderobject RequestyProviderobject VertexAIProviderobject ZaiProvider
Members list
In this article