A Practical Guide and Acceptance Checklist for Five Multimodal LLM Workflow Tasks

    This article walks through five common multimodal workflows—screenshot-to-code, structured extraction from mixed-format images, academic PDF analysis, long-image article writing, and long-video summarization—with ready-to-use prompt templates, validation schemas, fallback logic, and acceptance criteria, plus guidance on migration, cost estimation, and rollback between local and cloud-based models.

    1. Background and Migration Criteria

    Cloud providers may adjust their free tiers—for example, by tightening free access to high-end models or reducing daily call limits on entry-level models. Always check each platform’s official announcements for current rules. Scheduled jobs, batch scripts, and data-cleaning pipelines that depend on these quotas can break mid-flow when calls start failing, and the downstream impact is often larger than expected.

    There are two ways out: migrate to self-hosted local models, or switch to a reasonably priced cloud API. The selection criteria are the same for both routes:

    • Complete multimodal coverage: handles images, long documents, and video, not just single-image recognition.
    • Sufficient context length: multi-hundred-page PDFs and hour-long meeting recordings are common.
    • Affordable pricing: at high call volumes, small per-call cost differences compound quickly.
    • Structured output: reliably emits JSON, HTML, or Markdown that downstream programs can parse.

    When migrating, also compare rollback costs between the two routes. The table below lists the items to check.

    Check item Local deployment Cloud API
    Modality coverage Depends on the chosen model’s weights; test each modality Follows the platform’s documentation, but still verify with samples
    Context length Limited by GPU memory and the inference framework Capped by the platform’s stated limit; verify real performance with samples
    Per-call cost Hardware depreciation and electricity; fixed costs dominate at low volumes Pay-as-you-go; costs grow with call volume
    Rollback complexity Requires maintaining services, model files, and versions Usually just switching endpoints and model names

    This article does not recommend any specific product. Validate all templates with your own models and samples before production use.

    2. Task 1: Frontend Replication—From Screenshot to Code

    2.1 Definition and Scope

    Frontend replication means giving the model a UI screenshot and having it generate the corresponding HTML, CSS, and JavaScript. It tests both visual understanding and code generation.

    • Good fit: quickly building static prototypes; converting design mockups into previewable pages.
    • Poor fit: production pages requiring strict pixel-perfect alignment, or systems built on internal component libraries.
    • Prerequisites: screenshot width of at least 1280 pixels, legible key text, and the target tech stack stated in the prompt. The template below uses plain HTML. If you target Vue 3, specify the version, build tool, and component library in the prompt, request single-file components as output, and verify build dependencies separately.

    2.2 The Three-Round Feeding Method

    Asking the model to “fully replicate” the screenshot in one shot usually fails. A more reliable approach is three rounds.

    Input conventions: the screenshot is PNG or JPG; the asset manifest is a JSON array where each item has a title (card title) and a path (image path).

    Round 1: static layout. Example prompt:

    1. Generate a single-file HTML page from the attached screenshot (inline CSS, no external frameworks).
    2. Requirements:
    3. 1. Identify the layout structure from the screenshot—top navigation, sidebar, card grid—and represent each with semantic tags;
    4. 2. Define colors using CSS variables and list the primary and background colors you estimate from the screenshot;
    5. 3. Use gray placeholder blocks for image areas with alt text; do not draw graphics;
    6. 4. Output a single code block with no explanations.

    Round 2: asset overlay. Build on the Round 1 result, e.g.: “For each card title, match an image from the asset manifest and output the img src; write the matching rationale in code comments.” This tests whether the model can combine visual understanding with retrieval and matching.

    Round 3: interaction logic. Send the detail-page screenshot together with the Round 1 code and request incremental changes: “Keep the existing DOM structure; only add a detail overlay on card click, a comment section, and a video progress bar. Output a change summary listing the modified selectors.” If the model rewrites everything from scratch, it failed to preserve the existing structure.

    2.3 Acceptance Criteria

    Dimension Pass standard Failure signal
    DOM structure Semantic tags; block count matches the screenshot Masses of meaningless nested divs; missing or extra blocks
    Spacing and corners Key spacing within 4 pixels of the screenshot Misaligned elements, visibly inconsistent spacing
    Colors Each color channel within 16 of the screenshot’s sampled values Obvious color deviation
    Image handling Gray placeholder blocks with alt text Blurry drawn graphics
    Accessibility Heading hierarchy with no skipped levels; no img alt issues in Lighthouse Missing alt text; broken heading hierarchy
    Incremental changes Only the specified selectors modified Full rewrite with loss of existing styles

    The thresholds above are starting points—teams can adjust them for design precision, but they must be fixed before acceptance testing. During review, open the page in a browser and compare it side-by-side with the screenshot, measuring spacing with developer tools rather than judging from the code alone.

    3. Task 2: Structured Information Extraction

    3.1 Where the Difficulty Lies

    Handwritten forms, stamped invoices, and handwritten résumés often appear in the same image, and each must be output in a different format. This tests both spatial grounding and structured output.

    Traditional OCR typically outputs text with coordinate boxes, so it excels at locating text. Its weakness is semantic: it struggles to determine which field a piece of text belongs to, or to check constraints between fields—such as whether the invoice total equals the sum of line items. Large models are strong on semantic relationships but more prone to hallucination, so a validation step is required.

    3.2 Prompt and Output Contract

    Packing multiple format requirements into one prompt tests instruction-following ability.

    1. Process the attached image and output the following, separating the three parts with ---:
    2. 1. Table: output as an HTML <table>, preserving merged cells (rowspan, colspan);
    3. 2. Stamp: recognize the stamp text and split it into unit_name (organization name), person_name, and tax_id (taxpayer ID),
    4. output as a JSON object; fill unrecognized fields with null;
    5. 3. Handwritten text: output as Markdown, preserving the original paragraph order, marking unreadable characters with [?].
    6. If a category is absent from the image, write "none" for that part.

    The tax_id field below follows the 18-character unified social credit code format defined in the Chinese standard GB 32100. The JSON Schema makes programmatic validation easy:

    1. {
    2. "type": "object",
    3. "properties": {
    4. "unit_name": {"type": ["string", "null"]},
    5. "person_name": {"type": ["string", "null"]},
    6. "tax_id": {"type": ["string", "null"], "pattern": "^[0-9A-HJ-NPQRTUWXY]{2}[0-9]{6}[0-9A-HJ-NPQRTUWXY]{10}$"}
    7. },
    8. "required": ["unit_name", "person_name", "tax_id"]
    9. }

    The regex only checks length and character set; it does not validate the check digit. Before going live, add check-digit validation using the standard algorithm. If your business also handles 15- or 20-character taxpayer IDs, you must build separate rules—do not reuse this one. The example is illustrative only; validate with your own samples before formal use.

    3.3 Fallback Handling and Integration

    When parsing model output, handle three failure modes:

    Failure type Signal Action
    JSON parse failure Parser throws an exception Send the error message back to the model for a retry, up to 2 times; then route to manual review
    Missing fields A required field is absent Record the missing field as null; send the record to the review queue
    Format mismatch tax_id fails the pattern or check-digit validation Record as null and send to review; do not auto-correct

    Integration pseudocode:

    1. def extract(image_id, image, max_retry=2):
    2. messages = build_messages(image)
    3. for attempt in range(max_retry + 1):
    4. raw = call_model(messages)
    5. try:
    6. data = json.loads(extract_json_block(raw))
    7. except ValueError as e:
    8. if attempt == max_retry:
    9. log_event(image_id, "json_parse_failed")
    10. return send_to_review(image_id, reason="json_parse")
    11. messages.append(error_feedback(str(e)))
    12. continue
    13. errors = validate_schema(data)
    14. if errors:
    15. log_event(image_id, "schema_invalid", fields=errors)
    16. return send_to_review(image_id, reason=errors)
    17. return save_result(image_id, data)

    Invoices and résumés contain personal information. Keep the following in mind during integration:

    • Logs should record only image IDs, error types, and field names—never field values or raw model output.
    • Restrict the review queue to personnel who need it, and keep access audit records.
    • Keep a switch for the legacy workflow when the new one launches. If the new workflow fails at scale, fall back to the old script or manual entry.

    4. Task 3: Academic Document Analysis

    4.1 Definition and Scope

    Academic document analysis takes a long PDF as input and produces a section index, key claims, and the corresponding page numbers with verbatim excerpts. It suits literature reviews, standards retrieval, and technical report reading. It does not replace expert judgment, and it must not be used to directly produce legal or medical conclusions.

    Prerequisites: the PDF must contain extractable text; scanned documents need OCR first. If the document exceeds the model’s context length, split it by page ranges, process each segment, then merge.

    4.2 Segmented Prompt

    1. You will receive pages {start_page}-{end_page} of an academic document.
    2. Output JSON based only on this segment; do not add information from outside it:
    3. - section_title: the section name for this segment; null if undeterminable;
    4. - key_claims: an array where each item has claim (the claim, may be precisely paraphrased), page (page number), and evidence (verbatim excerpt of the supporting sentence);
    5. - terms: an array where each item has term and definition_in_text (definition found in the text; null if none);
    6. - unclear: an array listing questions that cannot be resolved from this segment.
    7. If a field has no content in this segment, use an empty array or null—do not fabricate.

    When merging segment-level results, deduplicate claims by their text first. If two segments reach contradictory conclusions about the same claim, keep both and flag them for manual review.

    4.3 Acceptance Criteria

    Dimension Pass standard Failure signal
    Page numbers Every claim’s page number matches the source Missing or incorrect page numbers
    Verbatim excerpts Evidence can be located word-for-word in the original text Rewritten or nonexistent excerpts
    Term definitions definition_in_text comes only from the document Definitions that do not appear in the text
    Conflict handling Cross-segment contradictions are flagged Contradictions silently merged

    During spot checks, randomly sample 10% of the claims and verify each page number and excerpt one by one.

    5. Task 4: Long-Image Article Writing

    5.1 Definition and Scope

    Long-image article writing produces a fully structured article from the material in one or more tall composite screenshots. It suits turning product infographics, event posters, or screenshot collections into publishable drafts.

    • Poor fit: supplementing facts not present in the material, or publishing without human review.
    • Prerequisites: number the tall images top-to-bottom and give each sub-image a title. Text in the images must be legible.

    5.2 Prompt Template

    1. The attached image is a tall composite, numbered top-to-bottom as Image 1 through Image {N}, with each sub-image titled.
    2. Based on the image content, write an article for {audience} with these requirements:
    3. 1. Output Markdown; the title must not exceed {title_char_limit} characters;
    4. 2. Every number, person name, and product name must be traceable to the image, with a source tag at the end of each paragraph, e.g. (Source: Image 2);
    5. 3. Do not add information absent from the image; where clarification is needed, write "not provided in the image";
    6. 4. The body must be at least {min_word_count} words.

    5.3 Acceptance Criteria

    Dimension Pass standard Failure signal
    Factual consistency Sampled numbers and names can all be found in the original images Data that appears in no source image
    Source tagging Source numbers exist and match the content Out-of-range numbers or mismatched citations
    Length Body meets the minimum; title within the limit Clearly under- or over-length output

    When the model misses small text, it tends to fabricate content. In that case, first fix the image legibility, then regenerate.

    6. Task 5: Long Video Understanding

    6.1 Definition and Scope

    Long video understanding means generating timestamped meeting minutes from recordings tens of minutes long, listing decisions and action items. Some models cannot take video input directly, so the common approach is to extract keyframes and transcribe the audio first, then feed both to the model.

    Prerequisites: the recording needs a usable speech-to-text transcript with timestamps. If the full recording exceeds the context window, split it into fixed-duration segments—for example, 5 minutes each.

    6.2 Segmented Prompt

    1. Below are keyframe descriptions and the speech transcript for the meeting recording from {start_time} to {end_time}.
    2. Output a JSON array where each item contains:
    3. - start, end: timestamps in hh:mm:ss format, must fall within this segment;
    4. - speaker: the speaker; "unknown" if undeterminable;
    5. - action_item: a decision or action item from this segment; null if none;
    6. - owner, due: the action item's owner and deadline; null if not mentioned;
    7. - evidence: a verbatim quote from the transcript.
    8. Do not output timestamps outside this segment.

    6.3 Acceptance Criteria

    Dimension Pass standard Failure signal
    Timestamps All fall within their segment’s range Out-of-range timestamps
    Action item details Owners and deadlines match the transcript Fabricated names or dates
    Spot checks Randomly sampled segments pass manual verification Spot-check error rate clearly elevated

    Out-of-range timestamps should be filtered automatically by the program, with one retry for the segment. Segments that still fail after retry go to manual review.

    7. Migration Compatibility, Cost, and Rollback

    7.1 Compatibility

    Run the same sample set through both the old and new models and compare: JSON parse rate, required-field completeness, and whether image and video inputs are accepted correctly. Set your own pass thresholds for completeness and parse rates, and document them before migration.

    7.2 Cost Estimation

    Estimate monthly cost as:

    Monthly cost = average daily calls × 30 × cost per call

    Compute per-call cost separately for input and output billing units. Images and video are usually billed by frame count or duration, so measure actual consumption with samples first before plugging into the formula. For local deployment, amortize hardware depreciation and electricity into per-call cost before comparing against a cloud API.

    7.3 Rollback Strategy

    • Switch models via endpoint and model name in configuration; never hardcode model info into code.
    • Keep the old path alive for at least one release cycle after migration; decommission only after confirming correctness.
    • Give batch jobs idempotency keys so they can resume from checkpoints after interruption without writing duplicate results.
    • Never overwrite raw data. Write new results to new fields or new tables for easy comparison and rollback.
    • Rehearse the rollback process at least once, confirming switch-over time and the responsible owner.

    8. Final Acceptance Checklist

    • All five task templates have been run successfully on the target model.
    • The sample set includes normal, boundary, and failure samples, with counts recorded per category.
    • Thresholds are defined for JSON parse rate, field completeness, timestamp validity, and similar metrics.
    • Manual spot-check records are saved and traceable.
    • Logs contain no personal information or raw model output.
    • Review-queue access is restricted to necessary personnel.
    • Cost estimation is complete, with budget alerts configured.
    • The rollback process has been rehearsed, with switch-over time and owners confirmed.
    • Prompt and schema versions are recorded, with a change note for every modification.