Skip to content

narendra-cs/RestaurantMenuGenerator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🍽️ Restaurant Menu Generator

A Streamlit-based web application that generates creative restaurant names and menus based on different cuisines using AI. The application supports both OpenAI and Ollama LLM backends.

Features

  • 🎨 Generate creative restaurant names based on cuisine type
  • 📋 Create custom menus tailored to the restaurant's theme
  • 🌐 Supports multiple cuisines (Indian, Mexican, Italian, Chinese, Japanese, and more)
  • 🤖 Uses LangChain for LLM orchestration
  • 🔄 Fallback to local Ollama LLM when OpenAI API key is not available
  • 🎨 Clean and intuitive Streamlit UI

Screenshot

Restaurant Menu Generator

Prerequisites

  • Python 3.8+
  • Poetry (recommended) or pip
  • OpenAI API key (optional, falls back to Ollama if not provided)
  • Ollama installed and running (if using local LLM)

Project Structure

.
├── src/
│   ├── llm/               # LLM provider implementations
│   │   ├── openai.py     # OpenAI client
│   │   └── ollama.py     # Ollama client (local LLM)
│   ├── menu_generator.py  # Core menu generation logic
│   └── utils/            # Utility functions and enums
│       └── utils.py      # Environment loading and constants
├── main.py               # Streamlit application
├── .env.example          # Example environment variables
├── pyproject.toml        # Project dependencies (Poetry)
└── README.md             # This file

Installation

Using Poetry (Recommended)

  1. Clone the repository
  2. Install dependencies:
    poetry install
  3. Copy the example environment file:
    cp .env.example .env
  4. Update .env with your OpenAI API key (optional)

Using pip

  1. Clone the repository
  2. Create and activate a virtual environment
  3. Install dependencies:
    pip install -r requirements.txt
  4. Copy and configure .env as shown above

Usage

  1. Start the Streamlit app:

    # With Poetry
    poetry run streamlit run main.py
    
    # With pip
    streamlit run main.py
  2. Open your browser to http://localhost:8501

  3. Select a cuisine from the sidebar

  4. View the generated restaurant name and menu

Configuration

Environment Variables

Create a .env file with the following variables:

# Required for OpenAI
OPENAI_API_KEY=your_openai_api_key

# Optional LangChain settings
LANGCHAIN_API_KEY=your_langchain_api_key
LANGCHAIN_TRACING_V2=true
LANGCHAIN_PROJECT=restaurant-menu-generator

Ollama Setup (Fallback)

If you don't have an OpenAI API key, the app will fall back to using Ollama:

  1. Install Ollama: https://ollama.ai/
  2. Pull the desired model (e.g., llama3.2):
    ollama pull llama3.2

Development

Adding New Cuisines

To add a new cuisine, update the Cusine enum in src/utils/utils.py:

class Cusine(Enum):
    # ... existing cuisines ...
    NewCuisine = "New Cuisine Name"

Customizing Prompts

Edit the prompt templates in src/menu_generator.py to modify the generation behavior.

Contributing

Contributions are welcome! Please open an issue or submit a pull request.

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages