Skip to content

service_tier when using Vertex AI #2433

@csanz91

Description

@csanz91

When using the @google/python-genai SDK with vertexai: true, the service_tier field in GenerateContentConfigOrDict has no effect. The SDK places service_tier in the JSON request body, but the Vertex AI API does not read flex/priority tier configuration from the request body. It uses HTTP headers (X-Vertex-AI-LLM-Request-Type and X-Vertex-AI-LLM-Shared-Request-Type).

The request with service_tier in the google-ai api works fine.

This exact same issue has been reported in: googleapis/java-genai#972 and googleapis/js-genai#1468

Error raised is:

    "code": 400,
    "message": "Invalid value at 'service_tier' (type.googleapis.com/google.cloud.aiplatform.v1beta1.ServiceTier), \"priority\"",
    "status": "INVALID_ARGUMENT",
    "details": [
      {
        "@type": "type.googleapis.com/google.rpc.BadRequest",
        "fieldViolations": [
          {
            "field": "service_tier",
            "description": "Invalid value at 'service_tier' (type.googleapis.com/google.cloud.aiplatform.v1beta1.ServiceTier), \"priority\""
          }
        ]
      }
    ]
  }

Metadata

Metadata

Assignees

Labels

priority: p2Moderately-important priority. Fix may not be included in next release.status:awaiting user responsetype: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions