AI Recipe Assistant: From Photo to Meal

TRUETECH is engaged in the development, support and maintenance of iOS, Android, PWA mobile applications. We have extensive experience and expertise in publishing mobile applications in popular markets like Google Play, App Store, Amazon, AppGallery and others.

Development and support of all types of mobile applications:

Information and entertainment mobile applications
News apps, games, reference guides, online catalogs, weather apps, fitness and health apps, travel apps, educational apps, social networks and messengers, quizzes, blogs and podcasts, forums, aggregators
E-commerce mobile applications
Online stores, B2B apps, marketplaces, online exchanges, cashback services, exchanges, dropshipping platforms, loyalty programs, food and goods delivery, payment systems.
Business process management mobile applications
CRM systems, ERP systems, project management, sales team tools, financial management, production management, logistics and delivery management, HR management, data monitoring systems
Electronic services mobile applications
Classified ads platforms, online schools, online cinemas, electronic service platforms, cashback platforms, video hosting, thematic portals, online booking and scheduling platforms, online trading platforms

These are just some of the types of mobile applications we work with, and each of them may have its own specific features and functionality, tailored to the specific needs and goals of the client.

Showing 1 of 1All 1734 services
AI Recipe Assistant: From Photo to Meal
Complex
~1-2 weeks
Frequently Asked Questions

Our competencies:

Development stages

Latest works

  • image_mobile-applications_feedme_467_0.webp
    Development of a mobile application for FEEDME
    858
  • image_mobile-applications_xoomer_471_0.webp
    Development of a mobile application for XOOMER
    745
  • image_mobile-applications_rhl_428_0.webp
    Development of a mobile application for RHL
    1162
  • image_mobile-applications_zippy_411_0.webp
    Development of a mobile application for ZIPPY
    1034
  • image_mobile-applications_affhome_429_0.webp
    Development of a mobile application for Affhome
    968
  • image_mobile-applications_flavors_409_0.webp
    Development of a mobile application for the FLAVORS company
    563

"What to cook from what's in the fridge" — a classic problem with limited inventory. An AI assistant isn't just a recipe search engine; it's a recipe generator for a specific set of ingredients, dietary restrictions, and cooking time. We handle the end-to-end implementation of such an assistant: from design to app store publication.

In practice: a user opens the app, takes a photo of their fridge shelf, and receives three meal options considering time and diet. Time from photo to recipe: under 5 seconds. We've implemented such solutions for dozens of clients, reducing recipe search time by an average of 40%.

Problems the AI Assistant Solves

Don't know what to cook from leftovers?

Ingredients are running out, and ideas are scarce. The AI assistant scans fridge contents (text, voice, or photo) and generates a recipe using only available ingredients. Basic staples (salt, oil, water) are added automatically.

Allergies and diets: How to avoid mistakes?

A wrong dish choice can cost health. We implement a flexible filter system: users specify allergies (nuts, gluten, lactose) and diet (vegan, keto, paleo), and the prompt guarantees exclusion of forbidden ingredients. The model returns JSON with a full ingredient list for verification.

Cooking time: How to meet a 30-minute deadline?

Busy professionals value quick recipes. The assistant respects a maximum cooking time and selects dishes that can actually be prepared within that period. Every step is timed, and a timer is built into the recipe card.

How We Do It: Stack and Approach

Ingredient Recognition

Three input channels, all needed. Text is obvious. Voice via SFSpeechRecognizer on iOS or SpeechRecognizer on Android. The most useful: a photo of fridge contents with ingredient recognition.

For recognition, we use on-device models: CoreML on iOS and ML Kit on Android. This is faster and more private than cloud solutions. For example, CoreML with a model fine-tuned on Food-101 processes an image in 200-300 ms, 3× faster than Cloud Vision API (excluding network latency).

// iOS - ingredient recognition via Vision + CoreML
func recognizeIngredients(in image: UIImage) async throws -> [String] {
    guard let cgImage = image.cgImage else { return [] }

    let model = try FoodClassifier(configuration: .init())
    let vnModel = try VNCoreMLModel(for: model.model)

    let request = VNCoreMLRequest(model: vnModel)
    request.imageCropAndScaleOption = .centerCrop

    let handler = VNImageRequestHandler(cgImage: cgImage)
    try handler.perform([request])

    guard let results = request.results as? [VNClassificationObservation] else { return [] }

    return results
        .filter { $0.confidence > 0.6 }
        .prefix(10)
        .map { $0.identifier }
}

On Android, we use ML Kit ImageLabeler with a local model (RemoteModel downloaded on first launch). The choice between on-device and cloud is a speed-accuracy trade-off. We recommend on-device for basic items and cloud for rare ingredients.

Comparison of approaches:

Parameter On-device (CoreML/ML Kit) Cloud (Vision API)
Speed 200-300 ms 500-1500 ms + network
Privacy Data stays on device Data sent to server
Accuracy ~85% for basic items ~95% for rare ingredients
Cost Free Pay per request
Technical details of recognition integration For iOS, we use Vision + CoreML with a FoodClassifier model (fine-tuned on Food-101). Privacy is ensured by on-device processing. For Android, ML Kit ImageLabeling with a local model.

Recipe Generation with Constraints

The prompt is key. We build it dynamically, adding restrictions from the user profile. response_format: json_object is mandatory — parsing markdown-wrapped JSON in production is not viable.

struct RecipeRequest: Encodable {
    let ingredients: [String]
    let servings: Int
    let maxCookingMinutes: Int
    let dietaryRestrictions: [String]  // "vegan", "gluten-free", "nut-allergy", ...
    let difficulty: String             // "easy", "medium", "hard"
    let cuisinePreferences: [String]   // optional
}

func buildRecipePrompt(_ req: RecipeRequest) -> String {
    """
    Create a recipe using ONLY these ingredients (you may add basic pantry staples: salt, oil, water, common spices):
    Available: \(req.ingredients.joined(separator: ", "))

    Requirements:
    - Servings: \(req.servings)
    - Max cooking time: \(req.maxCookingMinutes) minutes
    - Dietary: \(req.dietaryRestrictions.isEmpty ? "none" : req.dietaryRestrictions.joined(separator: ", "))
    - Difficulty: \(req.difficulty)

    Return JSON: {name, cookingTime, servings, ingredients: [{name, amount, unit}], steps: [{number, instruction, duration}], nutrition: {calories, protein, carbs, fat}}
    """
}

Recipe Card in UI

// Android Compose
@Composable
fun RecipeCard(recipe: Recipe) {
    LazyColumn(
        modifier = Modifier.fillMaxSize(),
        contentPadding = PaddingValues(16.dp),
        verticalArrangement = Arrangement.spacedBy(12.dp)
    ) {
        item {
            Text(recipe.name, style = MaterialTheme.typography.headlineSmall)
            Row(horizontalArrangement = Arrangement.spacedBy(16.dp)) {
                InfoChip(Icons.Default.Timer, "${recipe.cookingTime} min")
                InfoChip(Icons.Default.People, "${recipe.servings} servings")
                InfoChip(Icons.Default.LocalFireDepartment, "${recipe.nutrition.calories} kcal")
            }
        }

        item { Text("Ingredients", style = MaterialTheme.typography.titleMedium) }
        items(recipe.ingredients) { ing ->
            Text("• ${ing.amount} ${ing.unit} ${ing.name}")
        }

        item { Text("Steps", style = MaterialTheme.typography.titleMedium) }
        itemsIndexed(recipe.steps) { index, step ->
            StepCard(number = index + 1, instruction = step.instruction, duration = step.duration)
        }
    }
}

Timer for Cooking Steps

Each timed step starts a timer directly from the card. We use Timer and UNUserNotificationCenter for notifications, even when the app is in background.

class StepTimerManager: ObservableObject {
    @Published var activeTimers = [Int: TimeInterval]()
    private var timers = [Int: Timer]()

    func startTimer(for stepIndex: Int, duration: TimeInterval) {
        activeTimers[stepIndex] = duration

        timers[stepIndex] = Timer.scheduledTimer(withTimeInterval: 1.0, repeats: true) { [weak self] _ in
            guard let self else { return }
            if let remaining = self.activeTimers[stepIndex], remaining > 0 {
                self.activeTimers[stepIndex] = remaining - 1
            } else {
                self.timers[stepIndex]?.invalidate()
                self.notifyStepComplete(stepIndex)
            }
        }
    }

