Projects

Token & prompt playground

Local-model experiments with token budgets, streaming and validated JSON output.

Next.jsOllamaPostgreSQLZod
Illustrated prompt and structured-output cover for the token playground.

A Next.js developer tool for composing prompts, inspecting token usage and comparing streaming and normal responses. Structured responses are checked with Zod, while PostgreSQL and Prisma retain runs, usage and errors for comparison.

What’s included

  • Prompt composition, token counting and history summarisation.
  • Streaming and normal response modes with cancellation handling.
  • Structured-output parsing and schema validation.
  • PostgreSQL-backed run history via Prisma.

Inside the repository

Output validationsrc/lib/structured.tsToken countingsrc/lib/tokenize.tsStreaming and run handlingsrc/lib/runs.ts