From c6eec41d250012432d747aa52673b8e545ad5f5c Mon Sep 17 00:00:00 2001 From: Game_Time <108236317+RayBytes@users.noreply.github.com> Date: Fri, 12 Dec 2025 01:39:56 +0500 Subject: [PATCH] Add support for GPT-5.2 --- .README.md.swp | Bin 0 -> 12288 bytes DOCKER.md | 2 +- README.md | 7 ++++--- chatmock/cli.py | 2 +- chatmock/reasoning.py | 2 ++ chatmock/routes_ollama.py | 6 ++++++ chatmock/routes_openai.py | 1 + chatmock/upstream.py | 3 +++ 8 files changed, 18 insertions(+), 5 deletions(-) create mode 100644 .README.md.swp diff --git a/.README.md.swp b/.README.md.swp new file mode 100644 index 0000000000000000000000000000000000000000..a40e22da244613637b97bf709f6fc4153804a6c3 GIT binary patch literal 12288 zcmeHNTW=&s6|RIpK)V415{S3T7+8DoblVP5HjX`!*EX90d)JKD1mu{wrn_dQGc{eE zs_OL)2$0|h01sRg_yIhiC_Hfa1MnWCzzYb(BSA=nn<63LJJsFxtaq*KMM6UA+5J48 z?y7T6ednC7+IIC8KGWIePX>z&ulF)Gd*P|%2fusz{AUjyU`9+tDpWEWij;1j_3F|% z+u9bF3`-G#-sfG@7ucmNGS3m#1{vO7D1NmpyJOTXpornXN z0X_u$_F=|;4ZH??4frY`ffzUkJPiEl9gO`7_$BZv@C#r7^nt&=ov}B7p8zid-vYh~ zTmiO$e?G+6KY%|2uK}+DJwO28e;Z@p1HJ)#9asQD;KRTS@Il}MzSm3!Sr83%5=pzi za1e~8wPGNHNT*JwZjP}z#_=kz+tvLqHjGxXvCJE}m8LPz8|7HKG?Yqdex!|x8(%so zX6jg~)y5!mt;ZYlj2!Y+9;pQ8;aT9zNw`5|B+h`$R&GU>JU^0?)ds#aIG^FkAk{|3 z-ZEAtpT~Mu8)wl0e}yA>yqd{$tpm$_qsLt1lSp_n&a`pmJ)$L>xS_^j7vgHif6wuO zZ{83@sb#DyMa=izQ1TdORHWfaYMsf`sGxf&jXap8cr5ZWNZc^*(E>x9k-0Q+(w-b| z=_%a{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W47u7VvHkqs># zj8kWlUXBgSmce=tr6AmN`%acIJ>jj^axY;g)}n9koYrFet&x;OcD%X!;W5J_(Ot*W z%FLM|?Z6=KR`PTo8BV36r>t-+$31B8opaX5EPG~rpP;+ja-ptaDH4X+ny?`kh$w;l6eEL2Tj literal 0 HcmV?d00001 diff --git a/DOCKER.md b/DOCKER.md index 2a705b5..6eb8074 100644 --- a/DOCKER.md +++ b/DOCKER.md @@ -22,7 +22,7 @@ Set options in `.env` or pass environment variables: - `PORT`: Container listening port (default 8000) - `VERBOSE`: `true|false` to enable request/stream logs -- `CHATGPT_LOCAL_REASONING_EFFORT`: minimal|low|medium|high +- `CHATGPT_LOCAL_REASONING_EFFORT`: minimal|low|medium|high|xhigh - `CHATGPT_LOCAL_REASONING_SUMMARY`: auto|concise|detailed|none - `CHATGPT_LOCAL_REASONING_COMPAT`: legacy|o3|think-tags|current - `CHATGPT_LOCAL_DEBUG_MODEL`: force model override (e.g., `gpt-5`) diff --git a/README.md b/README.md index 960e850..fce611b 100644 --- a/README.md +++ b/README.md @@ -115,6 +115,7 @@ curl http://127.0.0.1:8000/v1/chat/completions \ # Supported models - `gpt-5` - `gpt-5.1` +- `gpt-5.2` - `gpt-5-codex` - `gpt-5.1-codex` - `gpt-5.1-codex-max` @@ -126,7 +127,8 @@ curl http://127.0.0.1:8000/v1/chat/completions \ ### Thinking effort - `--reasoning-effort` (choice of minimal,low,medium,high,xhigh)
-GPT-5 has a configurable amount of "effort" it can put into thinking, which may cause it to take more time for a response to return, but may overall give a smarter answer. Applying this parameter after `serve` forces the server to use this reasoning effort by default, unless overrided by the API request with a different effort set. The default reasoning effort without setting this parameter is `medium`. The `gpt-5.1` family (including codex) supports `low`, `medium`, and `high` while `gpt-5.1-codex-max` adds `xhigh`; neither offers a `minimal` variant. +GPT-5 has a configurable amount of "effort" it can put into thinking, which may cause it to take more time for a response to return, but may overall give a smarter answer. Applying this parameter after `serve` forces the server to use this reasoning effort by default, unless overrided by the API request with a different effort set. The default reasoning effort without setting this parameter is `medium`.
+ The `gpt-5.1` family (including codex) supports `low`, `medium`, and `high` while `gpt-5.1-codex-max` adds `xhigh`. `gpt-5.2` supports `low`, `medium`, `high`, and `xhigh`. ### Thinking summaries @@ -159,7 +161,7 @@ You can enable it by starting the server with this parameter, which will allow O If your preferred app doesn’t support selecting reasoning effort, or you just want a simpler approach, this parameter exposes each reasoning level as a separate, queryable model. Each reasoning level also appears individually under ⁠/v1/models, so model pickers in your favorite chat apps will list all reasoning options as distinct models you can switch between. ## Notes -If you wish to have the fastest responses, I'd recommend setting `--reasoning-effort` to minimal, and `--reasoning-summary` to none.
+If you wish to have the fastest responses, I'd recommend setting `--reasoning-effort` to low, and `--reasoning-summary` to none.
All parameters and choices can be seen by sending `python chatmock.py serve --h`
The context size of this route is also larger than what you get access to in the regular ChatGPT app.
@@ -172,4 +174,3 @@ When the model returns a thinking summary, the model will send back thinking tag - diff --git a/chatmock/cli.py b/chatmock/cli.py index 2ebaf85..d9c1a5e 100644 --- a/chatmock/cli.py +++ b/chatmock/cli.py @@ -335,7 +335,7 @@ def main() -> None: action="store_true", default=(os.getenv("CHATGPT_LOCAL_EXPOSE_REASONING_MODELS") or "").strip().lower() in ("1", "true", "yes", "on"), help=( - "Expose gpt-5 reasoning effort variants (minimal|low|medium|high|xhigh where supported) " + "Expose GPT-5 family reasoning effort variants (minimal|low|medium|high|xhigh where supported) " "as separate models from /v1/models. This allows choosing effort via model selection in compatible UIs." ), ) diff --git a/chatmock/reasoning.py b/chatmock/reasoning.py index 79566cb..ac6fa96 100644 --- a/chatmock/reasoning.py +++ b/chatmock/reasoning.py @@ -11,6 +11,8 @@ def allowed_efforts_for_model(model: str | None) -> Set[str]: if not base: return DEFAULT_REASONING_EFFORTS normalized = base.split(":", 1)[0] + if normalized.startswith("gpt-5.2"): + return {"none", "low", "medium", "high", "xhigh"} if normalized.startswith("gpt-5.1-codex-max"): return {"low", "medium", "high", "xhigh"} if normalized.startswith("gpt-5.1"): diff --git a/chatmock/routes_ollama.py b/chatmock/routes_ollama.py index 1fd8699..a2b9bec 100644 --- a/chatmock/routes_ollama.py +++ b/chatmock/routes_ollama.py @@ -96,6 +96,7 @@ def ollama_tags() -> Response: model_ids = [ "gpt-5", "gpt-5.1", + "gpt-5.2", "gpt-5-codex", "gpt-5.1-codex", "gpt-5.1-codex-max", @@ -112,6 +113,11 @@ def ollama_tags() -> Response: "gpt-5.1-high", "gpt-5.1-medium", "gpt-5.1-low", + "gpt-5.2-xhigh", + "gpt-5.2-high", + "gpt-5.2-medium", + "gpt-5.2-low", + "gpt-5.2-none", "gpt-5-codex-high", "gpt-5-codex-medium", "gpt-5-codex-low", diff --git a/chatmock/routes_openai.py b/chatmock/routes_openai.py index 5d97bed..1e737b2 100644 --- a/chatmock/routes_openai.py +++ b/chatmock/routes_openai.py @@ -534,6 +534,7 @@ def list_models() -> Response: model_groups = [ ("gpt-5", ["high", "medium", "low", "minimal"]), ("gpt-5.1", ["high", "medium", "low"]), + ("gpt-5.2", ["xhigh", "high", "medium", "low", "none"]), ("gpt-5-codex", ["high", "medium", "low"]), ("gpt-5.1-codex", ["high", "medium", "low"]), ("gpt-5.1-codex-max", ["xhigh", "high", "medium", "low"]), diff --git a/chatmock/upstream.py b/chatmock/upstream.py index 8f377a0..52261f1 100644 --- a/chatmock/upstream.py +++ b/chatmock/upstream.py @@ -42,6 +42,9 @@ def normalize_model_name(name: str | None, debug_model: str | None = None) -> st "gpt-5-latest": "gpt-5", "gpt-5": "gpt-5", "gpt-5.1": "gpt-5.1", + "gpt5.2": "gpt-5.2", + "gpt-5.2": "gpt-5.2", + "gpt-5.2-latest": "gpt-5.2", "gpt5-codex": "gpt-5-codex", "gpt-5-codex": "gpt-5-codex", "gpt-5-codex-latest": "gpt-5-codex",