展示HN:LLM-use – 一款经济高效的LLM代理协调器
嗨,HN,
我构建了 llm-use:一个轻量级的 Python 工具包,用于高效的多 LLM 代理工作流程。
核心模式:使用强大的模型(Claude/GPT-4o/大本地模型)进行规划和综合;使用廉价/本地的工作者处理并行子任务(研究、抓取、总结、提取等)。
功能:
• 混合使用 Anthropic、OpenAI、Ollama 和 llama.cpp
• 智能路由器:优先使用廉价/本地工作者,仅在必要时升级(基于学习和启发式)
• 并行工作者(–max-workers)
• 实时抓取 + 缓存(BS4 或 Playwright)
• 离线优先(完全支持 Ollama)
• 成本跟踪(云端费用,0 本地费用)
• TUI 聊天 + MCP 服务器模式
• 本地会话日志
快速示例(混合模式):
```bash
python3 cli.py exec \
--orchestrator anthropic:claude-3-7-sonnet-20250219 \
--worker ollama:llama3.1:8b \
--enable-scrape \
--task "总结 6 个关于后量子密码学的最新来源"
```
或路由版本:
```bash
python3 cli.py exec \
--router ollama:llama3.1:8b \
--orchestrator openai:o1 \
--worker gpt-4o-mini \
--task "解释最近的 macOS 安全更新"
```
采用 MIT 许可证,依赖最小,可嵌入。
仓库链接: [https://github.com/llm-use/llm-use](https://github.com/llm-use/llm-use)
欢迎反馈:
• 您认为有用的路由启发式
• 关于代理成本/本地与云的痛点
• 缺失的集成?
谢谢!
查看原文
Hi HN,
Built llm-use: a lightweight Python toolkit for efficient agent workflows with multiple LLMs.
Core pattern: strong model (Claude/GPT-4o/big local) for planning + synthesis; cheap/local workers for parallel subtasks (research, scrape, summarize, extract…).
Features:
• Mix Anthropic, OpenAI, Ollama, llama.cpp
• Smart router: cheap/local first, escalate only if needed (learned + heuristic)
• Parallel workers (–max-workers)
• Real scraping + cache (BS4 or Playwright)
• Offline-first (full Ollama support)
• Cost tracking ($ for cloud, 0 local)
• TUI chat + MCP server mode
• Local session logs
Quick example (hybrid):<p>python3 cli.py exec \
--orchestrator anthropic:claude-3-7-sonnet-20250219 \
--worker ollama:llama3.1:8b \
--enable-scrape \
--task "Summarize 6 recent sources on post-quantum crypto"<p>Or routed version:<p>python3 cli.py exec \
--router ollama:llama3.1:8b \
--orchestrator openai:o1 \
--worker gpt-4o-mini \
--task "Explain recent macOS security updates"<p>MIT licensed, minimal deps, embeddable.
Repo: <a href="https://github.com/llm-use/llm-use" rel="nofollow">https://github.com/llm-use/llm-use</a>
Feedback welcome on:
• Routing heuristics you’d find useful
• Pain points with agent costs / local vs cloud
• Missing integrations?
Thanks!