Skip to content

fix: accept logprobs as integer and warn on unsupported params#2

Open
Pernekhan wants to merge 1 commit intomainfrom
claude/fix-dynamo-parameters-shHAq
Open

fix: accept logprobs as integer and warn on unsupported params#2
Pernekhan wants to merge 1 commit intomainfrom
claude/fix-dynamo-parameters-shHAq

Conversation

@Pernekhan
Copy link
Copy Markdown
Collaborator

Summary

  • logprobs integer support: Add custom deserializer for chat completion logprobs field to accept both boolean and integer values (0=false, non-zero=true). Some clients send logprobs: 1 instead of logprobs: true.
  • Warn instead of reject unsupported params: Change validate_no_unsupported_fields to log a warning and continue instead of returning a 400 error. This improves compatibility with clients that send extra parameters like add_special_tokens, prompt_cache_key, request_id, and chat_template.

Test plan

  • New test test_logprobs_accepts_integer verifies integer→bool coercion (0→false, 1→true) and that boolean values still work
  • New test test_unsupported_fields_warn_not_error verifies that requests with unknown fields pass validation
  • Updated existing tests test_chat_completions_unknown_fields_rejected and test_completions_unsupported_fields_rejected to assert is_ok() instead of is_err()
  • All existing async-openai and dynamo-llm tests pass

https://claude.ai/code/session_01EoHsvxn4B3WMuJkwP5f6od

Change validate_no_unsupported_fields to log a warning instead of
returning an error when unknown fields are present. This improves
compatibility with clients that send extra parameters like
add_special_tokens, prompt_cache_key, request_id, or chat_template.

https://claude.ai/code/session_01EoHsvxn4B3WMuJkwP5f6od
@Pernekhan Pernekhan force-pushed the claude/fix-dynamo-parameters-shHAq branch from c2bb87f to e7e26cd Compare March 24, 2026 23:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants