Repository navigation
perf(pi): reduce DeepSeek input overhead and detect local context budgets - #399
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
DeepSeek conversations resend builtin tool schemas and formatted tool results on each model turn. This PR applies automatic input-saving defaults and selects local context budgets from backend metadata when channels are saved or tested.
max_tokensand include provider-reported reasoning tokens in the usage breakdown without adding them again to total usage.The local metadata and budget plumbing is included because current
mainlacks these prerequisites. This overlaps the context-handling work in #367 and is adapted to the current Pi runtime.Validation on the upstream-based branch passed.
npm run buildandnpm testinruntime/pi— 15 tests.go test -race ./internal/agentruntime ./internal/multiagent ./internal/config ./internal/modelmeta ./internal/tooloutput ./internal/handler ./internal/app.go run ./cmd/build-runtime,bash scripts/check-pi-only.sh,go build ./cmd/serverandgit diff --check.In a deterministic fixture, first-request tool schemas decreased from 13,798 to 3,417 bytes. A 10,070-byte tool result became a 4,387-byte preview, and a subsequent read recovered the omitted middle evidence. These measurements describe fixture payload size. Live provider billing, latency and task-success impact remain unmeasured. Discovery and evidence readback can add model turns.
中文摘要
默认自动精简 DeepSeek 输入,并根据 Ollama、llama.cpp、LM Studio、vLLM 和 oMLX 元数据应用本地上下文预算。保留完整证据与原始会话记录,优化策略在后台应用。真实模型的费用和任务效果仍需对照验证。