AI Engineering, JavaScript Solutions, Competitive programming in JavaScript, MCQ in JS

Thursday, April 30, 2026

Day 6.3 - AI Engineering— Building My First LLM Playground

Day 6.3 — Building My First LLM Playground

AI Engineering — Day by Day
My journey to becoming an AI Engineer




After setting up my first local LLM, the next logical step was clear:

Stop just running prompts… and start building a system around it.

So today, I built my first LLM Playground using a local model.


🧠 What I Wanted to Build

Not just a UI — but something that helps me understand behavior.

So I defined a simple goal:

  • Enter a prompt
  • Control temperature
  • Generate multiple outputs
  • Observe differences

This is where things started becoming real.


🏗️ System Architecture

Instead of calling the model directly from the frontend, I designed a proper flow:

Frontend (Next.js UI)
        ↓
API Route (/api/generate)
        ↓
Local LLM (Ollama)

This small decision is important.

Because:

  • It keeps the system modular
  • It matches production architecture
  • It allows future extensions (RAG, agents)

🧩 Core Features I Built

  • Prompt Input → Textarea for user input
  • Temperature Slider → Control randomness
  • Generate Button → Trigger API
  • Multiple Outputs → Same prompt, 3 responses

The “multiple outputs” feature turned out to be the most important.


🧪 The Experiments I Ran

Prompt:

Explain AI in 2 lines

Then I experimented with different temperatures:

  • Temperature = 0
  • Temperature = 0.7
  • Temperature = 1

😮 What I Observed

This is where things became interesting.

1. Same Prompt, Different Outputs

Even with the same prompt, I got different responses.

Earlier, I knew this conceptually.

But seeing it live changed my understanding:

LLMs are not deterministic systems.

2. Temperature Changes Behavior Significantly

  • Low temperature (0) → Stable, predictable
  • Medium (0.7) → Balanced
  • High (1) → Creative, sometimes messy

This made one thing very clear:

Sampling is not a setting — it’s a behavior control mechanism.

3. Local Model Differences Are Visible

Compared to API-based models:

  • Responses were less polished
  • Slight inconsistencies appeared
  • Prompt sensitivity was higher

And honestly, that helped me understand things better.


🧠 What I Learned

This wasn’t just a UI exercise.

It helped me connect multiple concepts:

  • Token prediction → visible in outputs
  • Sampling → visible through temperature
  • Non-determinism → visible through multiple runs

This is where theory became real.


🔄 What I Would Improve Next

This is just the beginning.

Next, I want to add:

  • Top-p and max token controls
  • Streaming responses
  • Output evaluation (scoring system)

🚀 What’s Next

Now that I have a working playground, the next step is:

Making it smarter.

In the next phase, I’ll start exploring:

  • Evaluation integration
  • Better prompt testing workflows

💭 Final Thought

Before today, I understood LLMs conceptually.

After today:

I can see their behavior in action.

And that feels like a real step toward becoming an AI engineer.

This is Day 6.3 of my journey — and this is where things started to feel real.

No comments:

Post a Comment