@sidx1scr-apps/prefrontal 1.1.79
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +674 -0
- package/README.md +512 -0
- package/app.js +1593 -0
- package/index.html +576 -0
- package/package.json +31 -0
- package/vendor/highlight-dark.min.css +10 -0
- package/vendor/highlight-light.min.css +10 -0
- package/vendor/highlight.min.js +1213 -0
- package/vendor/marked.min.js +6 -0
package/README.md
ADDED
|
@@ -0,0 +1,512 @@
|
|
|
1
|
+
<p align="center">
|
|
2
|
+
|
|
3
|
+
<table>
|
|
4
|
+
<tr>
|
|
5
|
+
<td><img width="420" alt="Prefrontal screenshot 1" src="https://github.com/user-attachments/assets/ae27f737-5ffe-463c-8c1e-181c3402ae51" /></td>
|
|
6
|
+
<td><img width="420" alt="Prefrontal screenshot 2" src="https://github.com/user-attachments/assets/7674e626-04ec-4c4f-b4ce-62d95942fce5" /></td>
|
|
7
|
+
<td><img width="420" alt="Prefrontal screenshot 3" src="https://github.com/user-attachments/assets/97c5a9c4-de20-4e0d-856d-cfc68777dde1" /></td>
|
|
8
|
+
</tr>
|
|
9
|
+
<tr>
|
|
10
|
+
<td><img width="420" alt="Prefrontal screenshot 4" src="https://github.com/user-attachments/assets/0049b79a-403d-4b7a-a1f1-55272cb81a51" /></td>
|
|
11
|
+
<td><img width="420" alt="Prefrontal screenshot 5" src="https://github.com/user-attachments/assets/bccefeb3-2498-4262-9960-b0849075fe32" /></td>
|
|
12
|
+
<td><img width="420" alt="Prefrontal screenshot 6" src="https://github.com/user-attachments/assets/dd1eeaf0-af56-455c-b4f7-26bfe1c05730" /></td>
|
|
13
|
+
</tr>
|
|
14
|
+
</table>
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
</p>
|
|
18
|
+
|
|
19
|
+
# π§ Prefrontal β Local AI Chatbot
|
|
20
|
+
|
|
21
|
+

|
|
22
|
+

|
|
23
|
+

|
|
24
|
+

|
|
25
|
+

