llama.cpp server 现已内置原生工具(exec_shell、edit_file 等)
摘要
llama.cpp server 现通过实验性标志内置了原生工具,支持文件操作、shell 命令等功能,无需外部包装器。
https://preview.redd.it/24uvk7o4sy2h1.png?width=1440&format=png&auto=webp&s=542570e3057b6f44c1e7e8d92130f575fb69cfa2 https://preview.redd.it/l4bbm7o4sy2h1.png?width=1440&format=png&auto=webp&s=3dc0edd978da23fecf81e86a269a06de643247d1 我最近在捣鼓本地模型,翻阅 llama.cpp server 文档时,偶然发现了这个实验性标志:`--tools TOOL1,TOOL2,...`。它原生支持 `read_file`、`file_glob_search`、`grep_search`、`exec_shell_command`、`write_file`、`edit_file`、`apply_diff` 和 `get_datetime`。这一套工具基本上把 `llama-server` 变成了一个小型智能体框架。你只需要一个可靠的 `.gguf` 文件和 llama.cpp 二进制文件,就能为你的项目提供基本的 AI 协助。请注意,文件操作是相对于你启动服务器的文件夹而言的。目前还没有安全沙箱机制,比如允许命令的白名单或严格禁止对原始文件夹之外的文件进行操作。因此,请对暴露的内容格外谨慎!不过,我仍然非常惊讶 llama.cpp 能够原生获得这些能力。这完全消除了为获取当前日期/时间或读取文件内容而搭建 MCP 或复杂包装器的必要。
相似文章
llama.cpp 就是 LLM 界的 Linux
文章把 llama.cpp 比作 Linux,认为这款开源库已成为运行大语言模型的基础底座。
我制作了一款用于在 WSL/Ubuntu 中管理 llama.cpp 的 Windows 应用
llama.cpp Console 是一款 Windows 桌面应用,提供图形界面来管理 WSL/Ubuntu 中的 llama.cpp,涵盖安装、构建、模型下载和服务部署。
Built a Tauri v2 desktop chat shell for local LLMs — point it at Ollama / llama.cpp / any OpenAI-compatible endpoint, MIT, ~12 MB binary
Built a Tauri v2 desktop chat shell for local LLMs that can connect to Ollama, llama.cpp, or any OpenAI-compatible endpoint. The project is MIT licensed and produces a ~12 MB binary.
在脚本的 shebang 行中使用 LLM
Simon Willison 演示了如何在脚本的 shebang 行中使用 llm CLI 工具,从而直接从可执行文件执行 LLM 提示词与工具调用。
为llama.cpp制作了一个简单的模板管理器与图形界面,这样我就不用一直记住命令行参数了。
Hexllama 是一款免费、开源的桌面图形界面和模板管理器,专为 llama.cpp 设计,简化了命令行参数管理、版本更新以及 HF 模型下载,支持多模型运行。