chat client clean up and switch to llama.cpp with models folder network sharing

This commit is contained in:
Storme-bit
2026-04-09 04:13:21 -07:00
parent 541e664da1
commit 5c6e027fc1
15 changed files with 305 additions and 305 deletions

View File

@@ -36,10 +36,14 @@ router.post('/stream', async (req, res) => {
res.flushHeaders();
try {
await chatStream(sessionId, message, (delta) => {
res.write(`data: ${JSON.stringify({ text: delta})}\n\n`)
})
res.write(`data: ${JSON.stringify({done: true})}\n\n`);
const { model, tokenCount } = await chatStream(
sessionId,
message,
(delta) => { res.write(`data: ${JSON.stringify({ text: delta })}\n\n`) },
{ model: req.body.model, temperature: req.body.temperature }
);
res.write(`data: ${JSON.stringify({ done: true, model, tokenCount })}\n\n`);
} catch (err) {
res.write(`data: ${JSON.stringify({error: err.message})}\n\n`);
} finally {