38 Commits

Author SHA1 Message Date
cbd4da272b Add GPT-5.5 Pro preset
Some checks failed
ci / test (push) Has been cancelled
2026-05-21 20:18:30 +01:00
Haoyu Tang
85bdb27a08 feat: add gpt-5.5 support (#106)
* feat: add gpt-5.5 support

* tests for gpt-5.5 support
2026-05-18 01:04:19 +05:00
Game_Time
da0e3c3176 fixes #103: responses api max_output_tokens bug 2026-03-23 23:33:56 +05:00
Game_Time
8754203ec6 feat: add responses api, websocket support, and fast mode 2026-03-23 15:41:42 +05:00
Ra's al Ghul
e96db19538 feat: Add GPT-5.4 mini. (#101)
* feat: Add gpt-5.4-mini.

This just adds gpt-5.4-mini at (low/med/high/xhigh) reasoning levels.

* Fix formatting in README for reasoning effort section

---------

Co-authored-by: Ra's al Ghul <ras@alghul.com>
Co-authored-by: Game_Time <108236317+RayBytes@users.noreply.github.com>
2026-03-22 21:32:32 +05:00
Game_Time
d8ba913d73 bump version to 1.36 2026-03-16 17:00:07 +05:00
Game_Time
e6eeae8fa6 publishing pipeline update + model spec 2026-03-16 16:56:23 +05:00
Ra's al Ghul
baf312a02e Add support for GPT-5.4 (#93)
Co-authored-by: Nigel Norris <ras@alghul.com>
2026-03-08 16:08:14 +05:00
Game_Time
5b51b53a20 GPT-5.3-Codex 2026-02-28 00:23:42 +05:00
Game_Time
f15c880fc3 GPT-5.2-Codex added 2025-12-26 16:45:05 +05:00
Game_Time
22fcc4d103 Remove 'none' from GPT-5.2 2025-12-12 01:58:38 +05:00
Game_Time
c6eec41d25 Add support for GPT-5.2 2025-12-12 01:39:56 +05:00
Game_Time
8db91eb8c8 GPT-5.1 models "minimal" removed, add gpt-5.1-codex-max (#80) 2025-11-22 12:16:18 +05:00
Game_Time
d2879a3ffe add gpt-5.1 to ollama route 2025-11-19 15:31:22 +05:00
Game_Time
bdae9469ce fix duplication of message in ollama endpoint 2025-11-19 15:26:46 +05:00
Game_Time
b5bb0eaa8e possible fix for auth refresh 2025-11-19 15:19:46 +05:00
Magniquick
13b1dddf75 feat: improve compatiblity with certain apps (#72)
* feat: enable modern packaging via pyproject.toml

uvx --from (...) chatmock should just work !

* feat(ollama): add version endpoint

* feat(logging): improve verbose diagnostics

* fix(stream): always send stop chunk
2025-11-19 15:02:20 +05:00
Game_Time
a4b9ae9471 Implement latest GPT-5.1 models 2025-11-19 14:59:34 +05:00
Alexx
fd900eb7af fix: Add graceful error handling for ChunkedEncodingError during streaming (#57)
Fixes connection interruptions from ChatGPT API by catching ChunkedEncodingError
and gracefully ending the stream with [DONE] instead of returning 500 errors.

Two-level error handling:
1. Catches errors during stream initialization
2. Catches errors during stream iteration

This prevents abrupt failures when the upstream connection is interrupted mid-response.
2025-10-20 22:38:47 +05:00
Alexx
70025724f8 Add env toggles for reasoning and web search (#64) 2025-10-02 12:31:18 +05:00
Game_Time
3a16fb8179 possible fix for refresh token 2025-09-25 20:05:54 +05:00
Game_Time
6c0d63869e add limits to info 2025-09-25 16:43:55 +05:00
Paweł Hawrylak
fe5796abeb Fix tool call argument serialization issue (#39)
* Tool calling arguments JSON fix

* Extracted duplicated code to helper function

* Update utils.py

---------

Co-authored-by: Game_Time <108236317+RayBytes@users.noreply.github.com>
2025-09-20 18:42:00 +05:00
Game_Time
bf16fbe3e1 add codex-mini to model list 2025-09-18 11:41:22 +05:00
Maciej Wilczyński
77d60fe321 Add GPT-5-Codex support (#37) 2025-09-16 17:58:41 +05:00
alexx-ftw
2f23cd5a89 native openai web search ability!
* feat: local passthrough for Responses tools via responses_tools + responses_tool_choice (behind CHATMOCK_ALLOW_RESPONSES_TOOLS)

* feat: gate Responses tools passthrough behind CHATMOCK_ALLOW_RESPONSES_TOOLS (default OFF)

* test(docs): add pytest for Responses tools passthrough (default off), and README usage section

* feat: responses tools hardening (fallback on 400, host allowlist, size guard, tool_choice strings only); tests updated

* feat: enable Responses tools passthrough by default; remove env gate

- Tools forwarded whenever  is present
- Keep size guard and optional MCP host allowlist
- Accept  strings unconditionally

Tests:
- Update to cover default passthrough and baseline (no responses_tools)

Docs:
- README: update instructions; move Star History to bottom

* chore: clean imports/comments; use gpt-5 in examples and tests

* docs: tighten Responses tools README; fix gpt-5 example\nchore: remove feature-specific test per review; trim comments/imports

* chore: remove __pycache__/ and bytecode; add .gitignore

* chore: add .gitignore for caches and bytecode

* Update README.md

* fix: remove MCP passthrough; allow only web_search in responses_tools

- Reject non-`web_search` types with 400 (`RESPONSES_TOOL_UNSUPPORTED`).
- Drop MCP host allowlist logic and related import.
- Keep size guard via `RESPONSES_TOOLS_MAX_BYTES` and fallback retry without extras.
- Docs: update README to state web_search-only passthrough.

Runtime verified locally with a stubbed upstream:
- OK: `responses_tools: [{"type": "web_search"}]` -> 200.
- BAD: `responses_tools: [{"type": "mcp"}]` -> 400 `RESPONSES_TOOL_UNSUPPORTED`.

* feat: forward Responses web_search tool via Chat Completions; fallback on rejection

- Accept `responses_tools` array and filter to `type: web_search` only.
- Enforce size guard `RESPONSES_TOOLS_MAX_BYTES` (default 32768).
- Fallback: if upstream rejects tools, retry without extras; otherwise return `RESPONSES_TOOLS_REJECTED`.
- README: document web_search-only passthrough and example.
- Headers: hint experimental features in OpenAI-Beta (responses; web-search).

* chore: remove local test-only forcing flag (CHATMOCK_FORCE_WEB_SEARCH)

* fix: restore full routes_openai (web_search-only passthrough + endpoints)

- Undo accidental large deletion from prior cleanup.
- Keep `web_search` passthrough, size guard, and fallback.
- Preserve `/v1/completions` and `/v1/models` endpoints and SSE handling.

* Update upstream.py

* Update upstream.py

* Update README.md

* Update README.md

* Update routes_openai.py

* feat(openai): default-enable web_search; accept preview; quiet retry; rm env knob

- Injects responses_tools=[{"type":"web_search"}] when client omits tools; explicit opt-out via responses_tool_choice:"none".
- Allowlist accepts "web_search" and "web_search_preview"; others rejected with RESPONSES_TOOL_UNSUPPORTED.
- Replaces env max-bytes knob with MAX_TOOLS_BYTES=32768.
- Retry on upstream rejection is silent; logs only under verbose.

* feat(stream): surface web_search_call as tool_calls; aggregate args; verbose-only logs

- Translates Responses web_search_call.* and output_item.done into OpenAI-style delta.tool_calls.
- Aggregates parameters by call_id (query/q, recency/time_range/days, domains/include/include_domains/include, max_results/topn/limit).
- No inference; arguments remain "{}" if upstream provides none. Logs only when verbose.

* feat(responses-tools): web_search passthrough; flag; fallback; Ollama parity; stable indexes

- Add --enable-web-search (default OFF) to inject web_search when requests omit responses_tools
- Allow tool types: web_search and web_search_preview; 32,768-byte cap on serialized responses_tools
- OpenAI /v1/chat/completions: passthrough + retry without extras on upstream rejection; return retry status
- Streaming: function.arguments always JSON; stable tool_calls index per call_id
- Ollama /api/chat: same passthrough + fallback behavior
- README updated to match behavior and limits

* Update README.md

* Update README.md

* Update routes_ollama.py

* Update routes_openai.py

* Update utils.py

---------

Co-authored-by: alexx-ftw <alexx-ftw@users.noreply.github.com>
Co-authored-by: Game_Time <108236317+RayBytes@users.noreply.github.com>
2025-09-16 17:06:00 +05:00
Game_Time
8d92a63626 allow for diff machine logins 2025-09-12 21:53:59 +05:00
Game_Time
7d944548cd reasoning effort as models support 2025-08-24 23:53:37 +05:00
Game_Time
ffcb12e76c Merge pull request #16 from FammasMaz/FammasMaz-patch-1
fix: stream(legacy): include delta.reasoning alongside reasoning_summary
2025-08-22 13:53:05 +05:00
Game_Time
48780c9e83 finally make token counting work in apps 2025-08-22 02:09:31 +05:00
Game_Time
f05dc62eaa Delete chatmock/__pycache__ directory 2025-08-22 02:02:11 +05:00
Game_Time
cadd959778 hopefully patch token counting? 2025-08-22 02:01:15 +05:00
Moeeze Hassan
b0de3a2e6f fix: stream(legacy): include delta.reasoning alongside reasoning_summary
In legacy/current compatibility mode, stream both `delta.reasoning_summary` and
`delta.reasoning` (string) for reasoning deltas. This ensures clients that
expect `choices[0].delta.reasoning` as a string (e.g., OpenCode) render
reasoning without schema errors.

Change made only to legacy to avoid breakage with other software
2025-08-21 22:36:37 +02:00
Game_Time
c8c6540d23 intitial docker impl 2025-08-20 15:26:14 +05:00
Game_Time
fc9727cb73 added "minimal" reasoning option (better for coding) 2025-08-20 11:41:10 +05:00
Game_Time
8129b62083 implemented caching! should increase the usage available 2025-08-19 22:43:40 +05:00
Game_Time
2ed6dbe2d4 fix ollama regression 2025-08-19 21:26:47 +05:00
Game_Time
554ec53a25 refactor to reorganise codebase 2025-08-19 17:21:00 +05:00