$ cat case-studies/ai-diet-planner.md

AI Diet Planner: A Local LLM Running Entirely On-Device

Role: Android EngineerTimeline: Sep – Oct 2024Platform: Android (Kotlin)Constraint: Zero cloud dependency for AI

The Challenge

Most AI-powered health apps send every user query — meals, weight, health goals — to a cloud API. That creates three problems this project set out to eliminate:

  • Privacy: Diet and health data is sensitive; users shouldn't have to ship it to a third-party server
  • Connectivity: The assistant should work on a plane, in a gym basement, or anywhere offline
  • Cost: No per-request inference bill — the model runs on hardware the user already owns

The goal: personalized diet planning with a real-time chat assistant, where the language model runs entirely on the phone.

My Role & Approach

  • Integrated a local Large Language Model into the Android app for diet-planning conversations with real-time, on-device chat assist
  • Used TensorFlow Lite for on-device inference, tuned for mobile memory and compute budgets
  • Designed the app privacy-first: user profile, goals, and chat history never leave the device
  • Built the personalized planning flow — profile inputs drive prompt construction so responses reflect each user's goals and constraints

Technical Implementation

On-Device Inference

  • TensorFlow Lite runtime hosting the quantized model for mobile-class hardware
  • Careful memory management around model load/unload to keep the rest of the app responsive
  • Streaming-style chat UX so responses render progressively as tokens are produced

Why On-Device Matters

Edge inference is a different engineering discipline from calling a cloud API: model size, quantization, thermal and battery behavior, and cold-start latency all become app-level concerns. This project is a working demonstration of shipping that whole pipeline inside a production Android app.

Outcome

A working Android app where the full AI experience — personalized diet plans and a chat assistant — runs with no network connection and no data leaving the phone. A demo build is available on request.

Technologies Used

Kotlin TensorFlow Lite Local LLM Edge ML On-Device AI Android

Want AI features that respect privacy and work offline?

Let's talk