unsloth/studio
Ashwin Upadhyay 867b1e1873
studio/openai: align chat completions docstring with stream=false default (closes #5047) (#5524)
* studio/openai: align chat completions docstring with stream=false default

The schema and regression test for ChatCompletionRequest.stream were
already corrected to default `false` (matching OpenAI's spec), but the
route docstring still claimed streaming was the default -- misleading
for anyone reading the source while debugging the original report.

Updates the docstring to reflect the actual behavior, adds an explicit
note pointing to #5047, and tags the existing regression test with the
issue reference and the .NET / System.Text.Json client class so the
intent survives future cleanup.

Closes #5047

* studio/openai: address review — move #5047 ref out of OpenAPI doc, add route-level test

Two follow-ups on review feedback:

- Drop "(see #5047)" from the openai_chat_completions docstring so the
  internal issue number doesn't leak into the FastAPI-generated
  OpenAPI / Swagger schema. The reference now lives in a code comment
  next to the actual `if payload.stream:` branch, where it's most
  useful for the next person debugging the same class of report.

- Add test_post_without_stream_field_decodes_to_stream_false_over_http:
  a TestClient-based wire-level guard that POSTs a body without
  `stream` (the exact shape naive curl / .NET / System.Text.Json
  clients send) and asserts both that the request deserialises into
  stream=False *and* that the response Content-Type is
  application/json, never text/event-stream. The existing
  constructor-level test would silently miss regressions introduced
  by middleware or alias rewrites that mutate the body before the
  pydantic model is built.

Refs #5047

* studio/openai: route-level test mounts real router instead of synthetic echo app

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: Roland Tannous <115670425+rolandtannous@users.noreply.github.com>
Co-authored-by: Roland Tannous <rolandtannous@gravityq.ai>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2026-05-18 01:19:50 +04:00
..
backend studio/openai: align chat completions docstring with stream=false default (closes #5047) (#5524) 2026-05-18 01:19:50 +04:00
frontend studio/chat: persist Anthropic container id on first turn of new thread (#5526) 2026-05-18 00:42:30 +04:00
src-tauri Harden Tauri release flow (#5341) 2026-05-12 20:30:20 -07:00
__init__.py Final cleanup 2026-03-12 18:28:04 +00:00
install_llama_prebuilt.py Fix Linux prebuilt installs for branch-based llama.cpp releases (#5493) 2026-05-17 07:16:55 -07:00
install_python_stack.py studio: skip flash-attn install on Blackwell GPUs (sm_100+) (#5420) 2026-05-14 18:13:50 +04:00
LICENSE.AGPL-3.0 Add AGPL-3.0 license to studio folder 2026-03-09 19:36:25 +00:00
setup.bat Final cleanup 2026-03-12 18:28:04 +00:00
setup.ps1 CI: scope GITHUB_TOKEN permissions, add MLX CI, unblock ~60 skipped tests (#5312) 2026-05-11 03:19:13 -07:00
setup.sh Route CPU-only Linux x86_64 to ggml-org/llama.cpp prebuilts (#5302) 2026-05-05 23:22:22 -07:00
Unsloth_Studio_Colab.ipynb studio: add --local to setup.sh + overlay unsloth-zoo from git main (#5252) 2026-05-02 08:51:56 +04:00