    private func notifyStepComplete(_ step: Int) {
        let content = UNMutableNotificationContent()
        content.title = "Step \(step + 1) done"
        content.sound = .default
        UNUserNotificationCenter.current().add(
            UNNotificationRequest(identifier: "step-\(step)", content: content, trigger: nil)
        )
    }
}

Why Use JSON response_format?

Without it, the model returns markdown-wrapped code. Parsing such output reliably is nearly impossible — the model may change formatting. By specifying response_format: json_object, we guarantee clean JSON that can be decoded via Codable or Gson. This speeds up development and reduces bugs.

How Recipe Personalization Works

Each saved and cooked recipe is added to the preference profile. On the next request, we include the list of liked dishes in the prompt, increasing relevance without fine-tuning. Recipe storage: SwiftData (recent iOS) or Core Data with JSON-serialized recipe structure in an attribute. On Android: Room with TypeConverter for List<Ingredient> and List<Step>.

What's Included in the Work

Stage What We Do Duration
Analysis Define UX, use cases, constraints 1–2 days
Design UI kits for iOS and Android, adapt to Material You / HIG 3–5 days
AI Development Integration of recognition, generation, prompt engineering 5–10 days
Frontend SwiftUI / Compose screens, timers, animations 5–7 days
Backend GraphQL / REST API, profile storage, analytics 4–6 days
Testing Unit + UI tests, API load testing 3–5 days
Deployment App Store / Google Play publication, CI/CD setup 2–3 days
Support Documentation, training, 1-month warranty 5 days

Timeline Estimates

Basic assistant (text input + recipe generation): from 3 days. Full implementation with photo recognition, step timers, preference profile, and offline storage: from 4 weeks. Cost is calculated individually after project assessment.

Our team has 5+ years of mobile development experience and over 30 successful projects. We guarantee compliance with App Store and Google Play requirements. Every project undergoes code review and load testing.

Contact us to discuss your project and get a personalized estimate.

Machine Learning in Mobile Apps: CoreML, TFLite, and On-Device Models

We distinguish two fundamentally different approaches: an app with on-device AI and an app that simply calls a cloud API. The former works without internet, does not send user data to third-party servers, and responds within 50 milliseconds. The latter depends on network latency and pricing plans. Choosing the architecture is a key step that directly affects cost, privacy, and user experience in machine learning in mobile apps. Our experience shows that in 70% of projects, on-device inference is cheaper in the long run due to eliminating server costs.

How to Choose Between CoreML and TFLite for On-Device Inference?

CoreML — Apple's native framework for running ML models on device. Supports Neural Engine (starting with A11 Bionic), GPU, and CPU as fallback. Models are converted to .mlmodel format via coremltools from PyTorch, ONNX, or TensorFlow. Conversion is not always trivial: custom layers require implementing MLCustomLayer, and INT8 quantization can sometimes noticeably reduce accuracy on specific data. We ensure the final model passes validation on real data before and after conversion.

TensorFlow Lite — cross-platform alternative for Android and Flutter. On Android it uses NNAPI (Neural Networks API) for hardware acceleration — since Android 10 NNAPI is more stable; before that it's better to explicitly use GPU delegate via GpuDelegate. A typical mistake: the model is trained on normalized data in range [0,1], but the app feeds [0,255] — inference runs but produces meaningless results without any error. We include an automatic input data validation module in the SDK.

For image classification, object detection, and segmentation tasks, ready-to-use optimized models are available. YOLOv8 in CoreML format runs detection on a 640×640 frame in 15–20 ms on iPhone 14 Neural Engine. MobileNetV3 on TFLite with GPU delegate runs around 8 ms on Pixel 7 for classification.

Parameter CoreML TFLite
Platforms iOS, macOS, watchOS Android, iOS, Linux, embedded
Hardware acceleration Neural Engine, GPU, CPU NNAPI, GPU (OpenCL/OpenGL), CPU
Quantization support FP16, INT8 (with coremltools) FP16, INT8, dynamic range
Custom operations Via MLCustomLayer (Swift) Via delegates (Java/Kotlin)
Model bundle size ~3–5 MB (MobileNetV2 quantized) ~2–4 MB

