import express from 'express' import { python } from 'pythonia' const { AutoModelForCausalLM } = await python('ctransformers') const llm = await AutoModelForCausalLM.from_pretrained$( 'TheBloke/WizardCoder-15B-1.0-GGML', { model_file: 'WizardCoder-15B-1.0.ggmlv3.q4_0.bin', model_type: 'starcoder' }) const app = express() const port = 7860 app.get('/', async (req, res) => { const prompt = 'My Favorite Cookie Recipe

' res.write(prompt) const raw = await llm(prompt) const output = raw.split('') res.write(output + '') res.end() }) app.listen(port, () => { console.log(`Open http://localhost:${port}`) })