Commit graph

13 commits

Author SHA1 Message Date
Armin Ronacher
8562bcf66a feat(coding-agent): codemode and MCP
This adds codemode and MCP support to pi. Codemode (packages/codemode) runs
model-written JavaScript in a QuickJS wasm VM inside a worker. From there the
script calls pi's tools as async functions, uses a per-session store, and can
read the model catalog and run classifiers. The codemode tool in coding-agent
is compatible with Codex's exec tool, and codemode.mode works like Codex's
tool modes (on or only). Large results are written to a JSON temp file. MCP
(packages/mcp) is a standalone client for stdio and streamable HTTP servers,
with OAuth.

The core only gets general mechanisms; codemode, tool_search and MCP are
built-in extensions that use them. Other extensions can replace these
built-ins. Tools declare an exposure: direct, model-only, codemode, deferred
or hidden. prepareLoadout() lets an orchestrating tool change which tool
declarations the model sees. ctx.executeTool() runs nested calls through
validation and the tool_call/tool_result hooks. Those calls emit events with
parentToolCallId and are recorded as bounded nestedCalls on the parent
result, which compaction and HTML export use. Tools can also return
structuredContent with an outputSchema, and can report errors with isError
instead of throwing. MCP servers come from mcp.json (global, or per project
after the project is trusted) or from pi.registerMcpServer(). They are
managed with /mcp and pi mcp list|login|logout, and their runtimes load on
first use.

Closes #10040
2026-09-29 09:12:50 +02:00
Armin Ronacher
04efdfc380
feat(ai): Discount jev (#10119)
Add the llama-cpp-classify classifier API. Each question becomes one chat prompt with single-token answer labels; llama-server's pre-sampling next-token log-probabilities give the softmax over those labels. Missing labels are retried with deeper readouts and then reported as errors.
2026-09-28 14:19:07 +02:00
David Brailovsky
1e39862f67 fix(coding-agent): detect llama.cpp chat-template thinking
Inspect loaded models through /props and configure boolean thinking levels for templates supporting enable_thinking.

Fixes #9528
2026-09-18 14:54:17 +02:00
Cristina Poncela Cubeiro
dcd461925d
feat: show llama presets if autoload enabled (#8558) 2026-08-24 13:29:51 +02:00
Cristina Poncela Cubeiro
d3e3bbc011
fix: llama.cpp allow network for model discovery (#8238) 2026-08-17 12:36:17 +02:00
Cristina Poncela Cubeiro
955a543b31
fix: expose sleeping llama.cpp models (#8235) 2026-08-17 11:40:11 +02:00
Mario Zechner
fed6009cc9 fix(coding-agent): make model refresh cancellation caller-owned
Add generation-safe catalog publication, cancellable auth and storage operations, locally consistent credential mutations, and cache-first interactive model flows.
2026-08-04 00:03:52 +02:00
Steve Immanuel
0c32e83a35
fix(coding-agent): enable streaming usage for llama.cpp provider (#7258)
llama-server supports OpenAI-spec stream_options.include_usage since
b2b6b55a59 (Sep 2025); any server new enough for router mode sends the
final usage chunk when requested. With the flag hardcoded to false the
provider never requests it, so streamed responses record zero tokens
and session/context accounting stays empty.

Verified against llama-server b10094: with include_usage sent, the
final chunk carries usage (incl. prompt_tokens_details.cached_tokens);
without it, nothing.
2026-07-29 10:03:59 +02:00
David Brailovsky
2a2b0a39f0
fix(coding-agent): cache llama.cpp model catalog (#7072) 2026-07-25 08:27:05 +02:00
Christian Klotz
6abb4b0640
fix(coding-agent): use llama context for output limit (#7034)
Fixes #6994.
2026-07-23 23:06:03 +02:00
Mario Zechner
864b35c462 fix(coding-agent): show llama download progress 2026-07-21 14:25:10 +02:00
Mario Zechner
3da591ab74 feat(coding-agent): add Hugging Face llama search
Some checks failed
CI / build-check-test (push) Has been cancelled
2026-07-17 17:13:39 +02:00
Mario Zechner
f1a466b19d feat(coding-agent): add llama.cpp router integration 2026-07-17 16:25:00 +02:00