On-Device Multimodal Inference Architecture Brief
Design an on-device multimodal inference pipeline for Android leveraging LiteRT, NPU acceleration, and memory-safe processing.
Use this template when planning edge deployment of multimodal vision-language models or generative image pipelines directly on Android hardware. It guides the technical evaluation of quantization, NPU acceleration, and system memory limits.
Role: Principal Android ML Systems Engineer specializing in edge generative AI and LiteRT hardware acceleration.
Context
- Target Application: {{app_name}}
- Supported Hardware Profiles: {{target_soc_tiers}}
- Quantization Strategy: {{quantization_scheme}}
- Strict Peak Memory Cap: {{memory_footprint_ceiling_mb}}
- Input Streams: {{multimodal_input_modalities}}
- Target Processing Time: {{inference_latency_sla_ms}}
Task
Produce an exhaustive technical architecture brief outlining the on-device execution strategy for multimodal models in {{app_name}}, guaranteeing adherence to runtime latency, thermal limits, and hardware-accelerated memory boundaries.
Method
- Analyze the interaction between {{multimodal_input_modalities}} and map incoming buffers to zero-copy memory abstractions.
- Evaluate delegate routing across CPU, GPU, and NPU for {{target_soc_tiers}} to eliminate kernel fallback penalties.
- Model runtime memory allocations under {{quantization_scheme}} against {{memory_footprint_ceiling_mb}} including KV cache and staging buffers.
- Define tensor preprocessing pipelines in native C++ using NDK to conform to {{inference_latency_sla_ms}}.
- Design graceful fallback mechanisms for non-compliant hardware running outside {{target_soc_tiers}}.
- Establish thread affinity and background priority classes to prevent main-thread UI jank during generation bursts.
- Detail thermal management triggers that downscale model precision when SoC skin temperature climbs.
- Construct a telemetry plan for capturing frame drop rates, delegate initialization failures, and out-of-memory crashes.
Constraints
- MUST maintain total memory allocation below {{memory_footprint_ceiling_mb}} across all operating scenarios.
- MUST NOT perform image normalization or tensor transformation on the JVM/Kotlin UI thread.
- All delegate bindings must fail fast to a predetermined fallback pipeline without crashing the host process.
- Quantization artifacts must be profiled specifically for {{quantization_scheme}} across heterogeneous SoCs.
- Target cold-start delegate initialization must be quantified within the latency model.
Output format
- Executive Summary (1 paragraph)
- Hardware Acceleration & Delegate Mapping Matrix (table)
- Memory Allocation Budget Breakdown (tabular breakdown with peak totals)
- Preprocessing & Buffer Flow Architecture (step-by-step pipeline)
- Thermal Throttling & Degraded State Policy (bulleted criteria)
- Implementation Milestones & Risk Mitigations (3-5 items)
Self-review
- Verify every memory calculation directly reflects {{memory_footprint_ceiling_mb}}.
- Confirm that delegate fallbacks are provided for every listed tier in {{target_soc_tiers}}.
- Ensure pipeline latency stays within {{inference_latency_sla_ms}} without UI thread blocking.
Explicit role, a named task, and discrete steps the model can follow.
Background, inputs and variables the model needs before it starts.
Hard boundaries — what the model must and must not do.
A named, field-level shape for the response.
Ordered work items that force analysis before an answer.
Length and structure that travel across frontier models.
Signal density — instruction weight without padding.
Documented variables so the scaffold adapts to new inputs.
Quality bar, assumptions and behaviour when inputs are thin.
How much real usage the template has behind it.