summaryrefslogtreecommitdiffstats
path: root/krebs/5pkgs/simple/vicuna-chat/default.nix
diff options
context:
space:
mode:
authorlassulus <git@lassul.us>2024-12-04 19:26:02 +0100
committerlassulus <git@lassul.us>2024-12-04 19:26:02 +0100
commit636d6ee89b15e38a44442c041d255ef8743e5efa (patch)
tree8cebe83c915858e8ac9f83ae43f3c5673c103d35 /krebs/5pkgs/simple/vicuna-chat/default.nix
parent3bd2443831443269ddfe54ab58c917cda6e7f1d5 (diff)
parentd400611016fa4a916adcfcca2f4b997f44351c2b (diff)
Merge remote-tracking branch 'mic92/master'HEADmaster
Diffstat (limited to 'krebs/5pkgs/simple/vicuna-chat/default.nix')
-rw-r--r--krebs/5pkgs/simple/vicuna-chat/default.nix33
1 files changed, 0 insertions, 33 deletions
diff --git a/krebs/5pkgs/simple/vicuna-chat/default.nix b/krebs/5pkgs/simple/vicuna-chat/default.nix
deleted file mode 100644
index db15899d6..000000000
--- a/krebs/5pkgs/simple/vicuna-chat/default.nix
+++ /dev/null
@@ -1,33 +0,0 @@
-{ pkgs, ... }:
-pkgs.writers.writeDashBin "vicuna-chat" ''
- set -efu
-
- export PATH=${with pkgs; lib.makeBinPath [
- coreutils
- curl
- jq
- ]}
-
- CONTEXT=''${CONTEXT:-$(date -Id)}
- PROMPT=$*
-
- if ! test -e "$CONTEXT"; then
- echo -n 'null' > "$CONTEXT"
- fi
-
- add_to_context() {
- jq -rc --argjson message "$1" '. + [$message]' "$CONTEXT" > "$CONTEXT.tmp"
- mv "$CONTEXT.tmp" "$CONTEXT"
- }
-
- add_to_context "{\"role\": \"user\", \"content\": \"$PROMPT\"}"
- response=$(
- jq -nc --slurpfile context "$CONTEXT" '{
- model: "vicuna-13b-v1.5-16k",
- messages: $context[0],
- }' |
- curl -Ss http://vicuna.r/v1/chat/completions -H 'Content-Type: application/json' -d @-
- )
- add_to_context "$(jq -rcn --argjson response "$response" '$response.choices[0].message')"
- jq -rcn --argjson response "$response" '$response.choices[0].message.content'
-''