ref: 1c65e9795d3a51c26a87296d53b0ebe9efdc7719
dir: /README/
These tools use the Open AI API to do chat completions AI requests. It is tested using llama.cpp on a separate Windows machine. For testing, you can run this command on the llama machine: llama-server -m "models\gemma-3-4b-it-Q4_K_M.gguf" --ctx-size 0 --host 0.0.0.0 -n 200 --batch-size 8 --threads 8 --mlock --n-gpu-layers 20 --tensor-split 0.7,0.3 (play around with the detail values until you get a stable environment) TOOLS: - oai: simple shell-like chat between user and assistant - ocomplete: acme interface. USAGE: oai [-q] [-vibe] [-yolo] [-k apikey] [-m model] [-u baseurl] [-s sysprompt] ocomplete [-d] [-k apikey] [-m model] [-u baseurl] baseurl is the http url without the v1/... stuff, with llama-server this is usually just http://server:8080. The apikey and the baseurl are optional if you set them as environment variables ($oaikey and $oaiurl). -d adds debugging output: request and response (fd2). -vibe executes non-destructive commands without asking. -yolo executes all commands without asking. After that, you get a user: prompt for your user messages. Ocomplete: Call the program from within an acme window with some selected text. The whole window contents as well as the filename from the tag will be sent to the API as context, and the LLM response will replace the selected text (or inserted at the cursor location). Oai: -q does not output any prompts, only LLM responses. -s sets the sysprompt. Oai now supports a "meta shell". You can access it by sending a field separator (Ctrl+\). On that shell: - commands will be executed in rc. - prepend commands with a ! to forward the command output to the chat. This will end the meta shell mode. - send another field separator to drop back to the normal chat. Oai now supports tool calling with the following functions: - list_files <folder>: ls $folder - read_file <file>: cat $file - lookman <keyword>: lookman $keyword - man <section> <name>: man $section $name Note that there is not a lot of verification happening. It is possible to call read_file on folders or non-existing items, and it's possible to attempt to read a non-existing man page. By default, any tool call will ask for a user permission. This can be turned off by using the -bb flags (two 'b') to fall into trusted mode. LIBRARY: oai.h and oailib.c expose a simple data structure with a function for easy requests using the chat completions API. These are intended to be reused by different tools.