Skip to content

docs: local-LLM + tool-calling feasibility findings#104

Open
chaxus wants to merge 2 commits into
mainfrom
docs/agent-llm-tradeoffs
Open

docs: local-LLM + tool-calling feasibility findings#104
chaxus wants to merge 2 commits into
mainfrom
docs/agent-llm-tradeoffs

Conversation

@chaxus

@chaxus chaxus commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

把反复被问到的"本地无-key agent + 工具调用"的定论写成文档,避免下次再从头讨论。

要点:

  • pi/langchain 是编排层,不产模型、不改权重;小模型工具调用差是能力天花板,不是编排问题
  • "调优"两义:推理时(框架能做,已在做)vs 微调权重(要 HF/PEFT 训练链,非 pi/langchain)
  • pi ≠ 本地推理(仍走云端、仍要 key),换不回 WebLLM 的离线/隐私价值
  • 项目现状:agent-core 已是 pi 的等价物;webllm.ts 已固化"小模型不可靠→chat-only 兜底";ollama.ts 是本地+能调工具的路径
  • 方案分层:Ollama(最优本地)> WebLLM+约束解码(零安装杠杆)> 微调(重)> pi/langchain(错层级)

详见 docs/explorations/2026-07-07-agent-llm-local-tooling-tradeoffs.md

Captures a recurring decision: pi/langchain are orchestration layers, not model
producers/trainers; a small in-browser model's weak tool-calling is a capability
ceiling, not an orchestration problem. Documents the two senses of "tuning"
(inference-time vs fine-tuning), why pi != local inference, what the project
already encodes (agent-core, ollama.ts native tools, webllm.ts chat-only
fallback), and the ranked options: Ollama (local + capable), WebLLM +
constrained decoding (zero-install lever), fine-tune (heavy), pi/langchain
(wrong layer).
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jul 7, 2026

Copy link
Copy Markdown

Deploying document with  Cloudflare Pages  Cloudflare Pages

Latest commit: ff2a024
Status: ✅  Deploy successful!
Preview URL: https://a94a2fb8.document-7hm.pages.dev
Branch Preview URL: https://docs-agent-llm-tradeoffs.document-7hm.pages.dev

View logs

Expands the fine-tune option: correct ordering (cheap levers first, fine-tune
only after they hit a wall), the distillation workflow (teacher model generates
tool-call trajectories -> SFT/LoRA -> compile to MLC/WebLLM), the irony that
bootstrapping data still needs a cloud model, ongoing retrain-on-tool-change
cost, realistic expectations (a tuned 3B is still a 3B), and a go/no-go
checklist for when it is actually worth it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant