Skip to content

Instantly share code, notes, and snippets.

View tvalentius's full-sized avatar
🦇
Batman

Trimikha Valentius tvalentius

🦇
Batman
View GitHub Profile
@tvalentius
tvalentius / generate.js
Created September 10, 2024 09:48
Snippet from SecureLlama and BinaNutrisi project
export const dynamic = "force-dynamic";
export default async function handler(req, res) {
if (req.method === "POST") {
res.setHeader("Content-Type", "text/event-stream");
res.setHeader("Cache-Control", "no-cache");
const { prompt } = req.body;
const completion = await llama.chat.completions.create(