Skip to content

[DOCS] Document new OpenAI-compatible chat completion request parameters (python-sdk) #245

Closed

Description

What needs documenting

The Python SDK (inference-gateway/python-sdk) now supports the full set of OpenAI-compatible chat completion request parameters, regenerated from openapi.yaml (schemas#71). These are passed as keyword arguments to create_chat_completion / create_chat_completion_stream, or set on CreateChatCompletionRequest.

New / changed parameters:

  • temperature (number, 0-2)
  • top_p (number, 0-1)
  • n (integer, 1-128)
  • stop (string, or up to 4 strings)
  • frequency_penalty (number, -2..2)
  • presence_penalty (number, -2..2)
  • seed (integer)
  • logprobs (boolean)
  • top_logprobs (integer, 0-20)
  • response_format (text, json_object, or json_schema)
  • tool_choice (none/auto/required, or a named tool choice)
  • logit_bias (map of token id to integer bias)
  • user (string)
  • reasoning_effort (minimal/low/medium/high)
  • max_completion_tokens (integer; preferred over the now-deprecated max_tokens)
  • parallel_tool_calls (boolean)

Note: the SDK only sends parameters the caller sets explicitly; unset spec defaults are not forwarded.

Affected pages

  • Python SDK reference / chat completion usage page.
  • Any structured-outputs (response_format) and tool-choice guidance for the Python SDK.

Reference

Activity

  1. added
    documentation
    on Jun 18, 2026
  2. added theissue type on Jun 18, 2026
  3. edenreich commented on Jun 18, 2026

    @edenreich
    Contributor

    @claude Can you document it?

  4. moved this to Todo in 2026on Jun 18, 2026
  5. inference-gateway-maintainer commented on Jun 18, 2026

    @inference-gateway-maintainer
    ContributorAuthor

    Claude finished @edenreich's task in 12m 6s —— View job • docs/issue-245-20260618-2135 • [Create PR ➔](https://github.com/inference-gateway/docs/compare/main...docs/issue-245-20260618-2135?quick_pull=1&title=Issue%20%23245%3A%20Changes%20from%20Claude&body=This%20PR%20addresses%20issue%20%23245%0A%0AGenerated%20with%20%5BClaude%20Code%5D(https%3A%2F%2Fclaude.ai%2Fcode)


    Documented the new Python SDK chat completion request parameters

    Opened PR #255 adding a "Request parameters" section to the Python part of sdks.md, mirroring the recently merged Go SDK section (#254).

    • Read context (issue, sdks.md, Go SDK PR docs: document new chat completion request params in Go SDK #254 as the pattern to mirror)
    • Verified the actual Python SDK API surface against client.py, models.py, and tests/test_client.py on main
    • Added the "Request parameters" section (kwargs table + examples)
    • Added structured-outputs (response_format) and tool-choice guidance
    • bun run lint:md, format:check, and build all pass locally
    • Committed and opened the PR

    What was added

    A new ### Request parameters section under Python documenting every new field, passed as keyword arguments to create_chat_completion / create_chat_completion_stream:

    • Sampling / penalties: temperature, top_p, n, frequency_penalty, presence_penalty, seed
    • stop (string or up to 4 strings), logprobs, top_logprobs, logit_bias
    • response_format (text / json_object / json_schema, with Structured Outputs guidance)
    • tool_choice (none / auto / required / named) and parallel_tool_calls
    • user, reasoning_effort, max_completion_tokens (plus the max_tokens deprecation note)

    A full parameter table plus subsections for stop sequences, response format, tool choice, and log probabilities. The section also documents that the SDK forwards only explicitly-set parameters (unset spec defaults are not sent), which I confirmed against the SDK's exclude_unset serialization and its schemas#71 regression test.

    Notes for the reviewer

    • The docs version line still reads 0.6.2. I left it unchanged on purpose: these fields are merged to main but are not in the latest release (v0.7.1), so bumping to 0.7.1 would wrongly imply that tag has them. Worth bumping when the next release ships.
    • The json_schema Structured Outputs example uses the spec-standard schema key. The SDK's tests currently only exercise json_object; a quick check that a nested json_schema round-trips the schema key on the wire would be worthwhile (the generated model aliases it as schema_).
    • branch docs/issue-245-20260618-2135
  6. moved this from Todo to In progress in 2026on Jun 18, 2026
  7. moved this from In progress to QA in 2026on Jun 18, 2026
  8. moved this from QA to Done in 2026on Jun 18, 2026
  9. inference-gateway-releaser commented on Jun 24, 2026

    @inference-gateway-releaser
    Contributor

    🎉 This issue has been resolved in version 0.6.113 🎉

    The release is available on GitHub release

    Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationreleased

    Type

    Projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions