This document details the environment variables used in the application, as defined in config/default.py. These variables control infrastructure settings, model versions, storage locations, and feature configurations.
Quick Start: A dotenv.template file is provided in the root directory. To set up your local environment, copy this file to .env and populate the values:
These variables define the fundamental operating context of the application.
Variable
Default
Description
PROJECT_ID
None (Required)
The Google Cloud Project ID where resources (Google Cloud AI, Firestore, Storage) are located.
LOCATION
us-central1
The default GCP region for most services (Google Cloud AI, etc.).
VERTEX_API_VERSION
v1beta1
The Vertex AI API version used for all google-genai client initializations. Override to switch the API surface in one place.
APP_ENV
"" (Empty)
Defines the environment name (e.g., dev, godemos). This is used as a metadata tag on the Config page.
GMCS_OVERRIDE_PATH
None
(Development Only) An absolute path to a directory containing configuration overrides. If a file exists in this path (e.g., config/about_content.json), the app will prioritize it over the local version.
API_BASE_URL
http://localhost:{PORT}
The base URL for the application’s backend APIs.
PORT
8080
The port the application server listens on.
SERVICE_ACCOUNT_EMAIL
None
The email of the service account used for authentication, if applicable.
GA_MEASUREMENT_ID
None
Google Analytics Measurement ID for tracking user interactions.
REQUIRE_AUTHENTICATED_USER
true outside local/dev/test, otherwise false
Reject non-health requests that do not include a trusted upstream identity header. Set this to true behind Netskope NPA/oauth2-proxy or IAP.
AUTH_EMAIL_HEADERS
IAP + oauth2-proxy/Netskope defaults
Comma-separated trusted request headers to inspect for the authenticated user email. Defaults: X-Goog-Authenticated-User-Email, X-Auth-Request-Email, X-Forwarded-Email, X-Email, X-Authenticated-User.
Controls which versions of the Gemini models are used for various tasks.
Variable
Default
Description
MODEL_ID
gemini-3.5-flash
The primary Gemini model used for general text and reasoning tasks throughout the app.
GEMINI_LOCATION
global
Region for Gemini 3.x model calls. Gemini 3.x is served only from the global endpoint (and the us/eu multi-regions), so this is kept separate from LOCATION.
GEMINI_TTS_LOCATION
global
Region for Gemini text-to-speech (TTS) model calls.
GEMINI_IMAGE_GEN_MODEL
gemini-nano-banana-2.1
The default model used for image generation features (supports gemini-nano-banana-2.1 (default), gemini-3.1-flash-lite-image, gemini-3.1-flash-image, or gemini-3-pro-image).
GEMINI_IMAGE_GEN_LOCATION
global
The region for the Gemini Image Generation API.
GEMINI_AUDIO_ANALYSIS_MODEL_ID
gemini-3.1-flash-lite
The model used specifically for analyzing audio content.
GEMINI_WRITERS_WORKSHOP_MODELS
gemini-4-argon,gemini-3.8-flash
Comma-separated models offered in the Gemini Writers Workshop model picker.
GEMINI_WRITERS_WORKSHOP_MODEL_ID
gemini-4-argon
The model preselected in the Gemini Writers Workshop picker (added to the picker if not listed in GEMINI_WRITERS_WORKSHOP_MODELS).
Specific configuration for the Object Rotation workflow.
Variable
Default
Description
OBJECT_ROTATION_VIDEO_MODEL
gemini-omni-1.2-flash
The video model used for 360-degree rotation videos. A gemini-omni-* name uses Gemini Omni reference-to-video; a veo-* name (for example veo-3.1-generate-001) uses Veo.
OBJECT_ROTATION_IMAGE_MODEL
gemini-nano-banana-2.1
The specific Gemini image model used for generating multi-angle views.
Specific configuration for the Interior Design workflow.
Variable
Default
Description
INTERIOR_DESIGN_VIDEO_MODEL
gemini-omni-1.2-flash
The video model used for 3D walkthrough video segments. A gemini-omni-* name uses Gemini Omni image-to-video; a veo-* name (for example veo-3.1-lite-generate-001) uses Veo.
INTERIOR_DESIGN_IMAGE_MODEL
gemini-nano-banana-2.1
The specific Gemini image model used for floor plan to 3D and styled images.
INTERIOR_DESIGN_VIDEO_DURATION
6
The duration in seconds for each generated video segment.
Controls how many items appear per page in the media library.
USE_MEDIA_PROXY
true
If true, media URLs are proxied through the app’s /media route. If false and SERVICE_ACCOUNT_EMAIL is set, media URLs are cached V4 signed storage.googleapis.com URLs (50 minute cache, 60 minute validity) signed by that service account, which needs roles/iam.serviceAccountTokenCreator on itself; this works for users who cannot be granted bucket access, such as cross-tenant IAP users. If false without a service account, plain storage.cloud.google.com links are used.
SHARED_LIBRARY
true
If true, any authenticated user can open items from the Library’s “All Users” view in the detail viewer (read-only). If false, Library reads are owner-only and the “All Users” toggle is hidden. Edit, overwrite and delete are always owner-only regardless of this setting.
When deploying this application using Terraform (via main.tf), not all environment variables are exposed for configuration. The Terraform setup manages a specific subset of variables, primarily those related to infrastructure and core model IDs.
These variables are exposed in variables.tf and directly map to environment variables in the Cloud Run service. You can customize these by setting the corresponding Terraform variable during deployment.
These variables are computed within main.tf based on the resources Terraform creates (e.g., bucket names, service account emails). You generally cannot change these via variables.tf as they ensure the application correctly connects to the provisioned infrastructure.
App Env Var
Source in main.tf
Value Logic
GENMEDIA_BUCKET
local.asset_bucket_name
creative-studio-{project_id}-assets
VIDEO_BUCKET
local.asset_bucket_name
Same as above
MEDIA_BUCKET
local.asset_bucket_name
Same as above
IMAGE_BUCKET
local.asset_bucket_name
Same as above
GCS_ASSETS_BUCKET
local.asset_bucket_name
Same as above
GENMEDIA_FIREBASE_DB
Resource Attribute
Name of the created Firestore DB
SERVICE_ACCOUNT_EMAIL
Resource Attribute
Email of the created Service Account
LYRIA_PROJECT_ID
var.project_id
Forces Lyria to use the main project ID
3. Variables NOT Set by Terraform (Using Python Defaults)
The following variables are not explicitly set in the main.tf configuration. This means the application will use the default values defined in config/default.py when deployed via Terraform.
Gemini Models:GEMINI_IMAGE_GEN_MODEL (supports Nano Banana 2 Lite gemini-3.1-flash-lite-image), GEMINI_IMAGE_GEN_LOCATION, GEMINI_AUDIO_ANALYSIS_MODEL_ID