Skip to content

Added support for logprobs in Vertex AI Gemini models#9493

Merged
krrishdholakia merged 3 commits intoBerriAI:litellm_contributor_prs_03_24_2025_p2from
ADIthaker:r1-contribute
Mar 25, 2025
Merged

Added support for logprobs in Vertex AI Gemini models#9493
krrishdholakia merged 3 commits intoBerriAI:litellm_contributor_prs_03_24_2025_p2from
ADIthaker:r1-contribute

Conversation

@ADIthaker
Copy link
Contributor

Title

Added support for logprobs in Vertex AI Gemini models

Relevant issues

Fixes #9091

Pre-Submission checklist

Please complete all items before asking a LiteLLM maintainer to review your PR

  • I have Added testing in the tests/litellm/ directory, Adding at least 1 test is a hard requirement - see details
  • I have added a screenshot of my new test passing locally
    Screenshot 2025-03-24 000312
  • My PR passes all unit tests on (make test-unit)[https://docs.litellm.ai/docs/extras/contributing_code]
  • My PR's scope is as isolated as possible, it only solves 1 specific problem

Type

🆕 New Feature

Changes

  • litellm/utils.py - Contains get_optional_params that calls ProviderConfig to get the supported params by calling function in litellm/litellm_core_utils/get_supported_openai_params.py, append top_logprobs to it.
  • litellm/llms/vertex_ai/gemini/vertex_and_google_ai_studio_gemini.py to understand at VertexGeminiConfig, and edit supported_openai_params, map_openai_params

@vercel
Copy link

vercel bot commented Mar 24, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
litellm ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 24, 2025 3:52pm

…ni.py

Co-authored-by: Tom Matthews <tomukmatthews@gmail.com>
@krrishdholakia
Copy link
Member

Hey @ADIthaker can you please share a screenshot of your PR passing make test-unit

My PR passes all unit tests on (make test-unit)[https://docs.litellm.ai/docs/extras/contributing_code]

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this folder/file should map the file it's testing on the repo

it should be tests/litellm/llms/vertex_ai/gemini/test_vertex_and_google_ai_studio_gemini.py

@krrishdholakia krrishdholakia changed the base branch from main to litellm_contributor_prs_03_24_2025_p2 March 25, 2025 05:38
@krrishdholakia krrishdholakia merged commit 61759b0 into BerriAI:litellm_contributor_prs_03_24_2025_p2 Mar 25, 2025
2 checks passed
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.

[Feature]: Support logprobs for Vertex AI gemini Models

3 participants

Comments