{"slug": "llama-cpp-tools", "title": "Llama-cpp Tools", "summary": "A developer is using llama-cpp's tool-calling feature to let large language models execute system commands such as reading files and editing code, comparing the approach to bash scripting but easier to maintain. The method involves saving instructions in a Markdown file and referencing it in a prompt, enabling the LLM to perform tasks like editing Rust programs or creating backups via sequential tool calls.", "body_md": "Recently I have been experimenting with `llama-cpp`\n\nand its **Tools**, which are provided to the LLM to make system calls. For example there are \"read file\" or \"get date time\" tools.\n\nI realized that programs like OpenCode are essentially the **same thing** as `llama-cpp`\n\nwith tools. With a prompt, I managed to have Gemma 4 and Qwen 3.6 edit a Rust program file. It is necessary to include in the prompt the project's location, and what you want to have it do.\n\nInstead of including all the exact details in a prompt, it is possible to **save the instructions** in a **file** (like a **Markdown** file) and specify the file's path in a prompt. The LLM will then read the file (in a tool call) and perform the necessary actions. For example, I create a Markdown file that has instructions on creating a backup file.\n\nAn LLM using a series of tool calls in `llama-cpp`\n\nis similar to **bash script** with **terminal commands**, but using a prompt is **easier** for humans to maintain and read. To enable tool calls in `llama-cpp`\n\n, specify the \"tools\" argument with the value \"all\".", "url": "https://wpnews.pro/news/llama-cpp-tools", "canonical_source": "https://www.dotnetperls.com/2026_7_8_llama-cpp-tools", "published_at": "2026-07-08 07:00:00+00:00", "updated_at": "2026-07-20 15:27:45.419462+00:00", "lang": "en", "topics": ["large-language-models", "ai-tools", "developer-tools"], "entities": ["llama-cpp", "Gemma 4", "Qwen 3.6", "OpenCode"], "alternates": {"html": "https://wpnews.pro/news/llama-cpp-tools", "markdown": "https://wpnews.pro/news/llama-cpp-tools.md", "text": "https://wpnews.pro/news/llama-cpp-tools.txt", "jsonld": "https://wpnews.pro/news/llama-cpp-tools.jsonld"}}