Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
knoopx committed Oct 30, 2023
1 parent ae2aed7 commit ff90241
Show file tree
Hide file tree
Showing 13 changed files with 495 additions and 314 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
on:
push:
branches:
- master

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: oven-sh/setup-bun@v1
- run: bun install
- run: bun vite build
- uses: actions/upload-pages-artifact@v2
with:
path: "dist"

deploy:
runs-on: ubuntu-latest
needs: build

permissions:
pages: write
id-token: write

environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}

steps:
- uses: actions/configure-pages@v3
- id: deployment
uses: actions/deploy-pages@v2
59 changes: 39 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
@@ -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

<!--
import { pipeline } from "@xenova/transformers"
const summarizationPipeline = await pipeline("summarization", 'Xenova/distilbart-cnn-6-6')
const output = await summarizationPipeline(message.content, {
max_new_tokens: 100
})
console.log(message.content)
console.log(output) -->
- 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
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>LLM</title>
<title>LLM Workbench</title>
</head>
<body>
<div id="root" />
Expand Down
16 changes: 14 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
Empty file removed server.py
Empty file.
46 changes: 24 additions & 22 deletions src/app/ChatConversation.tsx
Original file line number Diff line number Diff line change
@@ -1,49 +1,37 @@
import { Input } from "@/components/ui/input"
import { observer } from "mobx-react"
import { Button } from "../components/ui/button"
import { IoMdTrash, IoMdRefresh } from "react-icons/io"
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 (
<div className="flex flex-col">
<ScrollArea className="flex-auto ">
<div className="mx-auto w-3/5">
{messages.map((message, i) => (
{chat.messages.map((message, i) => (
<Message key={i} {...message} />
))}
</div>
</ScrollArea>
<div className="flex-none flex items-center space-x-4 p-8 min-h-0 mx-auto w-3/5">
<ToggleDarkButton />
<form className="flex-auto flex" onSubmit={chat.onSubmit}>
<Input autoFocus placeholder="Enter text..." />
</form>

<div className="flex-none flex-col flex items-center space-x-4 space-y-2 p-8 min-h-0 mx-auto w-3/5">
<div className="space-x-1">
<ToggleDarkButton />

<Button onClick={chat.regenerate}>
<IoMdRefresh size="1.5em" />
</Button>
<Button onClick={chat.respond}>
<VscDebugContinueSmall size="1.5em" />
<VscDebugStart size="1.5em" />
</Button>
<Button onClick={chat.respond}>
<VscDebugContinue size="1.5em" />
</Button>
<Button onClick={chat.pop}>
<BiArrowToTop size="1.5em" />
Expand All @@ -52,6 +40,20 @@ export const ChatConversation = observer(() => {
<IoMdTrash size="1.5em" />
</Button>
</div>
<Textarea
className="w-full !min-h-[3em]"
value={chat.prompt}
onChange={(e) => chat.setPrompt(e.target.value)}
onKeyDown={(e) => {
if (e.key === "Enter" && !e.shiftKey) {
e.preventDefault()
chat.userMessage(e.target.value)
chat.setPrompt("")
}
}}
autoFocus
placeholder="Enter text..."
/>
</div>
</div>
)
Expand Down

0 comments on commit ff90241

Please sign in to comment.