This project implements a multilingual chatbot with a responsive React.js front-end and a PyTorch-based backend. The backend leverages AWS Lambda for serverless deployment and a Vector Database for fast, efficient retrieval of contextual information, ensuring sub-300ms response times. The system is designed for high accuracy across multiple languages and supports cross-platform deployment for both web and Android.
frontend/: React.js application for the web-chat interface.notebooks/: Jupyter notebooks for each step in the pipeline.data/: Sample data and templates.transformer/: Scripts for the Transformer and LoRA implementations.minbpe/: A tokenizer from Andrej' Karpathy's repo, since it's not available as a package.output/vector_db/: Directory for the FAISS vector database and text chunks.
To get started, install required dependencies by running:
pip install -r requirements.txt
# Navigate to the frontend directory and install its dependencies
cd frontend
npm installTo build the Docker image for the AWS Lambda function, ensure Docker is installed and run:
docker build -t chat-replica-lambda .For local development of the frontend, navigate to the frontend directory and run:
npm run dev- Extracting data from WhatsApp.
- Tokenizing text using the BPE algorithm.
- Understanding Transformer models.
- Pre-training the model.
- Creating a fine-tuning dataset.
- Fine-tuning the model (Instruction tuning and LoRA fine-tuning).
- Implementing a React.js web-chat frontend with real-time interaction capabilities.
- Developing a scalable backend API using AWS Lambda for serverless deployment.
- Integrating a Vector Database for efficient context retrieval to enhance chatbot responses.
- Built a 42M-parameter custom LLM, Replica Lingo, trained on a curated, privacy-filtered, multilingual WhatsApp corpus to emulate natural conversational style, achieving 94% accuracy across 5 languages.
- Designed an end-to-end pipeline: data export → cleaning → normalization → parsing → tokenization → training → evaluation → packaging → deployment on AWS Lambda with API Gateway.
- Implemented a custom tokenizer/vocabulary optimized for Hindi–English code-mixing, emojis, and chat-specific artifacts.
- Engineered robust regex parsers for iOS/Android exports; handled Unicode normalization, invisible characters, timestamps, and system messages.
- Configured and tuned a lightweight transformer (layers, heads, context length), with efficient batching, mixed precision, gradient clipping, and checkpointing, ensuring optimal performance.
- Established train/val splits to prevent leakage; monitored loss/perplexity; ran ablations on data quality, sequence length, and batch size.
- Built reproducible training with config files, deterministic seeds, and clear logging; automated runs and artifact versioning.
- Delivered a compact, deployable model that preserves tone, context, and code-mixed fluency while maintaining strict privacy controls, integrated with a React.js frontend and an AWS Lambda/Vector DB backend for <300ms response times.
- Developed a responsive React.js frontend for seamless web-chat integration, featuring a dynamic message display, input area, and send functionality.
- Implemented a robust backend API on AWS Lambda, orchestrating the PyTorch-based LLM with a Vector Database for context-aware responses.
- Designed and integrated a Vector Database for efficient semantic search and retrieval of relevant information, significantly improving response quality and speed.