AI-Powered Voice Food Assistant
Ask about any food. Scan any barcode. Get instant nutritional verdicts.
[Watch the Demo ]
๐๏ธ Voice Call Mode โ Tap the orb or mic to start a continuous voice conversation. Bite.ai listens, processes, speaks back, and auto-listens again โ like a real phone call.
๐ท Barcode Scanner โ Scan any product barcode using your phone camera (supports multiple cameras) or type it manually. Fetches real nutrition data from Open Food Facts.
๐ง Hybrid Analysis Engine โ Rule-based analyzer delivers instant, accurate verdicts. Ollama-hosted SLM provides natural language enhancement as a fallback.
๐ค Personalized Profiles โ Set your allergies (peanut, lactose, gluten, fish, soy), health conditions (diabetes, hypertension, cholesterol), and dietary preferences for tailored advice.
๐ฎ Interactive 3D Orb โ A living, breathing Three.js orb that changes color and animation based on state: idle โ listening โ processing โ speaking โ verdict (eat/avoid/sometimes).
๐ฑ Mobile-First Design โ Fully responsive, works on phone browsers over local WiFi. Camera, voice, and touch โ all native.
๐ฃ๏ธ Browser TTS/STT โ No external APIs needed. Uses the Web Speech API for speech recognition and synthesis, with automatic voice selection for natural output.
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ CLIENT (Browser) โ
โ Voice (STT) โโโถ Text Input โโโถ TTS (Speak) โ
โ Barcode Camera โโโถ Manual Entry โ
โ 3D Orb (Three.js) โโโถ State Visualization โ
โโโโโโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ HTTP POST /query
โผ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ GATEWAY (FastAPI) โ
โ Intent Classifier โโโถ Rules Layer + Router โ
โโโโโโโโฌโโโโโโโโโโโฌโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโ
โ โ โ
โผ โผ โผ
BARCODE FOOD QUERY CASUAL
(OFF API) (INDB 1014 (Templates)
foods)
โ โ
โโโโโโฌโโโโโโ
โผ
AGENT 1: Rule-Based Analyzer
(Instant nutritional verdicts)
โ
โผ
AGENT 2: Response Generator
(Templates primary + Ollama SLM fallback)
โ
โผ
Browser TTS
Agent
Role
Technology
Latency
Agent 1 โ Analysis
Nutritional verdict (eat/avoid/sometimes)
Rule-based engine + Ollama SLM
~5ms (rules) / ~1.2s (SLM)
Agent 2 โ Response
Natural language generation
Templates (primary) + Ollama SLM
~1ms (template) / ~1.3s (SLM)
bite.ai/
โโโ app/ # FastAPI backend
โ โโโ main.py # App entry point, routes, lifespan
โ โโโ models/ # Pydantic schemas
โ โโโ services/
โ โโโ intent.py # Intent classifier (Rules + Router)
โ โโโ resolver.py # Food resolver (INDB Excel โ fuzzy match)
โ โโโ analyzer.py # Agent 1: Hybrid rule-based + SLM analyzer
โ โโโ barcode.py # Open Food Facts API client
โ โโโ response.py # Template-based response formatter
โ โโโ response_agent.py # Agent 2: Template + Ollama SLM responses
โ
โโโ frontend/ # Browser-based UI
โ โโโ index.html # Single-page app
โ โโโ styles.css # Design system (warm aesthetic)
โ โโโ app.js # Voice agent, API calls, UI logic
โ โโโ orb.js # Three.js 3D orb with state animations
โ โโโ logo.png # App logo / favicon
โ
โโโ data/ # Datasets
โ โโโ INDB_data.xlsx # Indian Nutrient Database (1014 foods)
โ โโโ training_data.jsonl # Fine-tuning dataset
โ
โโโ docs/ # Architecture & design docs
โ โโโ 01_architecture.md
โ โโโ 02_intent_classification.md
โ โโโ 03_barcode_flow.md
โ โโโ 04_nonbarcode_flow.md
โ โโโ 05_unified_schema_and_agent.md
โ โโโ 06_dataset_design.md
โ โโโ 07_finetuning_and_inference.md
โ โโโ 08_conversation_and_optimization.md
โ โโโ 09_backend_and_failure_handling.md
โ
โโโ notebooks/ # Training notebooks
โ โโโ colab_train.py # Google Colab fine-tuning script
โ
โโโ scripts/ # Utility scripts
โ โโโ generate_dataset.py # Dataset augmentation
โ โโโ generate_dataset_fin.py # Final dataset generator
โ
โโโ configs/ # Configuration files
โโโ requirements.txt # Python dependencies
โโโ README.md # โ You are here
Python 3.11 โ Download
Ollama โ Download (for SLM inference)
Chrome/Edge โ Required for voice features (Web Speech API)
git clone https://github.com/your-username/bite-ai.git
cd bite-ai
# Create virtual environment
python -m venv venv
venv\S cripts\a ctivate # Windows
# source venv/bin/activate # Linux/macOS
# Install dependencies
pip install -r requirements.txt
# Install and start Ollama
ollama serve
# Pull the model (in a new terminal)
ollama pull qwen:1.8b
python -m uvicorn app.main:app --reload --host 0.0.0.0 --port 8000
http://localhost:8000/app/
5. Access from Phone (Same WiFi)
# Find your PC's IP
ipconfig # Windows โ look for IPv4 under Wi-Fi adapter
# On your phone browser:
http://YOUR_PC_IP:8000/app/
Tap the Voice button or click the orb to start a voice call
Ask naturally: "Is idli healthy?" , "Can I eat paneer?" , "What about dosa?"
Bite.ai speaks the answer and auto-listens for your next question
Tap again to end the call
Type any food query in the text box:
is biryani healthy
can diabetics eat rice
tell me about samosa
gulab jamun (just the food name works too)
Tap Barcode โ use camera or type the number
Supports multiple cameras (switch via dropdown)
Works with EAN-13, EAN-8, UPC-A, UPC-E, Code-128, Code-39
Tap the Profile icon (top right)
Set your name, allergies, health conditions, and diet type
All verdicts are personalized to your profile
Layer
Technology
Purpose
Backend
FastAPI + Uvicorn
API server, async request handling
Analysis
Rule-based engine
Instant nutritional verdicts (95% accuracy)
SLM
Ollama (qwen:1.8b)
Natural language fallback / enhancement
Food Data
INDB Excel (1014 foods)
Indian nutritional database with fuzzy matching
Barcode
Open Food Facts API
Global product database (2M+ products)
Frontend
Vanilla HTML/CSS/JS
No framework dependencies
3D Orb
Three.js
Interactive state visualization
Voice
Web Speech API
Browser-native STT + TTS
Fine-tuning
Oumi + QLoRA
Model training on Google Colab
๐ Supported Food Queries
Query Type
Examples
Coverage
Indian foods
idli, dosa, biryani, paneer, samosa, gulab jamun
1014 foods from INDB
Barcode products
KitKat, Coca-Cola, Maggi, any packaged product
2M+ via Open Food Facts
Natural language
"is X healthy?", "can I eat X?", "X for diabetics?"
Flexible pattern matching
Greetings
"hi", "hello", "thanks", "bye"
Template responses
๐งช Fine-Tuning (Optional)
The system works out-of-the-box with the rule-based engine. For custom SLM training:
Generate dataset : python scripts/generate_dataset_fin.py
Train on Colab : Upload notebooks/colab_train.py to Google Colab
Base model : Qwen2.5-0.5B-Instruct with QLoRA (4-bit)
Framework : Oumi for training orchestration
Export : GGUF quantization for Ollama deployment
See docs/07_finetuning_and_inference.md for the full training guide.
Document
Description
01 โ Architecture
System architecture, layer definitions, data flow
02 โ Intent Classification
Rules layer, keyword router, latency strategy
03 โ Barcode Flow
OFF API client, cache, follow-up queries
04 โ Non-Barcode Flow
Food resolver, fuzzy matching, INDB lookup
05 โ Unified Schema & Agent
Pydantic models, SLM prompt design, output parsing
06 โ Dataset Design
Training data structure, augmentation strategies
07 โ Fine-Tuning & Inference
QLoRA config, training script, inference pipeline
08 โ Conversation & Optimization
Session management, context handling
09 โ Backend & Error Handling
Failure modes, fallbacks, graceful degradation
Environment Variables (Optional)
Variable
Default
Description
OLLAMA_URL
http://localhost:11434
Ollama API endpoint
SLM_MODEL
qwen:1.8b
Ollama model for response generation
PORT
8000
Server port
HOST
0.0.0.0
Server bind address
Fork the repository
Create a feature branch (git checkout -b feature/amazing-feature)
Commit your changes (git commit -m 'Add amazing feature')
Push to the branch (git push origin feature/amazing-feature)
Open a Pull Request
This project is licensed under the MIT License โ see the LICENSE file for details.
Bite.ai โ Powered by Oumi
Built with โค๏ธ for healthier food choices