Replies: 6 comments 8 replies
-
|
I’ve worked with similar setups while integrating LLM tooling into internal workflows at my company and the tools all flag on llama-server.exe only works when the server is configured with valid tool definitions in the tools directory. The flag doesn’t automatically enable file access unless the tool JSON files explicitly define those capabilities. |
Beta Was this translation helpful? Give feedback.
-
|
|
Beta Was this translation helpful? Give feedback.
-
|
the two earlier answers are misleading you, neither matches what
what you actually need for read/write local files: llama-server stays the model backend (openai-compatible). you separately run an MCP client like claude desktop, continue, cline, or cursor, point it at llama-server as the LLM, and add an MCP server for filesystem access on the side. for filesystem the canonical one is {
"mcpServers": {
"fs": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-filesystem", "C:/work/some-allowed-dir"]
}
}
}flow: you talk to your MCP client, it asks llama-server (your model) to plan, the model emits a tool_call for
if you want to skip MCP entirely and have llama-server run shell commands itself, that doesn't exist in llama.cpp upstream. you'd need a tiny proxy between your client and llama-server that intercepts tool_calls, executes them, and returns results, but that's home-rolled. honestly the MCP path is exactly what the ecosystem standardized for this and it's less code than the alternative. |
Beta Was this translation helpful? Give feedback.
-
|
Update 2025-05: |
Beta Was this translation helpful? Give feedback.
-
|
Quick follow-up since the edit_file bug (#23246) is now the showstopper, a hybrid setup works around it without losing built-in speed. Keep --tools all enabled for read_file, grep_search, write_file, and exec_shell_command (those are fine), and route just edit_file through @modelcontextprotocol/server-filesystem. Cursor, Continue, and Cline all handle the mixed setup the client picks which backend each tool_call goes to. You skip the read-then-rewrite token tax and you also get directory sandboxing for the edit path. One thing worth flagging given exec_shell_command is enabled by --tools all: the built-in tools have no directory restriction and run as the llama-server process. If the model gets prompt-injected via any content it reads, it can rm -rf or exfiltrate anything the process can reach. Run inside a container or VM with a bind-mounted work directory if this is more than a scratch box. |
Beta Was this translation helpful? Give feedback.
-
|
Great coding, you Lllama guys! I love this project! CLI tool is awesome, SERVER tool is even more awesome! Love it! However, I struggle with one thing in both ver b9584 and b9585 (newest per yesterday), how do I use tools? I have added "--tools all" to the llama-server, via the script I use to start it (on my Linux). In the GUI I see the tools in the "+" next to the message field. I can enable and disable tools there (like the edit text mentioned in comments in here). But, when I ask the LLM loaded (qwen3.6 decent with tools) to "ls this folder" or "edit ~/test.txt" or "curl some-page-url.com" the best answer it can give me is; here is the command I would/will run, then it states the command and nothing happens, or the model gives up waiting and invents/hallucinates a 404 for the curl". Specifically how do I ask "any model" to "cd to this folder xyz" and "ls that folder" and "tell me the filenames you see". What is missing, why does the tools not do anything? I've made my own python GUI that does this, however this GUI and the whole Llama.cpp is way better than all my personal projects, but on this one thing, it is really hard to get to even do anything. So... How? Step by step (ELI5 for those who knows), and please don't skip steps like "you also need to have x.json file in y folder, and also, i forgot to tell you, it can only be done with an MPC server". Please provide a working example that a noob can follow (yes, I 'll be that noob, no problem, i volunteer! he he!) I've tested and read and tested, but that one I struggle with., even though i can code a full GUI in python, enabling LLMs that has not been trained to use tools, to use tools. So clearly with C code, the same must be possible, I just don't get "how to activate it, so that the model who is trained on tools, can use a tool". |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Can someone help me out in understanding how to use --tools all on llama-server.exe?
I've tried searching all sections of this project, but I'm stuck on how to proceed. I've even tried to add http://127.0.0.1:8080 and http://127.0.0.1:8080/tools as MCP endpoints (with and without "use llama-server proxy" enabled), but it didn't work. For some reason, I'm not seeing how to get my LLM to do things like read and write local files, or how to point to which directory it has permission to do these things. I'm able to get mcp.exa.ai to work locally, but that's all I was able to get working.
Hope someone can point me in the right direction!
Thank you.
Beta Was this translation helpful? Give feedback.
All reactions