Please create or update the file at pages/api/generate-slides.js with the following code: js Copy Edit import { InferenceClient } from "huggingface_hub"; export default async function handler(req, res) { const client = new InferenceClient({ provider: "hyperbolic", apiKey: process.env.HF_TOKEN, }); const text = req.body.text; try { const completion = await client.chat.completions.create({ model: "deepseek-ai/DeepSeek-V2.5", messages: [ { role: "system", content: "You convert text into slides with titles and bullets." }, { role: "user", content: text }, ], }); const slides = completion.choices[0].message.content; res.status(200).json({ slides }); } catch (error) { console.error("Hugging Face API error:", error); res.status(500).json({ error: "Failed to generate slides from text" }); } } Also ensure the .env.local file contains the Hugging Face token as HF_TOKEN=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, and that this file is NOT exposed publicly. This endpoint will receive the extracted text from uploaded files and return AI-generated slides - Initial Deployment