abboud@said:~$← back
$ cd projects/prompt-lab

AI Prompt Lab

A small dashboard for prompt experiments. You write a prompt, set how precise or creative the model should be, run it against Gemini, and keep a history of what you tried.

React 19ViteTailwind CSS v4Gemini APIuseReducer
AI Prompt Lab with a prompt typed in and the temperature slider set to 0.3

I built it to learn two things at once: how a language model behaves when the same prompt runs at different temperatures, and how to keep a screen with several states readable in React. The temperature slider runs from 0 to 1 in steps of 0.1 and is passed straight into the Gemini request, so you can run one prompt twice and compare.

The screen has four states: idle, loading, success and error. A single reducer owns all of them, along with the prompt text, the answer, the settings and the history, so a run is a short sequence of actions rather than several pieces of state updated by hand. The Gemini call lives in its own small module and the component only dispatches.

Every finished run is added to the top of a history list, which is written to localStorage and loaded again on startup, so it survives a refresh. There is no account and no backend.

It is a learning prototype, and it has limits I know about. The API key is a Vite environment variable, which means it is compiled into the browser bundle: anyone who deploys it with a real key exposes that key, and a real version would send the request through a server. The history list shows only the prompts, not the saved answers, and the error state is a single generic message.