Add support for GPT-5.2

This commit is contained in:
Game_Time
2025-12-12 01:39:56 +05:00
parent ae3df9f6bc
commit c6eec41d25
8 changed files with 18 additions and 5 deletions

View File

@@ -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."
),
)

View File

@@ -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"):

View File

@@ -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",

View File

@@ -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"]),

View File

@@ -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",