Configurable system prompt in the web GUI
I maintainer di solito rispondono entro 3 giorni
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 85/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- javascript
- Ambito
- frontend
Direzione di ricerca
Lavora in serve/web/app.js: parti dall'oggetto settings costruito da DEFAULTS e store.get("sampling"), quindi apiMessages(), che compone la richiesta di chat in uscita. Aggiungi una voce system_prompt a defaults, un textarea nel drawer di sampling (vedi loadDrawer/saveDrawer e il campo s-seed a cui si suggerisce di ancorarlo), persistilo tramite store.set("sampling") e prepone un messaggio di sistema in apiMessages() quando non è vuoto. Il risultato atteso: digitare testo nel nuovo campo, riaprire il drawer e confermare che la successiva richiesta di chat lo riporti come primo messaggio senza che appaia nella trascrizione; verificare in un browser contro la GUI locale.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
At first, thanks for the great program!
A system prompt can change the output dramatically, especially for story telling etc.
Please add a system prompt text edit in the preferences of the web GUI. Here is a proposal:
--- a/serve/web/app.js
+++ b/serve/web/app.js
@@ -461,7 +461,7 @@
// ------------------------------------------------------------------ Chat
-const DEFAULTS = {thinking: "high", temperature: 0.6, top_p: 0.95, top_k: 20, max: "", seed: "", show: true, esp: true, mcp: true};
+const DEFAULTS = {thinking: "high", temperature: 0.6, top_p: 0.95, top_k: 20, max: "", seed: "", show: true, esp: true, mcp: true, system_prompt: ""};
let settings = {...DEFAULTS, ...store.get("sampling", {})};
let messages = store.get("chat", []);
let attachments = []; // {name, url}
@@ -625,6 +625,8 @@
if (d.open && body.dataset.pending) { body.textContent = messages[+d.closest(".st-msg").dataset.i].reasoning; delete body.dataset.pending; }
}, true);
+// The optional browser-local instruction is prepended to every chat request.
+// It is deliberately not saved in the chat transcript or sent to shared API defaults.
function apiMessages() {
const out = [];
for (const m of messages) {
@@ -637,7 +639,9 @@
out.push(...assistantMessages(m));
}
}
- return out;
+ const systemPrompt = (settings.system_prompt || "").trim();
+ return systemPrompt ? [{role: "system", content: systemPrompt}, ...out] : out;
}
// An answer that used MCP tools goes back as the model wrote it: per round the text before the calls, the calls and
// their results (as the model read them), then the rest - so the next question can build on what the tools found.
@@ -877,6 +881,22 @@
// ------------------------------------------------------------------ the sampling drawer
+function ensureSystemPromptField() {
+ if ($("s-system-prompt")) return;
+
+ const field = document.createElement("div");
+ field.className = "st-field";
+ field.innerHTML =
+ `<label class="st-label" for="s-system-prompt">System prompt</label>` +
+ `<textarea class="st-input" id="s-system-prompt" rows="5" ` +
+ `placeholder="Optional instructions for every message in this chat"></textarea>` +
+ `<span class="muted small">Stored only in this browser; it is sent as the first system message.</span>`;
+
+ $("s-seed").closest(".st-field").insertAdjacentElement("afterend", field);
+}
+
function openDrawer(open) {
$("drawer").dataset.open = String(open);
$("drawer").setAttribute("aria-hidden", String(!open));
@@ -884,10 +904,12 @@
if (open) { loadDrawer(); loadShared(); loadMcp(); }
}
function loadDrawer(s = settings) {
+ ensureSystemPromptField();
for (const b of $("s-thinking").children) b.setAttribute("aria-checked", String(b.dataset.v === s.thinking));
$("s-temp").value = s.temperature; $("s-topp").value = s.top_p; $("s-topk").value = s.top_k;
$("s-max").value = s.max; $("s-seed").value = s.seed;
+ $("s-system-prompt").value = s.system_prompt || "";
$("s-show").setAttribute("aria-checked", String(!!s.show));
$("s-esp").setAttribute("aria-checked", String(s.esp !== false));
$("esp-row").hidden = !projectionLoaded();
@@ -946,10 +968,11 @@
const sel = [...$("s-thinking").children].find((b) => b.getAttribute("aria-checked") === "true");
settings = {thinking: sel ? sel.dataset.v : "high", temperature: +$("s-temp").value, top_p: +$("s-topp").value,
top_k: +$("s-topk").value, max: $("s-max").value.trim(), seed: $("s-seed").value.trim(),
+ system_prompt: $("s-system-prompt").value,
show: $("s-show").getAttribute("aria-checked") === "true",
esp: $("s-esp").getAttribute("aria-checked") === "true",
mcp: $("s-mcp").getAttribute("aria-checked") === "true"};
store.set("sampling", settings);```
- Lingua principale
- C++
- Stelle
- 11.6k
- Fork
- 1k
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di Niko1221/Strata
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
I maintainer di solito rispondono entro 3 giorni
-
[Benchmark] Tesla T4 (sm_75): kIlRows_75 gives +12% on a T4; MMVQ_IL_TABLE.md says sm_75 is offAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
I maintainer di solito rispondono entro 3 giorni
-
[Other] tools/test_strata_mcp.py: unittest.main() sits before the last three test classes, so a direct run skips 7 testsForse già presa Una pull request collegata a questa issue è aperta o già unita. Aperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
I maintainer di solito rispondono entro 3 giorni
-
[Other] tools/test_strata_mcp.py: the Mac DeepSeek list test fails on main (it still expects the two IST-DAS sets)Forse già presa Una pull request collegata a questa issue è aperta o già unita. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 3 giorni
-
[Engine] "Download and prepare" asks for the full 128 GB on an installed NVFP4 pack: the disk check looks in models\<family-tag><model> while setup writes models\<owner>--<repo>Forse già presa Una pull request collegata a questa issue è aperta o già unita. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
Niko1221/Strata#4892 · 1 commento ·
I maintainer di solito rispondono entro 3 giorni
Tutte le issue di Niko1221/Strata
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
pocoproject/poco#5626 ·
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
-
Issue-Bug Needs-Triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
microsoft/winget-cli#6645 ·
I maintainer di solito rispondono entro 2 giorni
-
cleanup help wanted
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
ESPresense/ESPresense#2602 ·
I maintainer di solito rispondono entro 1 giorno