VertexAIConfig

org.llm4s.llmconnect.config.VertexAIConfig
See theVertexAIConfig companion object
@Stable
final case class VertexAIConfig extends ProviderConfig

Configuration for Google Cloud Vertex AI.

Uses the Gemini-compatible REST format (aiplatform.googleapis.com) with OAuth2 bearer-token authentication via Application Default Credentials (ADC).

Prefer VertexAIConfig.fromValues, which validates the values and resolves contextWindow and reserveCompletion from the bundled model catalogue. The constructor is private: build one with the companion apply and adjust it with the with* setters. Java and Kotlin, which cannot see Scala default arguments, use VertexAIConfig.apply(projectId, model) and the setters, so adding a field never breaks them.

Value parameters

contextWindow

Maximum token capacity for prompt + completion combined.

credentialFilePath

Optional path to a Google JSON credential file. Falls back to GOOGLE_APPLICATION_CREDENTIALS env, then gcloud's application_default_credentials.json ($CLOUDSDK_CONFIG if set; else %APPDATA%\gcloud on Windows; else ~/.config/gcloud), then the GCE metadata server.

location

GCP region, e.g. "us-central1".

model

Model identifier, e.g. "gemini-2.0-flash".

projectId

GCP project ID that owns the Vertex AI resources.

reserveCompletion

Tokens reserved for the completion response.

timeouts

how long a request and a stream may take: the section's timeouts block. An absent value keeps the client's own default (ProviderTimeouts)

wellKnownCredentialPath

where gcloud's well-known application_default_credentials.json would be, resolved at the configuration edge by org.llm4s.config.VertexAIAdcConfigLoader (the descriptor sets it when it builds the client). None skips that lookup.

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 computedBaseUrl: String

Base URL derived from the location, e.g. "https://us-central1-aiplatform.googleapis.com/v1".

Base URL derived from the location, e.g. "https://us-central1-aiplatform.googleapis.com/v1".

Attributes

override def endpointUrl: Option[String]

The endpoint this config will contact, when it is known statically.

The endpoint this config will contact, when it is known statically.

Used by policy checks and diagnostics that need to know where traffic will go without knowing which provider it belongs to. None means the config carries no single URL — not that it makes no network calls.

Attributes

Definition Classes
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 withContextWindow(contextWindow: Int): VertexAIConfig
def withCredentialFilePath(path: Option[String]): VertexAIConfig
def withGoogleSearch(enabled: Boolean): VertexAIConfig

Whether every request carries Vertex AI's googleSearch grounding tool; see GeminiConfig.googleSearch.

Whether every request carries Vertex AI's googleSearch grounding tool; see GeminiConfig.googleSearch.

Attributes

def withLocation(location: String): VertexAIConfig
override def withModel(model: String): VertexAIConfig

The same provider and credentials, pointed at a different model.

The same provider and credentials, pointed at a different model.

Attributes

Definition Classes

The same config with the given proxy and TLS settings.

The same config with the given proxy and TLS settings.

The loader calls this on every config a descriptor builds, as it does withTimeouts, so a descriptor does not read the http block itself. The default returns this: a config that does not carry the setting ignores it. A config that does overrides this with its own return type.

Attributes

Definition Classes
def withProjectId(projectId: String): VertexAIConfig
def withReserveCompletion(reserveCompletion: Int): VertexAIConfig
override def withTimeouts(timeouts: ProviderTimeouts): VertexAIConfig

The same config with the given timeouts.

The same config with the given timeouts.

The loader calls this on every config a descriptor builds, passing the section's timeouts block, so a descriptor does not read the block itself. The default returns this: a config that does not carry timeouts, such as one supplied by another module, ignores them. A config that does overrides this with its own return type.

Attributes

Definition Classes
def withWellKnownCredentialPath(path: Option[String]): VertexAIConfig

Inherited methods

def productElementNames: Iterator[String]

Attributes

Inherited from:
Product
def productIterator: Iterator[Any]

Attributes

Inherited from:
Product

Concrete fields

override val providerId: ProviderId

Canonical id of the provider this config addresses, e.g. ProviderId("openai").

Canonical id of the provider this config addresses, e.g. ProviderId("openai").

Attributes