team-24

ADR-003: Use OpenAI API for dish recommendations

Date: 2026-06-15
Status: Accepted

Context

The core product feature is recommending a dish from a restaurant menu based on user preferences, allergies, and budget. The team evaluated three approaches:

  1. A rule-based filter that picks the highest-scoring dish by matching keywords
  2. A locally hosted LLM (LM Studio) for development, OpenAI for production
  3. OpenAI API directly, with a stub fallback for development and testing

A rule-based approach cannot generate natural-language reasons for recommendations, which is a key part of the user experience. A locally hosted LLM would require GPU infrastructure not available on Render’s free tier.

Decision

Use the OpenAI API (gpt-4o-mini or equivalent) as the production AI backend. Implement a configurable backend via the AI_BACKEND environment variable:

The OPENAI_API_KEY and OPENAI_BASE_URL are stored as Render environment variables and never committed to the repository.

Consequences

Positive:

Negative:

Quality requirements addressed