Files
open-webui/backend/open_webui/utils
Classic298 47cf51eb78 perf: send tool results to the model as compact JSON (#34640)
Tool results returned as a JSON object or list were re-indented with two spaces before being handed to the model, so those tool calls paid tokens for whitespace nobody reads. They now go to the model as compact JSON. The tool call panel in the chat still shows them pretty-printed, because it formats the result on its own.

Measured on real Open Terminal responses (o200k tokenizer):

| Tool | Before | After | Saved |
|---|---|---|---|
| list_files | 1013 | 672 | 34% |
| glob_search | 2821 | 2061 | 27% |
| grep_search | 2233 | 1652 | 26% |
| run_command | 649 | 614 | 5% |
| read_file | 3254 | 3245 | 0% |

Fixes #34639
2026-11-18 15:47:28 +04:00
..
2026-11-10 21:18:18 +09:00
2026-11-17 19:31:57 +09:00
2026-11-17 19:31:57 +09:00
2026-11-17 19:57:45 +09:00
2026-11-13 17:36:00 +09:00
2026-11-16 21:10:30 +09:00
2026-11-02 00:31:46 +09:00
2026-11-09 08:05:51 +09:00
2026-11-05 11:41:25 +09:00
2026-11-17 19:31:57 +09:00
2026-11-16 21:10:30 +09:00
2026-10-12 17:29:04 +04:00
2026-07-23 02:54:56 -04:00
2026-11-02 09:52:30 +09:00
2026-11-13 17:36:00 +09:00
2026-07-31 17:41:14 -04:00
2026-11-13 17:36:00 +09:00
2026-11-02 08:48:51 +09:00
2026-10-25 08:24:14 +09:00
2026-11-17 22:30:21 +09:00
2026-11-17 22:30:21 +09:00
2026-07-26 23:09:22 -04:00
2026-11-05 16:54:50 +09:00
2026-11-17 22:01:25 +09:00
2026-11-02 08:48:51 +09:00
2026-11-02 08:48:51 +09:00
2026-03-17 17:58:01 -05:00
2026-08-24 18:29:36 -04:00
2026-11-02 12:45:15 +09:00
2026-10-16 14:31:39 +04:00
2026-11-17 00:14:38 +09:00
2026-11-06 13:40:53 +09:00
2026-11-16 13:15:49 +09:00
2026-11-13 17:36:00 +09:00
2026-11-16 21:10:30 +09:00
2026-11-11 15:34:33 +09:00
2026-11-18 01:13:09 +09:00
2026-11-02 08:48:51 +09:00
2026-10-11 15:55:57 +04:00
2026-11-02 08:48:51 +09:00