From 325bc78accb0d5347c64c11606a806514d26b566 Mon Sep 17 00:00:00 2001 From: Marc R Kellerman <9411143+mkellerman@users.noreply.github.com> Date: Tue, 25 Apr 2023 08:48:43 -0700 Subject: [PATCH] add chatbot-ui example --- examples/README.md | 11 +++++++++++ examples/chatbot-ui/README.md | 18 ++++++++++++++++++ examples/chatbot-ui/docker-compose.yaml | 23 +++++++++++++++++++++++ 3 files changed, 52 insertions(+) create mode 100644 examples/README.md create mode 100644 examples/chatbot-ui/README.md create mode 100644 examples/chatbot-ui/docker-compose.yaml diff --git a/examples/README.md b/examples/README.md new file mode 100644 index 0000000..f2df0e2 --- /dev/null +++ b/examples/README.md @@ -0,0 +1,11 @@ +# Examples + +Here is a list of projects that can easily be integrated with the LocalAI backend. + +## Projects + +- [chatbot-ui](https://github.com/go-skynet/LocalAI/tree/master/examples/chatbot-ui/) (by [@mkellerman](https://github.com/mkellerman)) + +## Want to contribute? + +Create an issue, and put `Example: ` in the title! We will post your examples here. \ No newline at end of file diff --git a/examples/chatbot-ui/README.md b/examples/chatbot-ui/README.md new file mode 100644 index 0000000..398c4e1 --- /dev/null +++ b/examples/chatbot-ui/README.md @@ -0,0 +1,18 @@ +# chatbot-ui + + +## Setup +- Set the `services > api > volumes` parameter in the docker-compose.yaml file. This should point to your local folder with your models. +- Copy/Rename your model file to `gpt-3.5-turbo` (without any .bin file extension). +- Type `docker compose up` to run the api and the Web UI. +- Open http://localhost:3000 for the Web UI. + + +## Known issues +- Can't select the model from the UI. Seems hardcoded to `gpt-3.5-turbo`. +- If your machine is slow, the UI will timeout on the request to the API. + + +### Links + +- [mckaywrigley/chatbot-ui](https://github.com/mckaywrigley/chatbot-ui) diff --git a/examples/chatbot-ui/docker-compose.yaml b/examples/chatbot-ui/docker-compose.yaml new file mode 100644 index 0000000..80efc4e --- /dev/null +++ b/examples/chatbot-ui/docker-compose.yaml @@ -0,0 +1,23 @@ +version: '3.6' + +services: + api: + image: quay.io/go-skynet/local-ai:latest + ports: + - 8080:8080 + environment: + - THREADS=4 + - CONTEXT_SIZE=512 + - DEBUG=true + - MODELS_PATH=/models + volumes: + - ./models:/models:cached + command: ["/usr/bin/local-ai" ] + + chatgpt: + image: ghcr.io/mckaywrigley/chatbot-ui:main + ports: + - 3000:3000 + environment: + - 'OPENAI_API_KEY=sk-XXXXXXXXXXXXXXXXXXXX' + - 'OPENAI_API_HOST=http://host.docker.internal:8080'