Is your feature request related to a problem? Please describe.
Currently, when using the generate_content function in Vertex AI Generative Models, there is no way to pass request-level labels that can be used for cost attribution, observability, monitoring, or governance. This makes it difficult to track and categorize LLM usage across different applications, environments (e.g., dev, staging, prod), teams, or workloads, especially in larger organizations where labels are a key part of resource management.
Describe the solution you'd like
I would like the generate_content function to officially support a labels: Dict[str, str] parameter, allowing users to attach custom labels to each generation request. These labels should propagate to the underlying Vertex AI request so they can be used consistently for billing analysis, logging, monitoring, and auditing, similar to how labels work across other Google Cloud resources.
Describe alternatives you've considered
As a workaround, we considered embedding metadata inside prompts or maintaining external mappings between requests and labels. However, these approaches are error-prone, hard to standardize, and do not integrate with Google Cloud’s native labeling, billing, and observability tools.
Additional context
Labels are a first-class concept across Google Cloud and are widely used for cost allocation, governance, and operational visibility. Supporting labels directly in generate_content would greatly improve enterprise adoption and align Vertex AI Generative Models with existing GCP best practices and resource management workflows.
Is your feature request related to a problem? Please describe.
Currently, when using the generate_content function in Vertex AI Generative Models, there is no way to pass request-level labels that can be used for cost attribution, observability, monitoring, or governance. This makes it difficult to track and categorize LLM usage across different applications, environments (e.g., dev, staging, prod), teams, or workloads, especially in larger organizations where labels are a key part of resource management.
Describe the solution you'd like
I would like the generate_content function to officially support a labels: Dict[str, str] parameter, allowing users to attach custom labels to each generation request. These labels should propagate to the underlying Vertex AI request so they can be used consistently for billing analysis, logging, monitoring, and auditing, similar to how labels work across other Google Cloud resources.
Describe alternatives you've considered
As a workaround, we considered embedding metadata inside prompts or maintaining external mappings between requests and labels. However, these approaches are error-prone, hard to standardize, and do not integrate with Google Cloud’s native labeling, billing, and observability tools.
Additional context
Labels are a first-class concept across Google Cloud and are widely used for cost allocation, governance, and operational visibility. Supporting labels directly in generate_content would greatly improve enterprise adoption and align Vertex AI Generative Models with existing GCP best practices and resource management workflows.