Skip to content

feat: add service_tier support for GCP Vertex Gemini provider#7471

Open
gopalvarun03 wants to merge 1 commit into
tensorzero:mainfrom
gopalvarun03:feature/gcp-vertex-gemini-service-tier
Open

feat: add service_tier support for GCP Vertex Gemini provider#7471
gopalvarun03 wants to merge 1 commit into
tensorzero:mainfrom
gopalvarun03:feature/gcp-vertex-gemini-service-tier

Conversation

@gopalvarun03
Copy link
Copy Markdown

Map service_tier inference parameter to Vertex AI HTTP headers:

  • auto: no headers (Vertex default)
  • default: X-Vertex-AI-LLM-Request-Type: shared
  • priority: X-Vertex-AI-LLM-Request-Type: shared + X-Vertex-AI-LLM-Shared-Request-Type: priority
  • flex: X-Vertex-AI-LLM-Request-Type: shared + X-Vertex-AI-LLM-Shared-Request-Type: flex

Changes:

  • Add get_service_tier_headers() helper function
  • Inject headers in infer() and infer_stream()
  • Remove unsupported warning from apply_inference_params()
  • Warn when service_tier is used with batch inference
  • Add unit tests for get_service_tier_headers()
  • Update apply_inference_params test to assert no false warning

Map service_tier inference parameter to Vertex AI HTTP headers:
- auto: no headers (Vertex default)
- default: X-Vertex-AI-LLM-Request-Type: shared
- priority: X-Vertex-AI-LLM-Request-Type: shared +
            X-Vertex-AI-LLM-Shared-Request-Type: priority
- flex: X-Vertex-AI-LLM-Request-Type: shared +
        X-Vertex-AI-LLM-Shared-Request-Type: flex

Changes:
- Add get_service_tier_headers() helper function
- Inject headers in infer() and infer_stream()
- Remove unsupported warning from apply_inference_params()
- Warn when service_tier is used with batch inference
- Add unit tests for get_service_tier_headers()
- Update apply_inference_params test to assert no false warning
@tensorzero-cla-bot
Copy link
Copy Markdown

tensorzero-cla-bot Bot commented May 13, 2026

Thank you for your contribution! Before we can accept this pull request, we need every commit author to sign the TensorZero Contributor License Agreement.

Pending signatures:

If that's you, please post a comment on this pull request with the following text:

I have read the Contributor License Agreement (CLA) and hereby sign the CLA.

If anything looks off, comment recheck and the bot will re-evaluate.

@gopalvarun03
Copy link
Copy Markdown
Author

I have read the Contributor License Agreement (CLA) and hereby sign the CLA.

tensorzero-cla-bot Bot added a commit that referenced this pull request May 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants