progai-middleware-example

module
v0.0.0-...-ace2b2a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 27, 2024 License: MIT

README

progai-middleware is an experimental middleware to queue and serve ai endpoints.

The commands in ./cmd are examples of how to use the package.

While developed by prognosticians, progai-middleware is not an official prognostica product.

go run ./cmd/llamacpp \
  --endpoint=http://10.0.0.1:8090/completion \
  --slots=1 \
  --stop "</s>, [INST], [/INST]" \
  --template '{{ range . }}
{{- if eq .Role "system" }} [INST] <system> {{ .Content }} </system> [/INST]
{{- else if eq .Role "user" }} [INST] {{ .Content }} [/INST]
{{- else if eq .Role "tool" }} [INST] <toolresult> {{ .Content }} </toolresult> [/INST]
{{- else }} {{ .Content }}
{{- if .ToolCalls }}{{ range .ToolCalls }}<toolcall> {{ .Function.Name }} with arguments {{ .Function.Arguments }} </toolcall> {{ end }}{{ end -}}
</s>{{ end }}
{{- end }}'

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL