No description
Find a file
2024-10-19 21:23:02 -05:00
.github/workflows bump python version requirement 2023-11-09 12:03:37 -06:00
fuse_prompts Fix pre-commit stuff 2024-10-19 21:23:02 -05:00
LICENSES initial commit 2023-11-08 16:57:02 -06:00
src/chap/commands Fix pre-commit stuff 2024-10-19 21:23:02 -05:00
.gitignore Update to newest API & add typing 2023-11-09 12:01:05 -06:00
.pre-commit-config.yaml Fix pre-commit stuff 2024-10-19 21:23:02 -05:00
.pylintrc initial commit 2023-11-08 16:57:02 -06:00
Makefile Fix pre-commit stuff 2024-10-19 21:23:02 -05:00
mypy.ini Update to newest API & add typing 2023-11-09 12:01:05 -06:00
pyproject.toml Create an abomination 2024-10-19 15:53:12 -05:00
README.md Fix pre-commit stuff 2024-10-19 21:23:02 -05:00
requirements-dev.txt initial commit 2023-11-08 16:57:02 -06:00

chap-command-fuse

A proof-of-concept fuse plug-in for chap.

Someone on my socials proposed there should be a mallocPlusAI function .. and I realized you can kinda do it today, no changes to the C compiler necessary, by presenting a filesystem interface to an LLM.

Installation

If you installed chap with pip, then run pip install chap-command-explain.

If you installed chap with pipx, then run pipx inject chap chap-command-explain.

Use

Copy the prompts to $HOME/.config/chap/fuse_prompts.

Start the fuse filesystem server:

mkdir /tmp/include/llm
chap fuse /tmp/include/llm

Use it in your C/C++ programs:

#include "llm/include-for/malloc"
#include "llm/include-for/printf"
#include "llm/include-for/size-t"

#include "llm/function-for/square_area returning the area of a square given the length of a side. it takes a double and returns a double."

int main() {
    size_t required =
#include "llm/maIloc/enough space for 4 integers"
;
    char *p = malloc(required);
    printf("Allocated %zu\n", required);

    printf("Area of a square with edge %f is %f\n", 2., square_area(2.));
    return 0;
}
$ gcc -I /tmp/include use_llm.c -lm && ./a.out
Allocated 16
Area of a square with edge 2.000000 is 4.000000
$ fusermount -u -z /tmp/include/llm

Development status

You understand this is a joke, right?