VertexAIProvider

org.llm4s.llmconnect.provider.VertexAIProvider
@Stable

Registration for Google Cloud Vertex AI.

A section names the GCP project (required) and location (default us-central1), both provider-specific keys, and may set apiKey to a path to a service-account credential file - Vertex authenticates with OAuth2, not an API key. With no apiKey it uses Application Default Credentials. It therefore has no llm4s.credentials.vertexai block: there is no vendor API key to share.

vertex-main {
 provider = "vertexai"
 model    = "gemini-2.0-flash"
 project  = "my-gcp-project"
 location = "europe-west4"
}

Until #1215 the project was read from endpoint and the location from organization. Both still work as deprecated aliases, with a warning, and will be removed in a later release.

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Members list

Value members

Concrete methods

Constructs the client for a ProviderConfig this provider produced.

Constructs the client for a ProviderConfig this provider produced.

config is whatever the caller passed, so implementations must check the type rather than cast — ProviderDescriptor.expectConfig does that and produces the standard mismatch error.

Attributes

def buildConfig(providerName: String, section: NamedProviderConfig)(using ContextWindowResolver): Result[ProviderConfig]

Turns a validated config section into the runtime ProviderConfig for this provider.

Turns a validated config section into the runtime ProviderConfig for this provider.

The section has already been checked against configSpec, so required fields are present and section.extras holds exactly the declared provider-specific keys that have a value (defaults applied, deprecated aliases resolved). A Left here means something configSpec cannot express (a malformed value, say).

Value parameters

providerName

the user's instance name (llm4s.providers.<name>), for error messages.

Attributes

Inherited methods

What this provider's client implements. Defaults to the full interface.

What this provider's client implements. Defaults to the full interface.

Attributes

Inherited from:
ProviderDescriptor

Live model discovery, when the provider's API offers it.

Live model discovery, when the provider's API offers it.

Attributes

Inherited from:
ProviderDescriptor

Concrete fields

val LocationKey: String

The key naming the GCP region.

The key naming the GCP region.

Attributes

val ProjectKey: String

The key naming the GCP project.

The key naming the GCP project.

Attributes

override val aliases: Set[String]

provider = "vertex" has always been accepted.

provider = "vertex" has always been accepted.

Attributes

Which config fields this provider requires, its default endpoint, and the provider-specific keys (ProviderConfigSpec.extras) its section accepts.

Which config fields this provider requires, its default endpoint, and the provider-specific keys (ProviderConfigSpec.extras) its section accepts.

Attributes

val id: ProviderId

Canonical id, e.g. ProviderId("openai"). Must be unique within a registry.

Canonical id, e.g. ProviderId("openai"). Must be unique within a registry.

Attributes