Examples
llm-ui provides example code to get you started.
Browse the code
Our example code is in the github repo.
Running the examples
llm-ui’s includes examples for Next.js.
Clone the llm-ui repo and navigate to the Next.js examples directory:
git clone https://github.com/llm-ui-kit/llm-ui.git
cd llm-ui/examples/nextjs
rm ../../package.json ../../pnpm-workspace.yaml
Install the dependencies using your package manager:
pnpm install
# or
npm install
# or
yarn install
# or
bun install
Then, run the development server:
pnpm dev
# or
npm run dev
# or
yarn dev
# or
bun dev
Open http://localhost:3000 in your browser.
Some examples require environment variables, see below for details.
Environment variables
Some examples require environment variables to run.
Create an empty file in: examples/nextjs/.env
Set the environment variables
You can see example environment variables in: examples/nextjs/.env.example
OpenAI
The OpenAI example requires you to set the OPENAI_API_KEY
environment variable in examples/nextjs/.env
.
You can generate/find your OpenAI key in their dashboard: https://platform.openai.com/api-keys