UPSTREAM PR #18059: webui: Client-side implementation of tool calling (with two tools)#1191
UPSTREAM PR #18059: webui: Client-side implementation of tool calling (with two tools)#1191
Conversation
|
No meaningful performance changes were detected across 111666 analyzed functions in the following binaries: build.bin.libllama.so, build.bin.llama-tts, build.bin.llama-cvector-generator, build.bin.libmtmd.so, build.bin.llama-tokenize, build.bin.llama-bench, build.bin.libggml.so, build.bin.libggml-base.so, build.bin.libggml-cpu.so, build.bin.llama-gemma3-cli, build.bin.llama-gguf-split, build.bin.llama-llava-cli, build.bin.llama-minicpmv-cli, build.bin.llama-quantize, build.bin.llama-qwen2vl-cli. 🔎 Full breakdown: Loci Inspector. |
6495042 to
61b4303
Compare
9f4f332 to
4298c74
Compare
…l and (javascript) code interpreter tool
1667cf1 to
aecfabe
Compare
|
No meaningful performance changes were detected across 112638 analyzed functions in the following binaries: build.bin.llama-cvector-generator, build.bin.libllama.so, build.bin.llama-tts, build.bin.libmtmd.so, build.bin.llama-tokenize, build.bin.llama-bench, build.bin.libggml-base.so, build.bin.libggml-cpu.so, build.bin.libggml.so, build.bin.llama-gemma3-cli, build.bin.llama-gguf-split, build.bin.llama-llava-cli, build.bin.llama-minicpmv-cli, build.bin.llama-quantize, build.bin.llama-qwen2vl-cli. 🔎 Full breakdown: Loci Inspector |
61601b2 to
56aaa36
Compare
945fa3a to
0e8e1d6
Compare
d997939 to
8527fd7
Compare
Note
Source pull request: ggml-org/llama.cpp#18059
This PR allows webui to give models access to two tools: a calculator and a code interpreter. The calculator is a simple expression calculator, used to enhance math abilities. The code interpreter runs arbitrary JavaScript in a (relatively isolated) Web Worker, and returns the output to the model, which can be used for more advanced analysis.
This PR also lays the groundwork for a modular tool system, such that one could easily imagine adding a Canvas tool or a Web Search tool.
When an assistant message emits tool calls, the web UI...
Included tools
output + the final evaluated value, with improved error reporting (line/column/snippet).
UX changes
(arguments + result + timing) to avoid extra message bubbles.
Configuration & extensibility
a Tools section (toggles + per-tool fields like timeout), and defaults are derived from tool registrations.
Tests
reactivity/regressions, etc. These tests were created when bugs were encountered. I would be perfectly fine with throwing most of them away, but I figured there was no harm in including them.
Videos
Calculator tool
Screen.Recording.2025-12-15.at.8.10.04.AM.mov
Code Interpreter tool
Screen.Recording.2025-12-15.at.8.11.08.AM.mov
Code interpreter and calculator, including the model recovering from a syntax error in its first code interpreter attempt
Screen.Recording.2025-12-15.at.8.14.48.AM.mov
Demonstrating how tool calling works for an Instruct model
Screen.Recording.2025-12-15.at.8.12.32.AM.mov
Demonstrating how the regenerate button will correctly treat the entire response as one message, instead of regenerating just the last segment after the last tool call.
Screen.Recording.2025-12-15.at.8.39.48.AM.mov
Deleting an entire response
Screen.Recording.2025-12-15.at.8.53.48.AM.mov
Screenshots
New Settings Screen for Tools
Known Bugs