Prompt Lab
🧪 Playground 3 min read

AI Modes: Local vs. Connected

What changes when you connect an OpenAI API key, and how the local fallback keeps things working without one.

Prompt Lab works in two modes — a rule-based local mode that needs no API key, and a live AI mode that connects to OpenAI for richer feedback.

Local mode (default)

When no API key is configured, the coach uses built-in rules to:

  • Score prompts by checking for length, specificity, format indicators, audience/role words, and safety
  • Suggest improvements based on common patterns
  • Generate practice questions from a local question bank

Local mode is fast, private (nothing leaves your server), and works offline. The feedback is helpful — just less nuanced than AI-generated responses.

Connected mode (OpenAI)

When an OpenAI API key is added, the coach uses GPT-4o mini (by default) to:

  • Give context-aware, lesson-specific feedback
  • Generate unique practice questions tailored to your prompt
  • Explain wrong quiz answers with analogies and follow-up questions
  • Score prompts against AI-understanding of quality (not just pattern matching)
  • Generate quiz questions from uploaded PDFs and Word docs
The status pill in the top-right of the Playground shows which mode you're in: ✅ AI connected or ⚠️ Local mode.

Adding an API key

  1. Go to Admin → Admin dashboard.
  2. Paste your OpenAI API key into the API key for this session field.
  3. Click Save key.
  4. The key is stored in your session only — it's never written to disk.

For a shared deployment (classroom server), set the OPENAI_API_KEY environment variable instead — all users will benefit automatically.

Choosing the model

The default model is gpt-4o-mini — fast and cost-effective. Override it with the OPENAI_MODEL environment variable (e.g. gpt-4o for higher quality at higher cost).

Was this article helpful?
📚 All articles Start learning →