Next.js app, image generation, transcription, object streaming, OpenAI, Stability AI, Ollama
Examples of using ModelFusion with Next.js 14 (App Router):
- image generation
- voice recording & transcription
- object streaming
- Create a
.env.localfile with the following content (depending on which demo you want to run)):
OPENAI_API_KEY="YOUR_OPENAI_API_KEY"
STABILITY_API_KEY="YOUR_STABILITY_API_KEY"- Run the following commands from the root directory of the modelfusion repo:
pnpm install
pnpm build
cd examples/nextjs
pnpm devCreate an 19th century painting image for your input.
You need to set up the STABILITY_API_KEY environment variable to run this demo.
Go to http://localhost:3000/generate-image in your browser.
Record audio with push-to-talk and transcribe it using Whisper, implemented as a Next.js app. The app shows a list of the transcriptions.
You need to set up the OPENAI_API_KEY environment variable to run this demo.
Go to http://localhost:3000/generate-transcription in your browser.
Generate travel itineraries using OpenAI
You need to set up the OPENAI_API_KEY environment variable to run this demo.
Go to http://localhost:3000/stream-object-openai in your browser.
Generate travel itineraries using Ollama
You need to install Ollama and download the openhermes model to run this demo.
Go to http://localhost:3000/stream-object-ollama in your browser.