ProviderModelTypes

org.llm4s.types.ProviderModelTypes

Type-safe identifier types for the multi-provider configuration system.

Each identifier is an opaque type over String, giving distinct compile-time types to values that are otherwise interchangeable raw strings. This makes it a compile error to pass, for example, an ApiKey where a ModelName is expected, at zero runtime cost.

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Members list

Type members

Classlikes

object ApiKey

Companion for the ApiKey opaque type.

Companion for the ApiKey opaque type.

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
ApiKey.type
object BaseUrl

Companion for the BaseUrl opaque type.

Companion for the BaseUrl opaque type.

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
BaseUrl.type
object ModelName

Companion for the ModelName opaque type.

Companion for the ModelName opaque type.

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
ModelName.type
object ProviderId

Companion for the ProviderId opaque type.

Companion for the ProviderId opaque type.

The asString extension lives here rather than alongside the other as* extensions above because every newtype in this object erases to String: a second asString at that level would be a double definition after erasure. Companion-scoped extensions are found through the opaque type's implicit scope, so id.asString resolves without an extra import.

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
ProviderId.type
object ProviderName

Companion for the ProviderName opaque type.

Companion for the ProviderName opaque type.

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type

Types

opaque type ApiKey

A secret key used to authenticate with a provider.

A secret key used to authenticate with a provider.

Attributes

opaque type BaseUrl

The base URL of a provider's API endpoint, e.g. "https://api.openai.com/v1".

The base URL of a provider's API endpoint, e.g. "https://api.openai.com/v1".

Attributes

opaque type ModelName

A model identifier, e.g. "gpt-4o" or "claude-sonnet-4-5".

A model identifier, e.g. "gpt-4o" or "claude-sonnet-4-5".

Attributes

opaque type ProviderId

The canonical identifier of an LLM provider implementation, e.g. "openai".

The canonical identifier of an LLM provider implementation, e.g. "openai".

This is an open vocabulary, not an enumeration: any string names a provider, and whether that provider can actually be resolved is decided at resolution time, not at parse time. That is what allows a provider to be supplied by a module llm4s-core has never heard of — see #1131.

Values are canonicalised on construction to trimmed lowercase, so ProviderId(" OpenAI ") and ProviderId("openai") are equal and share a single spelling in error messages and config.

Attributes

opaque type ProviderName

A provider identifier, e.g. "openai" or "anthropic".

A provider identifier, e.g. "openai" or "anthropic".

Attributes

Extensions

Extensions

extension (value: ModelName)
def asString: String

Returns the underlying model name string.

Returns the underlying model name string.

Attributes

extension (value: BaseUrl)
def asUrl: String

Returns the underlying base URL string.

Returns the underlying base URL string.

Attributes

extension (value: ApiKey)
def asKey: String

Returns the underlying key string.

Returns the underlying key string.

Attributes

extension (value: ProviderName)
def asName: String

Returns the underlying provider name string.

Returns the underlying provider name string.

Attributes