fix(litellm): forward GenerateContentConfig.seed to LiteLLM - #6516
Open
chelsealong wants to merge 1 commit into
Open
fix(litellm): forward GenerateContentConfig.seed to LiteLLM#6516chelsealong wants to merge 1 commit into
chelsealong wants to merge 1 commit into
Conversation
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
chelsealong
force-pushed
the
fix/litellm-forward-seed
branch
from
July 30, 2026 03:15
4f3196e to
c0e2e7a
Compare
Author
|
@googlebot I signed it! |
chelsealong
force-pushed
the
fix/litellm-forward-seed
branch
from
July 30, 2026 03:27
c0e2e7a to
9d63543
Compare
Author
|
@googlebot I signed it! |
chelsealong
force-pushed
the
fix/litellm-forward-seed
branch
from
July 30, 2026 04:38
9d63543 to
07de3af
Compare
`seed` was absent from the generation-parameter allowlist in `_get_completion_inputs`, so `GenerateContentConfig(seed=...)` was silently dropped and never reached LiteLLM (which supports `seed` natively). Add `seed` to the forwarded params. Closes google#6513
chelsealong
force-pushed
the
fix/litellm-forward-seed
branch
from
July 30, 2026 05:04
07de3af to
cd093e5
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
GenerateContentConfig(seed=...)was silently dropped byLiteLlm— the seedstayed in the request config but never reached the parameters passed to
LiteLLM.
The cause is in
_get_completion_inputs(src/google/adk/models/lite_llm.py):generation parameters are extracted by iterating over a fixed allowlist of keys
(
temperature,max_output_tokens,top_p,top_k,stop_sequences,presence_penalty,frequency_penalty), andseedwas not in that list.LiteLLM supports
seednatively (seehttps://docs.litellm.ai/docs/completion/input), so the one-line fix adds it to
the forwarded parameters.
Closes #6513
Testing Plan
Extended the existing
test_get_completion_inputs_generation_paramsunit testto set
seed=42and assertgeneration_params["seed"] == 42.Proof the test guards the fix (stash source change, run test, restore):
assert generation_params["seed"] == 42→KeyError: 'seed'(1 failed)Full suite for the touched module:
Lint:
pyink --check,isort --check-only, andruff checkall pass on thechanged files.
Note
This PR was prepared with AI assistance (Claude). The fix, the test, and the
test evidence above were reviewed for correctness before submitting.