From ec2926c02b4a04df39b57cc3d693032eb49248b5 Mon Sep 17 00:00:00 2001 From: Victor Martinez Date: Mon, 30 Oct 2023 12:52:40 +0100 Subject: [PATCH] wip --- .github/workflows/main.yml | 33 +++ README.md | 59 +++-- index.html | 2 +- package.json | 16 +- server.py | 0 src/app/ChatConversation.tsx | 46 ++-- src/app/ChatSettings.tsx | 480 ++++++++++++++++++++--------------- src/lib/extraction.ts | 33 ++- src/store/Chat.tsx | 109 ++++---- src/store/Message.tsx | 12 +- src/store/Presets.tsx | 11 +- tsconfig.json | 4 +- vite.config.js | 4 + 13 files changed, 495 insertions(+), 314 deletions(-) create mode 100644 .github/workflows/main.yml delete mode 100644 server.py diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..c5700a9 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,33 @@ +on: + push: + branches: + - master + +jobs: + deploy: + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Setup Pages + uses: actions/configure-pages@v3 + + - uses: oven-sh/setup-bun@v1 + - name: Install dependencies + run: bun install + + - name: Build + run: bun vite build + + - name: Upload artifact + uses: actions/upload-pages-artifact@v2 + with: + path: "dist" + + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v2 diff --git a/README.md b/README.md index 336bac3..eaefc8e 100644 --- a/README.md +++ b/README.md @@ -1,27 +1,46 @@ +# LLM Workbench + +A one-stop-shop for all your LLM needs. Unleash the power of FOSS language models on your local machine. + +# Features + +- UI + - Simple, clean interface + - Dark mode +- LLM API Client + - Ollama +- Chat Interface + - Output Streaming + - Regenerate/Continue/Undo/Clear + - Markdown Rendering +- Complete generation control + - System prompts + - Conversation History + - Chat prompt template + # Future Ideas -- TTS via tranformers.js - Some kind of Agents -- Embeddings +- One-shot Tasks/Apps +- Tools +- LLM Connection adapters +- Prompt management +- Model management +- RAG/Embeddings/Vector Search - https://github.com/jacoblee93/fully-local-pdf-chatbot - https://github.com/tantaraio/voy - https://do-me.github.io/SemanticFinder/ - https://github.com/yusufhilmi/client-vector-search -- Tools -- Connection adapters -- Prompt management -- Model manager -- https://winkjs.org/wink-nlp/wink-nlp-in-browsers.html -- https://huggingface.co/ldenoue/distilbert-base-re-punctuate -- https://huggingface.co/Xenova/bert-base-NER -- https://huggingface.co/docs/transformers.js/api/pipelines#pipelinesautomaticspeechrecognitionpipeline -- https://github.com/mwilliamson/mammoth.js - - + - https://github.com/mwilliamson/mammoth.js +- NER + - https://winkjs.org/wink-nlp/wink-nlp-in-browsers.html +- Other pipelines + - TTS + - Re-formating + - https://huggingface.co/ldenoue/distilbert-base-re-punctuate + - Summarization + - https://huggingface.co/ldenoue/distilbart-cnn-6-6 + - https://huggingface.co/Xenova/bert-base-NER + - Translation + - Speech Recognition + - https://huggingface.co/docs/transformers.js/api/pipelines#pipelinesautomaticspeechrecognitionpipeline diff --git a/index.html b/index.html index b2b7444..c8796c7 100644 --- a/index.html +++ b/index.html @@ -3,7 +3,7 @@ - LLM + LLM Workbench
diff --git a/package.json b/package.json index fce8ebb..4a2136f 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,19 @@ { - "name": "any-llm", - "module": "index.ts", + "name": "llm-workbench", "type": "module", + "homepage": "https://knoopx.github.io/llm-workbench/", + "browserslist": { + "production": [ + ">0.2%", + "not dead", + "not op_mini all" + ], + "development": [ + "last 1 chrome version", + "last 1 firefox version", + "last 1 safari version" + ] + }, "devDependencies": { "@types/node": "^20.8.9", "@types/react": "^18.2.33", diff --git a/server.py b/server.py deleted file mode 100644 index e69de29..0000000 diff --git a/src/app/ChatConversation.tsx b/src/app/ChatConversation.tsx index f589ef6..81d49ef 100644 --- a/src/app/ChatConversation.tsx +++ b/src/app/ChatConversation.tsx @@ -1,4 +1,3 @@ -import { Input } from "@/components/ui/input" import { observer } from "mobx-react" import { Button } from "../components/ui/button" import { IoMdTrash, IoMdRefresh } from "react-icons/io" @@ -6,44 +5,33 @@ import { ScrollArea } from "../components/ui/scroll-area" import { Message } from "./ChatConversationMessage" import { ToggleDarkButton } from "./ToggleDarkButton" import { useStore } from "@/store" -import { ImMagicWand } from "react-icons/im" -import { VscDebugContinueSmall } from "react-icons/vsc" +import { VscDebugContinue, VscDebugStart } from "react-icons/vsc" import { BiArrowToTop } from "react-icons/bi" +import { Textarea } from "@/components/ui/textarea" export const ChatConversation = observer(() => { const { activeChat: chat } = useStore() - const messages = [ - // { - // role: "system", - // content: chat.systemMessage, - // }, - // { - // role: "user", - // content: chat.user_message, - // }, - ...chat.messages, - ] return (
- {messages.map((message, i) => ( + {chat.messages.map((message, i) => ( ))}
-
- -
- -
- +
+ + +
+