What If You Need Text Generation On-Device?

Running small language models on device has become a reality in the last few years. Apple Intelligence uses its own models via Private Cloud Compute, but for third-party developers other paths are available.

llama.cpp with Metal backend on iOS is a working approach for phi-3-mini (3.8B parameters, 4-bit quantization, ~2.3 GB). Inference: 15–25 tokens/second on iPhone 15 Pro. For integration in Swift, use the Swift Package llama.swift or a wrapper via C interface llama.h. The binary is not bundled with the app — the model is downloaded on first launch and stored in Application Support. Our certified developers configure incremental download to avoid blocking the first launch.

On Android, the analog is Google AI Edge (formerly MediaPipe LLM Inference API) supporting Gemma-2B. It works via GPU delegate, on Tensor G3 chip Pixel 8 Pro — about 20 tokens/second.

Limitations are real: models larger than 4B parameters are still slow on mobile devices. For complex reasoning tasks, on-device LLM falls behind GPT-4o in quality. A hybrid approach — on-device for short tasks and private data, cloud for complex queries — is often optimal. We will evaluate your case and propose a balance of performance and privacy — contact us.

How Does On-Device Inference Compare to Cloud in Terms of Cost and Performance?

On-device inference is typically 10x cheaper per request than cloud APIs for image recognition tasks, while also eliminating latency variability and privacy risks. The table below summarizes the trade-offs.

Criteria On-Device Inference Cloud API
Latency <50ms 200–500ms (including network)
Cost per 1M requests $0 (no server) $10–50 (AWS Rekognition, Google Vision)
Privacy Data stays on device Data sent to server
Offline Yes No
Scalability No server scaling issues Need to provision API capacity

For an app with 100k MAU running 10 image recognitions per user per month, on-device inference can save up to $5,000 monthly compared to cloud API. Get a free consultation on your ML architecture today.

Integrating OpenAI API and Other Cloud Models

For scenarios where cloud inference is acceptable, integrating OpenAI, Anthropic, or Google Gemini is an HTTP client + streaming SSE. In Swift, AsyncThrowingStream is convenient for streaming responses. In Kotlin, use Flow.

Critically: API keys must never be stored in the app bundle. Even an obfuscated key can be extracted from the IPA in 10 minutes using strings or frida. Correct architecture: mobile app → your own backend → OpenAI API. The backend controls rate limiting, logs requests, and protects the key.

What Is Included in the Work (Deliverables)

  • Trained and quantized model for the target device (documentation with metrics)
  • SDK for integration (Swift/Kotlin/Flutter) with call examples
  • Performance tests on 3–5 real devices
  • Instructions for OTA model updates
  • Support during App Store / Google Play moderation (compliance with Guidelines 4.2, 5.1)
  • 2 weeks of technical support after release

Typical Project Pipeline

  1. Task analysis — measure latency, privacy, size, supported devices.
  2. Model prototyping — in Python, evaluate accuracy on target data.
  3. Conversion and quantization — for CoreML/TFLite with validation.
  4. Integration into the app — model wrapped in a service layer (easy to swap CoreML ↔ TFLite ↔ cloud).
  5. Testing — on real devices, measure FPS, RAM, battery.
  6. Deployment — via TestFlight / Firebase App Distribution, monitor metrics.

Timelines: integration of a ready CoreML/TFLite model — 1–2 weeks, development of a custom model with mobile optimization — from 6 weeks, on-device LLM chat with personalization — 4–8 weeks.

Why We Take on Complex Cases?

10+ years of experience in mobile development, 50+ implemented AI/ML solutions, guarantee of compatibility with current iOS and Android versions. All projects undergo code review and load testing. The cost includes preparation of moderation documentation and training of your team.

Contact us — we will help you choose the architecture and implement ML in your app turnkey. Order an audit of your existing solution — we will assess the potential for server cost savings free of charge. In some projects, savings can reach significant amounts per month.