minor clean up

This commit is contained in:
Storme-bit
2026-04-27 20:17:05 -07:00
parent 055683424d
commit b58a4e4692
13 changed files with 171 additions and 18 deletions

View File

@@ -23,7 +23,7 @@ router.post('/complete', async (req, res) => {
// Streaming completion endpoint - sends partial responses as they arrive
router.post('/complete/stream', async (req, res) => {
const { prompt, model, temperature, topP, topK, repeatPenalty } = req.body;
const { prompt, model, temperature, maxTokens, topP, topK, repeatPenalty } = req.body;
if (!prompt) return res.status(400).json({ error: 'prompt is required' });
@@ -35,7 +35,7 @@ router.post('/complete/stream', async (req, res) => {
let lastModel = model;
let tokenCount = 0;
for await (const chunk of completeStream(prompt, { model, temperature, topP, topK, repeatPenalty })) {
for await (const chunk of completeStream(prompt, { model, temperature, maxTokens,topP, topK, repeatPenalty })) {
if (chunk.response) {
res.write(`data: ${JSON.stringify({ response: chunk.response })}\n\n`);
}