models: add extra_payload to create_custom / update_custom#171
Merged
Conversation
Mirrors the new atlas-app backend field (LayerLens/stratix-app#1932). ``extra_payload`` is an optional JSON object that's deep-merged into every outgoing chat-completions request body — customer values win on conflict with our hardcoded defaults. Lets callers override ``temperature`` (we send 0 for reproducible evals) or add provider-specific fields like ``max_completion_tokens`` that some endpoints require. Updated: - ``models.create_custom`` (sync + async) — new ``extra_payload`` keyword argument. - ``models.update_custom`` (sync + async) — same, plus a docstring note that ``{}`` clears the existing payload. - Reference docs, README example, samples, CHANGELOG. - Example ``api_url`` values now show the full ``/v1/chat/completions`` form to match the backend hint. Existing SDK callers keep working — the field is optional and additive on the backend. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Five new cases exercising the new parameter:
- create_custom forwards extra_payload verbatim
- create_custom omits the key when None
- update_custom supports extra_payload-only updates
- update_custom({}) sends an empty dict so the backend clears the
stored payload (semantics added in atlas-app#1932)
- update_custom omits the key when None
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Releases the ``extra_payload`` parameter added in the previous commits. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The previous commit bumped to 1.6.2, but adding the new ``extra_payload`` parameter counts as new functionality, so the semver-correct minor bump is 1.7.0. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
m-peko
added a commit
that referenced
this pull request
May 20, 2026
* Add CHANGELOG.md * Create auto release GH workflow * Update CHANGELOG.md, make updates in auto-release workflow * models: add extra_payload to create_custom / update_custom (#171) * models: add extra_payload to create_custom / update_custom Mirrors the new atlas-app backend field (LayerLens/stratix-app#1932). ``extra_payload`` is an optional JSON object that's deep-merged into every outgoing chat-completions request body — customer values win on conflict with our hardcoded defaults. Lets callers override ``temperature`` (we send 0 for reproducible evals) or add provider-specific fields like ``max_completion_tokens`` that some endpoints require. Updated: - ``models.create_custom`` (sync + async) — new ``extra_payload`` keyword argument. - ``models.update_custom`` (sync + async) — same, plus a docstring note that ``{}`` clears the existing payload. - Reference docs, README example, samples, CHANGELOG. - Example ``api_url`` values now show the full ``/v1/chat/completions`` form to match the backend hint. Existing SDK callers keep working — the field is optional and additive on the backend. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * test(models): cover extra_payload in create_custom / update_custom Five new cases exercising the new parameter: - create_custom forwards extra_payload verbatim - create_custom omits the key when None - update_custom supports extra_payload-only updates - update_custom({}) sends an empty dict so the backend clears the stored payload (semantics added in atlas-app#1932) - update_custom omits the key when None Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * chore: bump version to 1.6.2 Releases the ``extra_payload`` parameter added in the previous commits. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * chore: re-bump version to 1.7.0 The previous commit bumped to 1.6.2, but adding the new ``extra_payload`` parameter counts as new functionality, so the semver-correct minor bump is 1.7.0. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Dmitry Stepanov <stepdi@gmail.com> Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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
Mirrors the new atlas-app backend field (LayerLens/atlas-app#1932) so SDK callers can attach arbitrary JSON to every outgoing chat-completions request body for their Custom Models.
`extra_payload` is deep-merged into the request body; customer values win on conflict with our hardcoded defaults. Practical uses:
Reserved keys: `messages`, `model`, `stream` — backend returns 400.
Changes
Backwards-compatible: existing callers keep working — the field is optional, and the backend additions are additive.
Test plan
Dependencies
🤖 Generated with Claude Code