|
|
26
|
+
[](https://github.com/sidx1-scratch/prefrontal/actions/workflows/ci.yml)
|
|
27
|
+
[](https://github.com/sidx1-scratch/prefrontal/actions/workflows/npm-publish-github-packages.yml)
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
**100% Offline Β· No Ads Β· Your Data Stays on Your Device**
|
|
31
|
+
|
|
32
|
+
Prefrontal is an open-source, privacy-first chat interface for local AI models. It works with **Ollama** (desktop), **Llama.cpp** (any platform, including Android via Termux), and optionally **OpenRouter** if you'd rather skip local setup entirely. No cloud dependency, no telemetry, no subscriptions.
|
|
33
|
+
|
|
34
|
+
π **[Live demo](https://prefrontal-five.vercel.app/)** β see what the UI looks like before installing.
|
|
35
|
+
|
|
36
|
+
> [!NOTE]
|
|
37
|
+
> The hosted live demo only supports the OpenRouter runtime (it can't reach a local Ollama or Llama.cpp server from the web). It also stores your API key in a browser cookie, so opening the demo in a private/incognito window will prompt you to set one up again. Run Prefrontal locally if you want the full privacy picture β see [Privacy & Data](#-privacy--data).
|
|
38
|
+
|
|
39
|
+
---
|
|
40
|
+
|
|
41
|
+
## Table of Contents
|
|
42
|
+
|
|
43
|
+
- [Requirements](#-requirements)
|
|
44
|
+
- [Quick Start](#-quick-start)
|
|
45
|
+
- [Installation Options](#-installation-options)
|
|
46
|
+
- [Setting Up Your AI Backend](#-setting-up-your-ai-backend)
|
|
47
|
+
- [Personality Presets](#-personality-presets)
|
|
48
|
+
- [Temperature Control](#οΈ-temperature-control)
|
|
49
|
+
- [Web Search (OpenRouter only)](#-web-search-openrouter-only)
|
|
50
|
+
- [Features](#-features)
|
|
51
|
+
- [Keyboard Shortcuts](#οΈ-keyboard-shortcuts)
|
|
52
|
+
- [Privacy & Data](#-privacy--data)
|
|
53
|
+
- [Troubleshooting](#-troubleshooting)
|
|
54
|
+
- [Contributing](#-contributing)
|
|
55
|
+
- [License](#-license)
|
|
56
|
+
|
|
57
|
+
---
|
|
58
|
+
|
|
59
|
+
## β
Requirements
|
|
60
|
+
|
|
61
|
+
- **Node.js v18+** and **npm** β to run the Prefrontal server itself
|
|
62
|
+
- **Git** β only if you choose the Clone & Run or GitHub Packages install method below; the Release download method needs no git at all
|
|
63
|
+
- One AI backend, set up below:
|
|
64
|
+
- An [OpenRouter](https://openrouter.ai) account (free, no install), **or**
|
|
65
|
+
- [Ollama](https://ollama.com) installed locally, **or**
|
|
66
|
+
- A [Llama.cpp](https://github.com/ggml-org/llama.cpp) server you've built or downloaded
|
|
67
|
+
|
|
68
|
+
---
|
|
69
|
+
|
|
70
|
+
## β‘ Quick Start
|
|
71
|
+
|
|
72
|
+
Pick whichever backend matches your needs β cloud convenience or fully offline privacy. (Want Llama.cpp or Android instead? Jump to [Setting Up Your AI Backend](#-setting-up-your-ai-backend).)
|
|
73
|
+
|
|
74
|
+
> [!TIP]
|
|
75
|
+
> Don't want to install git? Skip the `git clone` step below and use [Download a Release](#option-1-download-a-release-no-git-required) instead β everything else is identical.
|
|
76
|
+
|
|
77
|
+
### π Easiest: OpenRouter *(no local AI install needed)*
|
|
78
|
+
|
|
79
|
+
OpenRouter gives you free access to powerful cloud models β no GPU, no Ollama, nothing extra to install. The fastest way to get running.
|
|
80
|
+
|
|
81
|
+
**1. Get a free API key**
|
|
82
|
+
Sign up at [openrouter.ai](https://openrouter.ai) and copy your API key from the dashboard.
|
|
83
|
+
|
|
84
|
+
**2. Install and run Prefrontal**
|
|
85
|
+
```bash
|
|
86
|
+
git clone https://github.com/sidx1-scratch/prefrontal
|
|
87
|
+
cd prefrontal
|
|
88
|
+
npm install && npm start
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
**3. Configure and go**
|
|
92
|
+
Open `http://localhost:3000`, go to Settings, and set:
|
|
93
|
+
- Runtime β **OpenRouter**
|
|
94
|
+
- API Key β paste your key
|
|
95
|
+
- Model β pick any free model (e.g. `mistralai/mistral-7b-instruct:free`)
|
|
96
|
+
|
|
97
|
+
Done β no GPU or model download required.
|
|
98
|
+
|
|
99
|
+
**Optional: turn on Web Search**
|
|
100
|
+
Still in Settings, flip the **Web Search** toggle (it only appears when Runtime is set to OpenRouter). The model can then pull in live DuckDuckGo results before answering, with any sources it used shown as clickable chips under its reply. See [Web Search](#-web-search-openrouter-only) below.
|
|
101
|
+
|
|
102
|
+
> [!NOTE]
|
|
103
|
+
> the duckduckgo instant answer api only knows more known things so if you for example tell it to search up the prefrontal repo it wont find it because instant answer doesn't know about it. also when it searches up something it looks like this: <img width="449" height="136" alt="image" src="https://github.com/user-attachments/assets/ed4e4914-459e-43bd-8c45-ea6d578634d7" />
|
|
104
|
+
|
|
105
|
+
---
|
|
106
|
+
|
|
107
|
+
### π₯οΈ Fully Offline: Ollama *(no API key, your data never leaves your machine)*
|
|
108
|
+
|
|
109
|
+
**1. Install Ollama and pull a model**
|
|
110
|
+
```bash
|
|
111
|
+
# Download Ollama from https://ollama.com, then:
|
|
112
|
+
ollama serve &
|
|
113
|
+
ollama pull gemma3:4b
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
**2. Install and run Prefrontal**
|
|
117
|
+
```bash
|
|
118
|
+
git clone https://github.com/sidx1-scratch/prefrontal
|
|
119
|
+
cd prefrontal
|
|
120
|
+
npm install && npm start
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
**3. Configure and go**
|
|
124
|
+
Open `http://localhost:3000`, go to Settings, and set:
|
|
125
|
+
- Runtime β **Ollama**
|
|
126
|
+
- Server URL β `http://localhost:11434`
|
|
127
|
+
- Model β `gemma3:4b`
|
|
128
|
+
|
|
129
|
+
---
|
|
130
|
+
|
|
131
|
+
## π¦ Installation Options
|
|
132
|
+
|
|
133
|
+
Four ways to get Prefrontal running locally β pick whichever fits how you work.
|
|
134
|
+
|
|
135
|
+
| Method | Best if you... | Git needed? |
|
|
136
|
+
|---|---|---|
|
|
137
|
+
| π₯ **Download a Release** | don't want to install or touch git at all | β No |
|
|
138
|
+
| β‘ **Quick Install Script** | want a one-line install with no git and no extra repo clutter | β No |
|
|
139
|
+
| 𧬠**Clone & Run** | are comfortable with git and want to stay on the latest commit | β
Yes |
|
|
140
|
+
| π **GitHub Packages** | want to install once and run from anywhere without keeping a source folder around | β
Yes (login only) |
|
|
141
|
+
|
|
142
|
+
### Option 1: Download a Release *(no Git required)*
|
|
143
|
+
|
|
144
|
+
If you don't want to mess around with git, you don't have to β every release ships with a ready-made source archive you can just download.
|
|
145
|
+
|
|
146
|
+
**1. Grab the latest release**
|
|
147
|
+
Open the [Releases page](https://github.com/sidx1-scratch/prefrontal/releases/latest) and, under **Assets**, download `Source code (zip)` (Windows/macOS) or `Source code (tar.gz)` (Linux/macOS).
|
|
148
|
+
|
|
149
|
+
**2. Extract it**
|
|
150
|
+
Unzip the archive anywhere you like β Desktop, Documents, wherever's convenient.
|
|
151
|
+
|
|
152
|
+
**3. Install and run**
|
|
153
|
+
Open a terminal inside the extracted folder β on Windows, Shift + Right-click the folder and choose "Open in Terminal" or "Open PowerShell window here" β and run:
|
|
154
|
+
```bash
|
|
155
|
+
npm install
|
|
156
|
+
npm start
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
That's the whole process. No `git`, no GitHub account, no cloning.
|
|
160
|
+
|
|
161
|
+
> [!TIP]
|
|
162
|
+
> To update later, just download the newest release the same way, extract it to a fresh folder, and run `npm install` again there.
|
|
163
|
+
|
|
164
|
+
### Option 2: Quick Install Script *(no Git required, fetches only the files the app needs)*
|
|
165
|
+
|
|
166
|
+
Prefer not to clone the whole repo (including docs, CI workflows, and tests) just to run the app? This one-liner downloads only the runtime-required files β `app.js`, `index.html`, `style.css`, `manifest.json`, `package.json`, `package-lock.json`, and the `vendor/` libraries β straight from GitHub, no `git` involved.
|
|
167
|
+
|
|
168
|
+
```bash
|
|
169
|
+
curl -fsSL https://raw.githubusercontent.com/sidx1-scratch/prefrontal/refs/heads/main/install.sh | bash
|
|
170
|
+
cd prefrontal
|
|
171
|
+
npm install && npm start
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
By default it installs into a `prefrontal` folder in your current directory. To install into a different folder name instead:
|
|
175
|
+
|
|
176
|
+
```bash
|
|
177
|
+
curl -fsSL https://raw.githubusercontent.com/sidx1-scratch/prefrontal/refs/heads/main/install.sh | bash -s -- my-folder-name
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
> [!TIP]
|
|
181
|
+
> To update later, just re-run the same command β it'll re-fetch the latest versions of the required files into the same folder.
|
|
182
|
+
|
|
183
|
+
> [!TIP]
|
|
184
|
+
> Windows users: the install script requires a shell that supports bash β Git Bash (installed alongside Git for Windows) works well. If you'd rather not install that, the Download a Release, Clone & Run, and GitHub Packages options all work natively on Windows without it.
|
|
185
|
+
|
|
186
|
+
|
|
187
|
+
### Option 3: Clone & Run *(quickest if you're comfortable with git)*
|
|
188
|
+
|
|
189
|
+
No authentication needed β just clone and go. Best if you want to poke around the source, track updates as they land, or contribute back.
|
|
190
|
+
|
|
191
|
+
```bash
|
|
192
|
+
git clone https://github.com/sidx1-scratch/prefrontal
|
|
193
|
+
cd prefrontal
|
|
194
|
+
npm install
|
|
195
|
+
npm start
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
A local web server starts and the app opens automatically at `http://localhost:3000`.
|
|
199
|
+
|
|
200
|
+
> [!TIP]
|
|
201
|
+
> To update later, run `git pull` from inside the `prefrontal` folder, then `npm install` again in case dependencies changed.
|
|
202
|
+
|
|
203
|
+
### Option 4: Install via GitHub Packages
|
|
204
|
+
|
|
205
|
+
More setup upfront, but once installed you can run Prefrontal from anywhere on your machine without keeping the source folder around.
|
|
206
|
+
|
|
207
|
+
**1. Authenticate with GitHub Packages**
|
|
208
|
+
```bash
|
|
209
|
+
npm login --scope=@sidx1-scratch --auth-type=legacy --registry=https://npm.pkg.github.com
|
|
210
|
+
```
|
|
211
|
+
Use your GitHub username and a [Personal Access Token](https://github.com/settings/tokens) as the password.
|
|
212
|
+
|
|
213
|
+
**2. Install globally**
|
|
214
|
+
```bash
|
|
215
|
+
npm install -g @sidx1-scratch/prefrontal
|
|
216
|
+
```
|
|
217
|
+
|
|
218
|
+
**3. Run from anywhere**
|
|
219
|
+
```bash
|
|
220
|
+
npm explore @sidx1-scratch/prefrontal -- npm start
|
|
221
|
+
```
|
|
222
|
+
|
|
223
|
+
> [!TIP]
|
|
224
|
+
> To update later, just run `npm install -g @sidx1-scratch/prefrontal` again.
|
|
225
|
+
|
|
226
|
+
---
|
|
227
|
+
|
|
228
|
+
## π§ Setting Up Your AI Backend
|
|
229
|
+
|
|
230
|
+
You need **one** of the following backends. Pick whichever suits your setup.
|
|
231
|
+
|
|
232
|
+
### Option A: OpenRouter *(easiest β no local install, free models available)*
|
|
233
|
+
|
|
234
|
+
OpenRouter is an API that routes to dozens of AI models, many of which are free to use. No GPU or model download required β just an API key.
|
|
235
|
+
|
|
236
|
+
**1. Create a free account**
|
|
237
|
+
Sign up at [openrouter.ai](https://openrouter.ai) and grab your API key from [openrouter.ai/keys](https://openrouter.ai/keys).
|
|
238
|
+
|
|
239
|
+
**2. Configure Prefrontal**
|
|
240
|
+
- Runtime β **OpenRouter**
|
|
241
|
+
- API Key β paste your key
|
|
242
|
+
- Model β enter any model ID from [openrouter.ai/models](https://openrouter.ai/models)
|
|
243
|
+
|
|
244
|
+
**Recommended free models to start with:**
|
|
245
|
+
|
|
246
|
+
| Model | ID |
|
|
247
|
+
|---|---|
|
|
248
|
+
| Mistral 7B Instruct | `mistralai/mistral-7b-instruct:free` |
|
|
249
|
+
| Llama 3.2 3B | `meta-llama/llama-3.2-3b-instruct:free` |
|
|
250
|
+
| Gemma 4 31B | `google/gemma-4-31b-it:free` |
|
|
251
|
+
|
|
252
|
+
> [!NOTE]
|
|
253
|
+
> Free model IDs and rate limits change as providers rotate promotions. If one of the IDs above 404s, check the current list at [openrouter.ai/models?q=free](https://openrouter.ai/models?q=free). Also the mistral model recommended is hard to find so use this link: [Mistral 7B Instruct Free](https://openrouter.ai/mistralai/mistral-7b-instruct:free)
|
|
254
|
+
|
|
255
|
+
|
|
256
|
+
---
|
|
257
|
+
|
|
258
|
+
### Option B: Ollama *(best for fully offline use β Windows, macOS, Linux)*
|
|
259
|
+
|
|
260
|
+
**1. Install Ollama**
|
|
261
|
+
Download from [ollama.com](https://ollama.com) and run the installer.
|
|
262
|
+
|
|
263
|
+
**2. Start the server**
|
|
264
|
+
```bash
|
|
265
|
+
ollama serve
|
|
266
|
+
```
|
|
267
|
+
This starts Ollama on `http://localhost:11434`. Keep this terminal open.
|
|
268
|
+
|
|
269
|
+
**3. Pull a model**
|
|
270
|
+
```bash
|
|
271
|
+
# Recommended β small, fast, great quality:
|
|
272
|
+
ollama pull gemma3:4b
|
|
273
|
+
|
|
274
|
+
# More capable (needs more RAM):
|
|
275
|
+
ollama pull gemma3:12b
|
|
276
|
+
ollama pull llama3.2
|
|
277
|
+
ollama pull mistral
|
|
278
|
+
```
|
|
279
|
+
|
|
280
|
+
**4. Configure Prefrontal**
|
|
281
|
+
- Open Settings (βοΈ icon or `Ctrl+,`)
|
|
282
|
+
- Runtime β **Ollama**
|
|
283
|
+
- Server URL β `http://localhost:11434`
|
|
284
|
+
- Model β type `gemma3:4b` or click **Refresh** to pick from installed models
|
|
285
|
+
|
|
286
|
+
---
|
|
287
|
+
|
|
288
|
+
### Option C: Llama.cpp *(cross-platform β Windows, macOS, Linux, Android)*
|
|
289
|
+
|
|
290
|
+
Llama.cpp exposes an OpenAI-compatible REST API.
|
|
291
|
+
|
|
292
|
+
#### π₯οΈ Desktop (Windows / macOS / Linux)
|
|
293
|
+
|
|
294
|
+
**Download a pre-built release:**
|
|
295
|
+
[github.com/ggml-org/llama.cpp/releases](https://github.com/ggml-org/llama.cpp/releases)
|
|
296
|
+
|
|
297
|
+
**Or build from source:**
|
|
298
|
+
```bash
|
|
299
|
+
git clone https://github.com/ggml-org/llama.cpp
|
|
300
|
+
cd llama.cpp
|
|
301
|
+
cmake -B build -DGGML_BLAS=ON # optional: swap in a GPU flag, e.g. -DGGML_CUDA=ON
|
|
302
|
+
cmake --build build --config Release
|
|
303
|
+
```
|
|
304
|
+
|
|
305
|
+
**Start the server** (run from the `llama.cpp` folder):
|
|
306
|
+
```bash
|
|
307
|
+
# Option 1: auto-download a model from Hugging Face by name
|
|
308
|
+
./build/bin/llama-server -hf ggml-org/gemma-3-4b-it-GGUF --port 8080 --host 0.0.0.0 -c 8192
|
|
309
|
+
|
|
310
|
+
# Option 2: point -m at a .gguf file you already have
|
|
311
|
+
./build/bin/llama-server -m models/your_model.gguf --port 8080 --host 0.0.0.0 -c 8192
|
|
312
|
+
```
|
|
313
|
+
|
|
314
|
+
**Configure Prefrontal:**
|
|
315
|
+
- Runtime β **Llama.cpp / OpenAI**
|
|
316
|
+
- Server URL β `http://localhost:8080/v1`
|
|
317
|
+
- Model β the model name/filename you started the server with (e.g. `gemma-3-4b-it-GGUF` or `gemma-2-2b.gguf`)
|
|
318
|
+
|
|
319
|
+
---
|
|
320
|
+
|
|
321
|
+
#### π± Android / Mobile *(via Termux)*
|
|
322
|
+
|
|
323
|
+
**1. Install Termux**
|
|
324
|
+
Get it from [F-Droid](https://f-droid.org/en/packages/com.termux/) β not the Play Store version, which is outdated.
|
|
325
|
+
|
|
326
|
+
**2. Install dependencies**
|
|
327
|
+
```bash
|
|
328
|
+
pkg update && pkg upgrade
|
|
329
|
+
pkg install clang git cmake make python3 libcurl
|
|
330
|
+
```
|
|
331
|
+
|
|
332
|
+
**3. Build Llama.cpp**
|
|
333
|
+
```bash
|
|
334
|
+
git clone https://github.com/ggml-org/llama.cpp
|
|
335
|
+
cd llama.cpp
|
|
336
|
+
cmake -B build
|
|
337
|
+
cmake --build build --config Release -j4
|
|
338
|
+
```
|
|
339
|
+
|
|
340
|
+
**4. Start the server** (auto-downloads a small model on first run)
|
|
341
|
+
```bash
|
|
342
|
+
./build/bin/llama-server -hf ggml-org/gemma-3-1b-it-GGUF \
|
|
343
|
+
--port 8080 --host 0.0.0.0 -c 4096
|
|
344
|
+
```
|
|
345
|
+
|
|
346
|
+
> [!TIP]
|
|
347
|
+
> Prefer to manage the file yourself instead of auto-downloading? Grab any compact GGUF model β something in the 1β4B parameter range, quantized to Q4, fits comfortably on most phones β and pass it with `-m path/to/model.gguf` instead of `-hf`.
|
|
348
|
+
|
|
349
|
+
**5. Open Prefrontal**
|
|
350
|
+
In a second Termux session, start the Node.js server:
|
|
351
|
+
```bash
|
|
352
|
+
cd prefrontal && npm start
|
|
353
|
+
```
|
|
354
|
+
Then open `http://127.0.0.1:3000` in your Android browser.
|
|
355
|
+
|
|
356
|
+
**Configure Prefrontal:**
|
|
357
|
+
- Runtime β **Llama.cpp / OpenAI**
|
|
358
|
+
- Server URL β `http://127.0.0.1:8080/v1`
|
|
359
|
+
- β οΈ Use `127.0.0.1` instead of `localhost` on Android β they may not resolve the same way
|
|
360
|
+
|
|
361
|
+
---
|
|
362
|
+
|
|
363
|
+
### External or LAN Servers
|
|
364
|
+
|
|
365
|
+
If your AI backend runs on a different machine (home server, another PC), bind it to `0.0.0.0` and enter its LAN IP in Settings β e.g. `http://192.168.1.100:11434` for Ollama or `http://192.168.1.100:8080/v1` for Llama.cpp.
|
|
366
|
+
|
|
367
|
+
---
|
|
368
|
+
|
|
369
|
+
## π Personality Presets
|
|
370
|
+
|
|
371
|
+
Prefrontal includes **4 built-in personality presets** that change the system prompt and temperature simultaneously. Switch between them on the welcome screen or in Settings.
|
|
372
|
+
|
|
373
|
+
| Preset | Temp | Best For |
|
|
374
|
+
|---|---|---|
|
|
375
|
+
| βοΈ Balanced | 0.7 | General tasks, Q&A, learning |
|
|
376
|
+
| π¨ Creative | 1.1 | Writing, brainstorming, storytelling |
|
|
377
|
+
| π― Precise | 0.2 | Facts, summaries, concise answers |
|
|
378
|
+
| π» Developer | 0.3 | Code review, debugging, technical docs |
|
|
379
|
+
|
|
380
|
+
You can also write a fully **custom** system prompt β edit the System Prompt box in Settings, and the preset selector switches to "Custom" automatically.
|
|
381
|
+
|
|
382
|
+
---
|
|
383
|
+
|
|
384
|
+
## π‘οΈ Temperature Control
|
|
385
|
+
|
|
386
|
+
Temperature controls how random or creative the AI's outputs are.
|
|
387
|
+
|
|
388
|
+
| Value | Behavior |
|
|
389
|
+
|---|---|
|
|
390
|
+
| `0.0` | Fully deterministic β same input produces the same output |
|
|
391
|
+
| `0.2β0.4` | Precise and focused |
|
|
392
|
+
| `0.7` | Balanced (default) |
|
|
393
|
+
| `1.0β1.2` | Creative and varied |
|
|
394
|
+
| `1.5β2.0` | Wild, experimental, sometimes incoherent |
|
|
395
|
+
|
|
396
|
+
> [!TIP]
|
|
397
|
+
> Temperature is sent with every message β just adjust the slider, save, and it applies to the next generation. No restart needed.
|
|
398
|
+
|
|
399
|
+
---
|
|
400
|
+
|
|
401
|
+
## π Web Search (OpenRouter only)
|
|
402
|
+
|
|
403
|
+
When you're running on **OpenRouter**, Prefrontal can let the model search the live web before it answers β useful for anything newer than the model's training data, or that just needs a source. This isn't OpenRouter's own search plugin; Prefrontal implements it itself, on top of the free [DuckDuckGo Instant Answer API](https://duckduckgo.com/api), so it works with any OpenRouter model, free or paid.
|
|
404
|
+
|
|
405
|
+
**How to enable it**
|
|
406
|
+
1. Settings β set Runtime to **OpenRouter**.
|
|
407
|
+
2. A new **Web Search** toggle appears (it's hidden for Ollama/Llama.cpp, since those runtimes have no internet access of their own). Flip it on.
|
|
408
|
+
3. Save. That's it β every message you send from then on can trigger a search when the model decides it's useful.
|
|
409
|
+
|
|
410
|
+
**How it works**
|
|
411
|
+
Turning the toggle on quietly appends a short instruction to the system prompt, telling the model that if it wants to search, it should reply with *only* a small JSON object β `{"search_query": "..."}` β instead of a normal answer. Prefrontal watches for that JSON: if a reply matches it, nothing is shown to you yet (you'll see a "π Searching the web forβ¦" status instead of raw JSON), Prefrontal queries DuckDuckGo directly from your browser, and feeds the results back to the model as a follow-up message so it can write the real answer. Any pages the model drew on come back as clickable source chips underneath the final reply. This whole exchange (search request β DuckDuckGo β real answer) happens automatically within a single one of your messages β capped at two search rounds so a stubborn model can't loop forever β and only the final answer is saved to your chat history.
|
|
412
|
+
|
|
413
|
+
> [!NOTE]
|
|
414
|
+
> Web search only applies to the OpenRouter runtime and only while the toggle is on. Ollama and Llama.cpp responses are unaffected either way, since local models have no path to the internet. Because this uses DuckDuckGo's free Instant Answer API rather than a full search index, it's strongest for facts, definitions, and well-known topics, and can come back empty for very narrow or breaking-news queries β the model is told to just answer from its own knowledge when that happens. Since this is prompt-based rather than a model-native tool-call feature, it depends on the model actually following the instruction; most capable instruction-tuned models handle it reliably, but very small/free models occasionally ignore it.
|
|
415
|
+
|
|
416
|
+
---
|
|
417
|
+
|
|
418
|
+
## π¨ Features
|
|
419
|
+
|
|
420
|
+
| Feature | Details |
|
|
421
|
+
|---|---|
|
|
422
|
+
| π¬ Chat | Full conversation history with any local AI model |
|
|
423
|
+
| π Streaming | Real-time, token-by-token generation |
|
|
424
|
+
| π Personality Presets | 4 built-in modes with one click |
|
|
425
|
+
| π‘οΈ Temperature Control | Live-sent with every request |
|
|
426
|
+
| π Web Search | OpenRouter-only: prompt-driven DuckDuckGo search with clickable source citations |
|
|
427
|
+
| π Multi-Backend | OpenRouter (cloud), Ollama, and Llama.cpp over local or LAN |
|
|
428
|
+
| π LAN & External | Connect to dedicated AI servers on your network |
|
|
429
|
+
| πΎ Multi-Chat | Unlimited saved local conversations |
|
|
430
|
+
| π Search | Instant conversation search |
|
|
431
|
+
| π± PWA & Mobile Ready | Install as an app on iOS/Android; safe-area aware |
|
|
432
|
+
| π¨ Refined UI | 4 themes: Dark, Midnight, Emerald, Light |
|
|
433
|
+
| π§ Local Profile | Device identity stored locally β no accounts |
|
|
434
|
+
| π€ Export | Export chats as Markdown, profile as JSON |
|
|
435
|
+
| π 100% Private | Zero network calls except to your own model server |
|
|
436
|
+
|
|
437
|
+
---
|
|
438
|
+
|
|
439
|
+
## β¨οΈ Keyboard Shortcuts
|
|
440
|
+
|
|
441
|
+
| Shortcut | Action |
|
|
442
|
+
|---|---|
|
|
443
|
+
| `Ctrl + N` | New conversation |
|
|
444
|
+
| `Ctrl + ,` | Open Settings |
|
|
445
|
+
| `Enter` | Send message *(configurable)* |
|
|
446
|
+
| `Shift + Enter` | New line in input |
|
|
447
|
+
| `Escape` | Close modal |
|
|
448
|
+
|
|
449
|
+
---
|
|
450
|
+
|
|
451
|
+
## π Privacy & Data
|
|
452
|
+
|
|
453
|
+
Running Prefrontal locally (Ollama or Llama.cpp), no chat data or API keys leave your machine β the app makes network calls only to the model server you configured, which is also on your machine or LAN.
|
|
454
|
+
|
|
455
|
+
If you use the **OpenRouter** runtime instead, your messages are sent to OpenRouter's API to be routed to whichever model you picked, so at that point you're trusting OpenRouter and the model provider with your prompts β the same as using any other cloud AI service.
|
|
456
|
+
|
|
457
|
+
> [!WARNING]
|
|
458
|
+
> The hosted [live demo](https://prefrontal-five.vercel.app/) is a special case: it only works with OpenRouter, and it stores your API key in a browser cookie rather than anywhere on a device you control. Treat it as a way to preview the UI, not as your daily driver β for real use, run Prefrontal locally.
|
|
459
|
+
|
|
460
|
+
---
|
|
461
|
+
|
|
462
|
+
## π§ Troubleshooting
|
|
463
|
+
|
|
464
|
+
### β "Cannot connect to server"
|
|
465
|
+
- Make sure your AI backend is **running** before opening Prefrontal.
|
|
466
|
+
- Ollama: run `ollama serve` in a terminal.
|
|
467
|
+
- Llama.cpp: confirm `llama-server` is running with the correct port.
|
|
468
|
+
- Verify Settings β **Server URL** matches your backend exactly (including `/v1` for Llama.cpp).
|
|
469
|
+
- On Android, use `http://127.0.0.1` β `localhost` may not resolve correctly.
|
|
470
|
+
|
|
471
|
+
### β "Model not found"
|
|
472
|
+
- **Ollama**: run `ollama list` to see installed models; copy the exact name including its tag.
|
|
473
|
+
- **Llama.cpp**: the model name is the `.gguf` filename (or `-hf` repo name) you passed to `llama-server`.
|
|
474
|
+
- Click **Refresh** in Settings to auto-populate the model list.
|
|
475
|
+
|
|
476
|
+
### β Streaming stops or output is garbled
|
|
477
|
+
- Lower the **Context Window** setting β the model may be running out of memory.
|
|
478
|
+
- Try a smaller model (e.g. `gemma3:4b` instead of `gemma3:12b`).
|
|
479
|
+
- Restart the backend server and try again.
|
|
480
|
+
|
|
481
|
+
### β Temperature changes have no effect
|
|
482
|
+
- Temperature applies to the **next message** only β not retroactively.
|
|
483
|
+
- Make sure you click **Save Settings** after adjusting the slider.
|
|
484
|
+
- Some models enforce a minimum temperature internally; very low values may behave like `0.0`.
|
|
485
|
+
|
|
486
|
+
### β App opens but is blank
|
|
487
|
+
- Confirm you ran `npm start`, not `npm run build`.
|
|
488
|
+
- Try `npx serve .` as an alternative server.
|
|
489
|
+
- Open the browser console (`F12`) and check for errors.
|
|
490
|
+
|
|
491
|
+
### β `npm install` fails or hangs after downloading a release zip
|
|
492
|
+
- Make sure you extracted the **entire** archive before running commands inside it β a partial unzip is a common culprit.
|
|
493
|
+
- Confirm Node.js v18+ is installed: `node -v`.
|
|
494
|
+
- Delete `node_modules` (if present) and run `npm install` again.
|
|
495
|
+
|
|
496
|
+
---
|
|
497
|
+
|
|
498
|
+
## π€ Contributing
|
|
499
|
+
|
|
500
|
+
Issues and PRs are welcome at [github.com/sidx1-scratch/prefrontal](https://github.com/sidx1-scratch/prefrontal). If you spot a bug or have a feature idea, open an issue or comment in a discussion before submitting a large PR so the approach can be discussed first.
|
|
501
|
+
|
|
502
|
+
### Contribution Rule
|
|
503
|
+
Prefrontal is a zeroβbuild, zeroβdependency project.
|
|
504
|
+
You're welcome to contribute, but all changes must keep the app lightweight and fully runnable as plain HTML/CSS/JS.
|
|
505
|
+
No TypeScript, no frameworks, no bundlers, no compilation β ever.
|
|
506
|
+
The project must remain simple enough that anyone can open the folder and understand it.
|
|
507
|
+
|
|
508
|
+
---
|
|
509
|
+
|
|
510
|
+
## π License
|
|
511
|
+
|
|
512
|
+
Prefrontal is released under the [GNU GPLv3](https://www.gnu.org/licenses/gpl-3.0.html) license.
|