earendil-works/pi · error

Vertex AI requires a location. Set GOOGLE_CLOUD_LOCATION or

Error message

Vertex AI requires a location. Set GOOGLE_CLOUD_LOCATION or pass location in options.

What it means

Error "Vertex AI requires a location. Set GOOGLE_CLOUD_LOCATION or pass location in options." thrown in earendil-works/pi.

Source

Thrown at packages/ai/src/api/google-vertex.ts:453

}

function resolveProject(options?: GoogleVertexOptions): string {
	const project =
		options?.project ||
		getProviderEnvValue("GOOGLE_CLOUD_PROJECT", options?.env) ||
		getProviderEnvValue("GCLOUD_PROJECT", options?.env);
	if (!project) {
		throw new Error(
			"Vertex AI requires a project ID. Set GOOGLE_CLOUD_PROJECT/GCLOUD_PROJECT or pass project in options.",
		);
	}
	return project;
}

function resolveLocation(options?: GoogleVertexOptions): string {
	const location = options?.location || getProviderEnvValue("GOOGLE_CLOUD_LOCATION", options?.env);
	if (!location) {
		throw new Error("Vertex AI requires a location. Set GOOGLE_CLOUD_LOCATION or pass location in options.");
	}
	return location;
}

function buildParams(
	model: Model<"google-vertex">,
	context: Context,
	options: GoogleVertexOptions = {},
): GenerateContentParameters {
	const contents = convertMessages(model, context);

	const generationConfig: GenerateContentConfig = {};
	if (options.temperature !== undefined) {
		generationConfig.temperature = options.temperature;
	}
	if (options.maxTokens !== undefined) {
		generationConfig.maxOutputTokens = options.maxTokens;
	}

View on GitHub (pinned to 4af9d21d3b)

Solutions

  1. Set GOOGLE_CLOUD_LOCATION, or pass location in options.

When it happens

Trigger: Thrown at packages/ai/src/api/google-vertex.ts:453 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of earendil-works/pi@4af9d21d3b (2026-08-24). Data as JSON: /api/errors/7b9d11b927eca048. Report an issue: GitHub.