# Material Agent Service -- Environment Configuration
# Copy this file to .env and fill in your actual values.
# You only need a key for the VLM provider you plan to use.

# ==================== VLM Provider Keys (pick at least one) ====================

# NVIDIA NIM (https://build.nvidia.com/)
NVIDIA_API_KEY=your_nvidia_api_key_here

# OpenAI (https://platform.openai.com/api-keys)
OPENAI_API_KEY=your_openai_api_key_here

# Anthropic (https://console.anthropic.com/settings/keys)
ANTHROPIC_API_KEY=your_anthropic_api_key_here

# Google Gemini (https://aistudio.google.com/apikey)
GOOGLE_API_KEY=your_google_api_key_here

# ==================== Render / Optimizer Endpoints ====================
# Set RENDER_ENDPOINT / OPTIMIZER_ENDPOINT to a full URL (e.g. local OVRTX),
# or set NVCF_*_FUNCTION_ID to target an NVCF deployment.
# RENDER_ENDPOINT=http://ovrtx-rendering-api:8000
# OPTIMIZER_ENDPOINT=http://localhost:8002
# NVCF_RENDER_FUNCTION_ID=your_render_function_id
# NVCF_OPTIMIZER_FUNCTION_ID=your_optimizer_function_id

# NGC API key (required for NVCF function invocation)
# NGC_API_KEY=your_ngc_api_key_here

# ==================== AWS (optional, for S3 session storage) ====================
# AWS_ACCESS_KEY_ID=your_aws_access_key_id
# AWS_SECRET_ACCESS_KEY=your_aws_secret_access_key

# ==================== Service Configuration ====================
MA_SESSION_STORAGE_PATH=/var/material-agent/sessions
MA_SESSION_TTL_HOURS=24
MA_MAX_UPLOAD_SIZE_MB=500
# Exact bucket names, comma/space separated. Empty rejects all client s3_uri inputs.
MA_S3_ALLOWED_BUCKETS=
MA_GEOM_LIMIT=0
MA_DEBUG=false
MA_PROGRESS_POLL_INTERVAL_SECONDS=2

# ==================== Renderer Configuration ====================
MA_IMAGE_WIDTH=512
MA_IMAGE_HEIGHT=512
# Supported: remote (default), warp, ovrtx, and mock (tests only).
# WSL2 fixed-pipeline deployments use warp; local ovrtx is not supported in WSL2.
MA_RENDERER_BACKEND=remote
# Compose-only GPU selector. Set it in the shell or the file passed to
# `docker compose --env-file`; the service does not read this variable.
MA_WARP_GPU_DEVICE_ID=0
MA_CULL_STYLE=back
MA_SHOULD_HIGHLIGHT_PRIM=true
MA_SHOULD_ASSIGN_RANDOM_COLORS=true
MA_CAMERA_PRIM_WITH_STAGE_MARGIN=3.0
MA_USE_BACKGROUND_COLOR=true
MA_SHOULD_RESET_MATERIALS=true
MA_USE_LIGHTS=false

# Highlight color (RGB 0-1, default green)
# MA_HIGHLIGHT_COLOR=[0.0, 0.8, 0.0]
# MA_OTHER_COLOR_RANGE=[0.1, 0.2]
# MA_BACKGROUND_COLOR=[0, 0, 0]

# ==================== Worker Configuration ====================
MA_MAX_ACTIVE_SESSIONS=1
MA_MAX_RENDER_NUM_WORKERS=1
WU_NVCF_GLOBAL_MAX_CONCURRENT_REQUESTS=1
# Process-wide cap on hosted NIM model requests (0 disables it)
WU_NIM_HOSTED_MAX_CONCURRENT_REQUESTS=4

# ==================== Prim Clustering Configuration ====================
# Opt-in via service request field enable_prim_clustering=true.
MA_CLUSTER_EMBEDDING_BACKEND=nim
MA_CLUSTER_EMBEDDING_MODEL=nvidia/llama-nemotron-embed-vl-1b-v2
# MA_CLUSTER_EMBEDDING_BASE_URL=
MA_CLUSTER_EMBEDDING_MAX_WORKERS=4
MA_CLUSTER_EMBEDDING_BATCH_SIZE=50
MA_CLUSTER_MIN_PRIMS=50
MA_CLUSTER_MAX_SIZE=25
# MA_CLUSTER_EMBEDDING_API_KEY=not-used

# ==================== VLM/LLM Configuration ====================
# Individual VLM configuration (auto-set by config mode, override if needed)
MA_VLM_BACKEND=nim
MA_VLM_MODEL=nvidia/nemotron-3.5-super-vl-120b-a12b
MA_VLM_TEMPERATURE=1.0
MA_VLM_MAX_TOKENS=24576

MA_LLM_BACKEND=nim
MA_LLM_MODEL=nvidia/nemotron-3.5-super-vl-120b-a12b
MA_LLM_TEMPERATURE=0.0
MA_LLM_MAX_TOKENS=1024

# Generated reference images and generated material-library textures. Default
# uses public Gemini (GOOGLE_API_KEY). Set MA_IMAGE_GEN_BACKEND=openai with
# OPENAI_API_KEY to use OpenAI Images instead.
MA_IMAGE_GEN_BACKEND=gemini
# MA_IMAGE_GEN_MODEL=gemini-3-pro-image-preview
# MA_IMAGE_GEN_BASE_URL=
# MA_IMAGE_GEN_API_KEY=not-used  # Only for explicit no-auth local endpoints

# ==================== Camera Views Configuration ====================
# MA_DEFAULT_CAMERA_VIEWS=["+x+y+z", "-x-y-z"]
# MA_RENDERING_MODES=["prim_with_stage", "prim_only"]
# MA_CAMERA_VIEW_TYPE=corner
# MA_CAMERA_MARGIN=2.0
