Client-Side Multimodal Prompt Orchestrator Specification Brief
Specify an Android client-side token management and prompt orchestration layer for multimodal cloud and edge endpoints.
Use this template when building an Android client SDK or subsystem that compresses, prioritizes, and structures multimodal context (images, sensor data, text) before sending to multimodal APIs.
Role: Android SDK Architect and Multimodal Interaction Engineer specializing in context orchestration and network-aware prompt pipelines.
Context
- Target Model Endpoint: {{multimodal_model_endpoint}}
- Vision Token Compression Scheme: {{vision_token_compression_ratio}}
- Client Context Cache Policy: {{client_cache_policy}}
- Bandwidth Cap: {{network_bandwidth_budget_kbps}}
- Core User Interaction: {{user_interaction_flow}}
- Offline/Degraded Fallback: {{fallback_strategy}}
Task
Draft a technical specification brief for an Android prompt orchestration engine that processes UI context, live image crops, and metadata into token-optimized payloads for {{multimodal_model_endpoint}} within {{network_bandwidth_budget_kbps}} constraints.
Method
- Deconstruct {{user_interaction_flow}} into distinct client events requiring multimodal prompt construction.
- Design the on-device visual preprocessing module to downsample and patch image inputs according to {{vision_token_compression_ratio}}.
- Establish structured payload serialization using Protobuf/JSON schemas optimized for low serialization overhead.
- Define token budget allocation algorithms across image patches, system instructions, and dynamic chat history.
- Implement {{client_cache_policy}} using Room and encrypted local storage to avoid redundant image transmission.
- Architect network-resilient request dispatching with adaptive compression tailored to {{network_bandwidth_budget_kbps}}.
- Detail the state machine governing transitions to {{fallback_strategy}} during connectivity loss or rate limits.
- Define client-side privacy filters preventing PII or sensitive visual regions from embedding into outgoing prompts.
Constraints
- MUST enforce strict payload sizing below {{network_bandwidth_budget_kbps}} on metered networks.
- MUST NOT store unencrypted multimodal payloads or raw prompt history in client-accessible storage.
- Serialization and token assembly must execute off the main thread via Kotlin Coroutines with Dispatchers.Default.
- Cache invalidation under {{client_cache_policy}} must preserve determinism across user sessions.
Output format
- Orchestrator Architectural Overview (component diagram and responsibilities)
- Token Budgeting & Image Patching Engine Spec (mathematical formulation and algorithm)
- Client Cache & Eviction Protocol (state lifecycle)
- Network Adaptation & Payload Optimization Rules (tiered payload sizing)
- Offline Fallback & Graceful Degradation Model (failure state logic)
Self-review
- Ensure image compression aligns with {{vision_token_compression_ratio}} limits.
- Verify network serialization does not violate {{network_bandwidth_budget_kbps}} on mobile connections.
- Confirm clear execution pathways for {{fallback_strategy}} during service outages.
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.