mirror of
https://github.com/R0m1k3/Loki.git
synced 2026-10-21 05:58:13 +02:00
compaction: decider sur le VRAI decompte de tokens (ctx_used du client) au lieu de l'estimation
L'heuristique ~4 char/token sous-estimait le contexte (elle ne voit ni le prompt systeme injecte ni le gabarit de chat), donc le seuil 75% n'etait jamais franchi. Le client envoie desormais ctx_used (prompt_tokens_total deja affiche) ; repli sur l'estimation quand inconnu (terminal).
This commit is contained in:
1 parent
e6c0bbe3b7
commit
2daea32ade
4 files changed
+20
-5
No files matched your search
+1
-1
@@ -1445,7 +1445,7 @@ async function send(){
|
||||
try{
|
||||
const sys=(document.getElementById('sysprompt').value||'').trim();
|
||||
const out = sys ? [{role:'system',content:sys}, ...msgs] : msgs;
|
||||
const r=await jfetch('/api/chat',{method:'POST',headers:{'Content-Type':'application/json'},body:JSON.stringify({messages:out}),signal:abortCtrl.signal});
|
||||
const r=await jfetch('/api/chat',{method:'POST',headers:{'Content-Type':'application/json'},body:JSON.stringify({messages:out,ctx_used:CTX_USED}),signal:abortCtrl.signal});
|
||||
const reader=r.body.getReader(); const dec=new TextDecoder(); let buf='';
|
||||
statsTimer = setInterval(updateStats, 250);
|
||||
while(true){
|
||||
|
||||
Reference in new issue
Block a user