Write with AI
In Dashboard > Menu > New dish / Edit, Write the description with AI writes both descriptions from the dish names (and any notes already in the description fields, such as main ingredients). The owner reviews and edits the result before saving. Descriptions are one or two sentences, mention ingredients and cooking, and make no health or allergy claims.
Turning it on
Set an OpenAI-compatible API in .env and restart:
# OpenAI
AI_BASE_URL="https://api.openai.com/v1"
AI_API_KEY="sk-..."
AI_MODEL="gpt-4o-mini"
# or a model on your own computer with Ollama (free, no key)
AI_BASE_URL="http://localhost:11434/v1"
AI_MODEL="qwen2.5:7b"
Any service that offers POST {AI_BASE_URL}/chat/completions in the OpenAI format works (OpenRouter, Azure OpenAI, Groq, Together, a local vLLM, ...). Choose a model that writes good Arabic. Dashboard > Settings > Payments shows "AI is set up" when AI_BASE_URL is set.
Details
- Only the owner can use it, at most 20 requests per minute.
- The code is in
src/lib/ai.ts(the prompt and the call) andsrc/app/api/dashboard/ai/describe/route.ts(the endpoint). - The answer is requested as JSON
{"ar": "...", "en": "..."}; anything else is reported as an error and nothing is changed. - Customer data is never sent to the AI provider: only the dish names and the notes you typed.