DEV Community

Tanaike for Google Developer Experts

Posted on

Auditing Documents & Images with Gemini Decisions API

Check any PDF, draft, or image against 1,000 criteria at once—with zero output tokens

Zero-Output Multimodal Auditing (ZOMA) with Gemini Decisions API and Python CLI

Introduction

In my previous article, "Zero-Output-Token AI in Google Apps Script with Gemini Decisions API" Ref (source repository Ref), I demonstrated how Google DeepMind's Gemini Decisions API (POST https://generativelanguage.googleapis.com/v1beta/decisions, powered by gemini-decision-1) Ref fits Google Workspace automation—covering Gmail inbox labeling, model cascade routing, and a Google Sheets PDF compliance audit. Among those examples, the PDF compliance audit drew an especially strong response, and I received inquiries about it from readers across many different fields.

The origin of that idea was actually very personal: before turning it into a Google Sheets demo, I had been using the Decisions API in my own daily writing workflow to check my own research papers, technical articles, manuscripts, and drafts against a self-defined set of review criteria all at once, surfacing issues instantaneously. When developers first encounter a classification endpoint like the Decisions API, the natural mental model is "Many-Inputs × Few-Labels"—classifying a stream of emails or support tickets into three to five categories. Flipping that geometry to "1-Input × up to 1,000-Criteria"—sending one rich multimodal artifact (a PDF, research paper, article manuscript, or ad creative) once and evaluating it against up to 1,000 independent questions in a single forward pass—turned out to be a usage pattern that most users had never envisioned.

Because of that response, I decided to write this dedicated follow-up article focused exclusively on this technique, which I refer to as Zero-Output Multimodal Auditing (ZOMA). Because gemini-decision-1 evaluates all questions against the shared input simultaneously without autoregressive text decoding Ref, ZOMA produces strictly zero output tokens ($0.00 output cost, with input tokens billed once at $0.10 per 1M input tokens) Ref while returning calibrated probabilities (0.01 to 0.99), discrete choices, and ordinal rubric scores (0–4). Moving beyond Google Apps Script into a universal, dependency-light Python 3 CLI published at gemini-decisions-api-python Ref, this article presents a reusable ZOMA auditing and weighted-scoring architecture and validates it across five live multimodal use cases (83 total criteria across Markdown, PDF, and PNG inputs). While I designed the core scenario and evaluation criteria for each of the five use cases myself, the sample input documents used to demonstrate and reproduce each run were generated with Gemini via samples/generate_samples.py Ref so that anyone can reproduce every benchmark without proprietary files; every latency, token count, probability, score, and cost figure reported in this article comes directly from live API runs, and you can immediately swap in your own local files and custom checklists.


In Plain English: What Is ZOMA?

Imagine handing a 20-page vendor contract, a research manuscript draft, an advertising banner, a student essay, or a grant proposal to a meticulous reviewer along with a structured checklist—and receiving every checkbox verdict, every 0–4 quality rating, and a clear flag on any ambiguous clause that needs human judgment back in under one second, for a fraction of a cent. That is Zero-Output Multimodal Auditing (ZOMA). Instead of asking an AI chatbot to write long prose explanations one question at a time, ZOMA sends your document once, evaluates dozens or hundreds of independent checklist rules simultaneously, and lets deterministic Python code handle all final math and pass/fail decisions.

Key Terms in Plain English

  • Single Forward Pass & Zero Output Tokens: Standard AI chatbots generate answers one word (token) at a time, which adds latency and output billing. A single forward pass reads your document once and returns structured numeric answers directly, generating zero written text and zero output-token cost.
  • Calibrated Probability (0.01–0.99): A reliability-tuned percentage expressed from 0.01 (1% likely "Yes") to 0.99 (99% likely "Yes"). When the model is genuinely unsure (for example, 0.72), the score sits in the middle instead of pretending to be 99% certain.
  • Question Types (noul, choice, score): The three structured question formats supported by the Decisions API—noul for Yes/No checks, choice for picking one label from a fixed list, and score for rating quality on an ordered rubric such as 0 to 4.
  • OCR-Free Multimodal Input: Sending PDFs and images (like PNG banners) directly to the AI model as-is, without running a separate Optical Character Recognition (OCR) or PDF-to-text converter first.
  • CLI, JSON/YAML & Dry-Run: A Command-Line Interface (CLI) is a lightweight terminal program; JSON and YAML are plain-text formats used to write your checklist rules; and --dry-run checks your files and rules locally before making any paid API call.
  • Knock-Out Gate: A mandatory eligibility requirement (such as a maximum grant budget cap) where failing that single rule disqualifies a submission immediately, regardless of how high its overall quality score is.

1. Why Gemini Decisions API Excels at ZOMA & Architecture

Low latency and low cost are the most immediately visible advantages of gemini-decision-1, yet its deeper architectural strengths are what make Zero-Output Multimodal Auditing (ZOMA) production-grade across legal, editorial, visual, and academic domains Ref:

  • Sub-Second Single Forward-Pass Latency: Because the model evaluates all questions in a single prefill forward pass (reading the document once without generating text word-by-word) without autoregressive token-by-token decoding, end-to-end latency remains flat and sub-second (497.4–856.4 ms live measured across 14–20 criteria) instead of scaling linearly with output length.
  • Ultra-Low Cost with Strictly Zero Output Tokens: Shared document input tokens are billed once at $0.10 per 1M input tokens Ref, while output and thinking tokens remain strictly 0 ($0.00 output cost), cutting input volume by over 92% compared to sequential per-criterion calls.
  • Mathematically Calibrated Probabilities & Native Confidence Gating: Unlike generative LLMs whose self-reported verbal confidence is often poorly calibrated, gemini-decision-1 returns statistically calibrated probabilities (0.01–0.99) and confidence scores, enabling reliable automated NEEDS_REVIEW escalation thresholds (such as 0.85).
  • Zero JSON Parse Failures & Closed-Set Schema Guarantees: Because no free-form text is decoded into JSON strings, malformed JSON, hallucinated enum values, and schema drift are structurally impossible across noul, choice (2–255 options), and score (2–255 ordered rubric tiers) primitives Ref.
  • High-Density Parallel Batching (Up to 1,000 Independent Questions): A single request evaluates up to 1,000 independent criteria against the exact same shared context without cross-question prompt contamination or attention degradation from massive compound instructions.
  • 262,144-Token Unified Multimodal Context (OCR-Free): A single shared input accepts up to 262,144 tokens (256K) across mixed modalities—text, JSON, PDFs, images, audio, and video Ref—allowing native inspection of multi-page PDFs and high-resolution ad creatives without external OCR or PDF-to-text pipelines.
  • High Reproducibility for Programmatic Control Flow: Without autoregressive sampling drift or variable thinking-token traces, probability outputs remain highly repeatable across runs, making gemini-decision-1 a dependable upstream signal provider for deterministic downstream software logic.

Separation of Concerns

A common problem in LLM-based evaluation pipelines is asking a single generative model to read a document, judge 20 criteria, apply custom business weights, check hard eligibility rules, and sum the final score in one autoregressive JSON response. When AI judgment and arithmetic are mixed together, models exhibit silent summation drift, inconsistent threshold enforcement, and brittle JSON formatting errors.

To prevent these problems by design, our Python CLI enforces a strict two-layer separation of concerns, illustrated in Figure 1.

Figure 1: Paradigm Shift & Decoupled Two-Layer Architecture
Figure 1: Shifting from sequential autoregressive LLM loops to 1-Input × up to 1,000-Criteria evaluation with strict separation between gemini-decision-1 inference (client.py) and deterministic Python aggregation (evaluator.py).

As shown in Figure 1, the pipeline divides responsibility across three focused modules:

  • Stateless Multimodal Transport (cli/client.py) Ref: Reads a local .md, .txt, .pdf, .png, .jpg, .jpeg, or .webp file once, Base64-encodes binary documents and images natively without OCR middleware (packaging PDFs and images directly for the API without separate text-extraction tools), authenticates strictly via the x-goog-api-key HTTP header, automatically chunks checklists exceeding 1,000 questions into compliant batches, applies bounded exponential backoff on HTTP 429/5xx, and normalizes proto-JSON response fields into typed Python dictionaries.
  • Zero-Output-Token Semantic Inference (gemini-decision-1): Evaluates every criterion independently against the shared input in one forward pass, returning calibrated noul probabilities (0.01–0.99), choice probability distributions, or score expected values and ordinal bucket distributions—with 0 output tokens generated.
  • Deterministic Evaluation Engine (cli/evaluator.py) Ref: Operates completely offline with zero network I/O. It applies exact threshold rules, risk-flag inversions (expected: "no"), hard knock-out gates, weighted linear scaling, negative penalty deductions, and borderline/low-confidence escalation in pure Python—verified offline by the Stage-3 boundary stress test suite (an automated offline check that verifies the math handles edge cases like zero scores or borderline ties) cli/test_evaluator_stress.py Ref.

This decoupling guarantees that LLM arithmetic hallucination is structurally impossible: the AI model only produces calibrated per-criterion signals, while Python owns every threshold comparison, weighted sum, and pass/fail verdict. Table 1 compares the two deterministic operating modes built into evaluator.py alongside a traditional autoregressive LLM loop.

Table 1: Architectural Comparison of Evaluation Modes
Table 1: Comparison of Naive Autoregressive LLM Loops vs. Gemini Decisions API Mode A (audit) and Mode B (weighted_scoring) across token scaling, output tokens, arithmetic determinism, and human-in-the-loop gating.

Table 1 highlights why a single checklist schema can drive two distinct enterprise patterns:

  • Mode A (audit): Designed for binary compliance, pre-flight linting, and risk scanning. Each noul criterion specifies expected: "yes" (required safeguard) or expected: "no" (prohibited risk flag). Any signal whose confidence falls below confidence_threshold (default 0.85, i.e., 0.15 < P < 0.85) is routed automatically to NEEDS_REVIEW rather than guessed. For choice criteria, explicit fail_choices or review_choices trigger FAIL or NEEDS_REVIEW; for score criteria, expected scores are gated against pass_min and fail_max.
  • Mode B (weighted_scoring): Designed for rubric grading, grant screening, and procurement scoring. Criteria can be marked as knockout: true (hard eligibility gates where a FAIL immediately disqualifies the submission regardless of points, and low confidence forces NEEDS_REVIEW), positive-weight noul or score dimensions (where an ordinal 0–4 score contributes (score / max_scale) * weight points), or negative-weight noul penalty flags. If the final total falls within ±borderline_margin of cutoff_score, or if too many items exhibit low confidence (max_low_conf_for_auto), the engine escalates the overall verdict to NEEDS_REVIEW.

Mode A & Mode B End-to-End Workflows

Before diving into CLI commands and live numbers, Figure 2 and Figure 3 map the five end-to-end workflows we evaluated across both operating modes.

Figure 2: Mode A Multimodal Audit Workflows (UC1–UC3)
Figure 2: End-to-end Mode A (audit) pipelines for UC1 (Markdown Manuscript Linter), UC2 (Multi-Page Vendor Contract PDF Risk Scanner), and UC3 (High-Resolution Ad Creative PNG QA), each executed in a single API batch.

Figure 3: Mode B Weighted Rubric & Knock-Out Screening Workflows (UC4–UC5)
Figure 3: Mode B (weighted_scoring) execution pipelines for UC4 (Cybersecurity Essay Rubric Grading) and UC5 (R&D Grant Proposal Knock-Out + Weighted Screening), where Python deterministically computes final totals and cutoff gates.


2. Quickstart & Reusable Python CLI Usage

All scripts, sample inputs, checklists, and saved live results are published in tanaikech/gemini-decisions-api-python Ref. The CLI requires only Python 3, requests, and PyYAML (requirements.txt Ref). Clone the repository, install dependencies, and export your Gemini API key once (the client sends the key solely in the x-goog-api-key header and never embeds it in URLs):

Not a programmer? Here is what the commands below actually do in 3 steps:

  • Step 1 — One-Time Setup: Download the free tool folder, install its two lightweight Python helper libraries, and store your Gemini API key securely in your terminal session.
  • Step 2 — Define or Pick Your Checklist: Choose one of the ready-made checklist files (or edit your own plain-text JSON/YAML rules) describing what to check, score, or flag.
  • Step 3 — Audit Any Document: Point the tool at any local Markdown draft, PDF, or PNG image and get a structured pass/fail or weighted score report in under a second.
git clone https://github.com/tanaikech/gemini-decisions-api-python.git
cd gemini-decisions-api-python
pip install -r requirements.txt
export GEMINI_API_KEY="your-api-key-here"
Enter fullscreen mode Exit fullscreen mode

Every audit or scoring workflow is defined declaratively in a single JSON or YAML checklist file. Below is a compact excerpt from a Mode B (weighted_scoring) checklist showing how a hard knock-out gate, a weighted binary criterion, and a weighted ordinal score rubric coexist in the same schema:

{
  "name": "UC5: R&D Grant Proposal Knock-Out + Weighted Screening",
  "mode": "weighted_scoring",
  "confidence_threshold": 0.85,
  "cutoff_score": 70.0,
  "borderline_margin": 3.0,
  "max_low_conf_for_auto": 2,
  "criteria": [
    {
      "id": "ko_budget_cap",
      "category": "Knock-Out Eligibility",
      "label": "[KO] Budget <= $250,000",
      "type": "noul",
      "knockout": true,
      "expected": "yes",
      "instructions": "Is the total requested grant funding less than or equal to the $250,000 program cap?"
    },
    {
      "id": "has_itemized_budget",
      "category": "Completeness",
      "label": "Itemized Budget Breakdown (+5)",
      "type": "noul",
      "expected": "yes",
      "weight": 5.0,
      "instructions": "Does the proposal include an itemized budget breakdown whose line items clearly reconcile to the requested total?"
    },
    {
      "id": "technical_merit_score",
      "category": "Merit Rubric",
      "label": "Technical Merit & Architecture (0-4, max 20)",
      "type": "score",
      "weight": 20.0,
      "max_scale": 4,
      "instructions": "Rate the technical soundness, hardware/software feasibility, and engineering clarity of the proposed sensor network.",
      "criteria": [
        "0: Technically infeasible or undefined",
        "1: High-level concept lacking engineering specifics",
        "2: Plausible design with missing power, telemetry, or calibration details",
        "3: Solid, practical engineering design with concrete BOM, power, and filtering specs",
        "4: Exceptional, field-ready architecture with rigorous calibration and open hardware specs"
      ]
    }
  ]
}
Enter fullscreen mode Exit fullscreen mode

Before spending any API calls, you can run the offline zero-data stress test (cli/test_evaluator_stress.py Ref) and validate any input file and checklist schema locally with --dry-run:

python3 cli/test_evaluator_stress.py
python3 cli/decisions_audit.py \
  --input samples/uc1_manuscript_draft.md \
  --checklist samples/uc1_checklist.json \
  --dry-run
Enter fullscreen mode Exit fullscreen mode

Running all five live use cases uses the exact same CLI entry point (cli/decisions_audit.py Ref), switching only --input, --checklist, and optional flags (--resolution high for images, --format table|markdown|json, or --confidence-threshold):

# UC1: Manuscript / Technical Document Semantic Linter (Markdown, Mode A)
python3 cli/decisions_audit.py \
  --input samples/uc1_manuscript_draft.md \
  --checklist samples/uc1_checklist.json \
  --output results/uc1_result.json

# UC2: Vendor SaaS Contract & SLA Risk Scanner (Multi-page PDF, Mode A)
python3 cli/decisions_audit.py \
  --input samples/uc2_vendor_contract.pdf \
  --checklist samples/uc2_checklist.json \
  --output results/uc2_result.json

# UC3: Ad Creative OCR-Free Multimodal QA (High-res PNG, Mode A)
python3 cli/decisions_audit.py \
  --input samples/uc3_ad_creative.png \
  --checklist samples/uc3_checklist.json \
  --resolution high \
  --output results/uc3_result.json

# UC4: Student / Training Essay Weighted Rubric Grading (PDF, Mode B)
python3 cli/decisions_audit.py \
  --input samples/uc4_student_essay.pdf \
  --checklist samples/uc4_checklist.json \
  --output results/uc4_result.json

# UC5: R&D Grant Proposal Knock-Out + Weighted Screening (PDF, Mode B)
python3 cli/decisions_audit.py \
  --input samples/uc5_grant_proposal.pdf \
  --checklist samples/uc5_checklist.json \
  --output results/uc5_result.json
Enter fullscreen mode Exit fullscreen mode

To adapt the CLI to your own documents, swap --input for any local Markdown, plain text, PDF, or image file, and edit a JSON/YAML checklist with your organization's rules. Adding --format markdown outputs a ready-to-paste report for GitHub pull requests, Notion pages, or CI/CD job summaries, while --format json emits clean machine-readable JSON so autonomous AI agents—such as Google Antigravity, Claude Code, Gemini CLI, or OpenAI Codex—can invoke cli/decisions_audit.py directly from their terminal tool (or wrap it as an agent skill) to self-audit drafts, reports, and visual assets in under a second.


3. Mode A Live Walkthrough & Empirical Results

Mode A (audit) targets high-precision defect detection across text, multi-page PDFs, and raw visual creatives. Following the three single-batch pipelines mapped in Figure 2, we examine each Mode A use case individually alongside its dedicated live test results infographic (Figure 4, Figure 5, and Figure 6).

How to read the live numbers in Sections 3 and 4:

  • Required checks (expected: "yes"): We want the document to contain this element, so a high probability (p >= 0.85) means PASS, while a very low probability (p <= 0.15) means FAIL (missing requirement).
  • Risk & defect flags (expected: "no"): We want this problem to be absent, so a low probability (p <= 0.15) means PASS (safe), while a high probability (p >= 0.85) means FAIL (risk or violation detected).
  • Human-review zone (0.15 < P < 0.85): Whenever the model's confidence is below 0.85, the tool refuses to guess and routes that criterion to NEEDS_REVIEW for a human reviewer.
  • Rubric scores (0–4, e.g., 3.17 / 4): Rather than forcing a blunt whole number, the model returns a probability distribution across levels 0 through 4 and computes the weighted average (expected score) for fine-grained grading.

Use Case 1: Manuscript & Technical Document Semantic Linter (uc1_manuscript_draft.md)

What this test checks in plain English: Before submitting a technical paper or article draft, can ZOMA catch hidden confidentiality leaks, missing citations, and vague claims alongside structural quality checks in half a second?

In Use Case 1, a 5,034-byte Markdown systems engineering preprint draft (samples/uc1_manuscript_draft.md Ref, "Adaptive Cache-Coherence Prefetching for Multi-Region Edge Workers") was audited against 18 criteria (16 noul + 2 score) defined in samples/uc1_checklist.json Ref in a single batch (saved output: results/uc1_result.json Ref). The live call completed in 497.37 ms (0 retries) using 2,562 input tokens and 0 output tokens (estimated cost $0.000256), saving 17 sequential API calls. The overall verdict was FAIL (13 PASS, 3 FAIL, 2 NEEDS_REVIEW), as detailed in Figure 4.

Figure 4: UC1 Manuscript Semantic Linter — Live Test Results
Figure 4: Live gemini-decision-1 audit results for UC1 (uc1_manuscript_draft.md, 18 criteria, 497.4 ms, 2,562 input tokens, 0 output tokens, $0.000256), highlighting all three planted blockers caught, 13 passed checks, and 2 calibrated human-review escalations.

As visualized in Figure 4, the live run separated structural strengths, planted blockers, and subjective gray zones cleanly in under half a second:

  • 13 Required & Security Checks Passed with High Confidence: Core publication sections passed decisively (p = 0.934–0.982), including has_code_snippet (p = 0.982), has_limitations (p = 0.980), has_ethics_privacy (p = 0.978), has_quantitative_table (p = 0.977), has_abstract (p = 0.974), has_code_or_seed (p = 0.973), has_references (p = 0.966), has_reproducible_env (p = 0.964), has_baselines (p = 0.961), and consistent_numbers (p = 0.934). The security risk flag contains_hardcoded_secrets (expected: "no") also passed cleanly (p = 0.023, confidence 0.977).
  • All 3 Planted Blockers Caught (FAIL): The draft intentionally included an internal project codename and NDA customer identifier (Project Nighthawk / NorthStar Financial Corp, NDA-2026-041), an unresolved [citation needed] marker, and an unquantified "nearly zero tail latency overhead" claim. gemini-decision-1 flagged all three risk criteria (expected: "no") above the 0.85 threshold: leak_confidential_nda (p = 0.990), unbounded_vague_claim (p = 0.909), and unresolved_citation_todo (p = 0.887).
  • 2 Calibrated NEEDS_REVIEW Escalations: Two nuanced qualitative criteria fell inside the 0.15 < P < 0.85 uncertainty band and were safely routed to a human editor instead of forced into a binary verdict: has_problem_statement (p = 0.716) and uses_professional_tone (p = 0.798).
  • Continuous Quality Rubric Scores: Both 0–4 ordinal scores cleared the pass_min = 2.50 bar—writing_clarity_score achieved 3.17 / 4 (P(3) = 0.469, P(4) = 0.369) while logical_rigor_score scored 2.58 / 4 (P(3) = 0.446, P(2) = 0.338), accurately reflecting strong technical structure tempered by the unverified performance claim.

UC1 Summary (Input → Findings): Feeding a 5 KB Markdown preprint draft and an 18-item pre-publication checklist into a single 497 ms pass immediately confirmed 13 required sections and security checks, caught all 3 planted blockers (an NDA client leak, an unresolved [citation needed], and an unquantified performance claim), and routed 2 nuanced tone/problem-statement items to a human editor instead of guessing.

Use Case 2: Vendor SaaS Contract & SLA Risk Scanner (uc2_vendor_contract.pdf)

What this test checks in plain English: When procurement receives a multi-page software vendor contract PDF, can ZOMA verify security guarantees while flagging unfair liability caps, auto-renewal traps, and borderline clauses in under a second?

In Use Case 2, a 53,951-byte multi-page vendor SaaS contract PDF (samples/uc2_vendor_contract.pdf Ref) was ingested natively as a document block—without any PDF-to-text extraction library—and evaluated against 20 criteria (17 noul + 2 choice + 1 score) in samples/uc2_checklist.json Ref (saved output: results/uc2_result.json Ref) in 856.42 ms (0 retries) using 3,809 input tokens (2,769 text + 1,040 image tokens) and 0 output tokens (estimated cost $0.000381), saving 19 sequential API calls. The overall verdict was FAIL (9 PASS, 10 FAIL, 1 NEEDS_REVIEW), shown in Figure 5.

Figure 5: UC2 Vendor Contract & SLA Risk Scanner — Live Test Results
Figure 5: Live gemini-decision-1 audit results for UC2 (uc2_vendor_contract.pdf, 20 criteria, 856.4 ms, 3,809 input tokens, 0 output tokens, $0.000381), contrasting 9 verified security safeguards against 10 commercial/legal FAIL verdicts and 1 borderline review clause.

Figure 5 demonstrates why multi-axis legal screening benefits from combining noul, choice, and score questions in a single forward pass:

  • 9 Security & Governance Safeguards Verified (PASS): Every baseline security control present in the contract passed with high certainty (p = 0.959–0.977): no_ai_training_on_data (p = 0.977), soc2_or_iso27001 (p = 0.972), cyber_insurance_5m (p = 0.969), termination_for_cause (p = 0.969), customer_owns_data (p = 0.968), subprocessor_notice (p = 0.968), breach_notice_72h (p = 0.961), governing_law_specified (p = 0.961), and encryption_at_rest_transit (p = 0.959).
  • 10 Commercial, SLA & Legal Red Flags Caught (FAIL): Three required protections were absent—sla_meets_99_9 (p = 0.022), termination_for_convenience (p = 0.027), and hipaa_baa_included (p = 0.041). Simultaneously, all four prohibited risk clauses (expected: "no") triggered decisively: risk_renewal_price_hike >5% (p = 0.978), risk_uncapped_customer_indemnity (p = 0.973), risk_auto_renewal_long_notice >60 days (p = 0.967), and risk_low_vendor_liability_cap <12 months of fees (p = 0.961). Both choice questions selected fail classes with over 96% confidence—liability_posture = heavily_vendor_favorable (confidence 0.984) and negotiation_priority = block_and_redline (confidence 0.962)—and commercial_favorability_score landed at 1.43 / 4 (below fail_max = 1.50).
  • 1 Borderline Clause Escalated (NEEDS_REVIEW): data_deletion_30d returned p = 0.835, sitting just 0.015 below the 0.85 confidence gate. Rather than auto-approving a subtle post-termination deletion clause, evaluator.py flagged it for legal counsel review.

UC2 Summary (Input → Findings): Feeding a multi-page vendor SaaS contract PDF and a 20-item legal/SLA checklist directly (with no PDF text extractor) verified 9 baseline security safeguards in 856 ms while flagging 10 commercial/legal red flags (low uptime SLA, missing HIPAA BAA, uncapped customer indemnity, long auto-renewal, block_and_redline priority) and safely escalating 1 borderline 30-day data-deletion clause for legal review.

Use Case 3: Ad Creative OCR-Free Multimodal QA (uc3_ad_creative.png)

What this test checks in plain English: Looking directly at a finished advertising banner image with no OCR tool, can ZOMA confirm clean branding and layout while catching prohibited financial promises and unreadable fine-print disclaimers?

In Use Case 3, a 101,539-byte FinTech advertising banner PNG (samples/uc3_ad_creative.png Ref) was passed directly to gemini-decision-1 with --resolution high—with zero OCR preprocessing—against 16 criteria (14 noul + 2 score) in samples/uc3_checklist.json Ref (saved output: results/uc3_result.json Ref). The single API call completed in 836.97 ms (0 retries) using 2,286 input tokens (1,186 text + 1,100 image tokens) and 0 output tokens (estimated cost $0.000229), saving 15 sequential API calls. The overall verdict was FAIL (11 PASS, 5 FAIL, 0 NEEDS_REVIEW), as illustrated alongside the audited creative thumbnail in Figure 6.

Figure 6: UC3 Ad Creative OCR-Free Multimodal QA — Live Test Results
Figure 6: Live gemini-decision-1 multimodal QA results for UC3 (uc3_ad_creative.png with embedded sample thumbnail, 16 criteria, 837.0 ms, 2,286 input tokens, 0 output tokens, $0.000229), separating strong visual design polish (3.15/4) from severe FinTech regulatory violations (0.29/4).

As shown in Figure 6, native high-resolution image ingestion captured both layout quality and fine-print regulatory failures simultaneously:

  • 11 Brand, Accessibility & Design Checks Passed (PASS): mentions_security_soc2 (p = 0.969), headline_legible_contrast (p = 0.955), clear_cta_button (p = 0.948), has_data_visual (p = 0.944), pricing_transparent (p = 0.942), brand_logo_visible (p = 0.937), dark_mode_brand_palette (p = 0.892), and clean_uncluttered_layout (p = 0.869) all passed, while both visual defect risk flags (expected: "no") stayed cleanly low: no_stock_watermarks (p = 0.082, confidence 0.918) and no_typos_visible (p = 0.085, confidence 0.915). visual_hierarchy_score earned 3.15 / 4.
  • 5 FinTech Regulatory & Disclosure Violations Caught (FAIL): Without any OCR step, gemini-decision-1 caught the prohibited "Guaranteed ROI" headline (claim_guaranteed_roi: p = 0.975, exp=no), the unrealistic short-term return claim (unrealistic_return_metric: p = 0.935, exp=no), the unlabeled hypothetical chart (chart_labeled_hypothetical: p = 0.047, exp=yes), and the obscured low-contrast legal disclaimer footer (disclaimer_legible_contrast: p = 0.033, exp=yes). Consequently, regulatory_readiness_score fell to 0.29 / 4 (P(0) = 0.763), failing decisively below fail_max = 1.50.
  • Why 0 NEEDS_REVIEW Escalations Occurred: Every binary criterion resolved at or above 0.869 confidence (minimum 0.869 on clean_uncluttered_layout), leaving zero ambiguous signals—an ideal property for automated pre-flight ad-network moderation queues.

UC3 Summary (Input → Findings): Passing a high-resolution FinTech ad banner PNG and a 16-item creative QA checklist with zero OCR confirmed strong visual polish (3.15 / 4 hierarchy, 11 passed brand/design checks) in 837 ms while catching all 5 severe FinTech regulatory violations ("Guaranteed ROI" promise, unrealistic return claim, unlabeled hypothetical chart, illegible disclaimer, and 0.29 / 4 regulatory readiness) with zero ambiguous escalations.


4. Mode B Live Walkthrough & Empirical Results

Mode B (weighted_scoring) moves beyond pass/fail checklists into quantitative rubric grading and multi-stage eligibility screening. Following the deterministic aggregation and knock-out pipelines illustrated in Figure 3, we walk through each Mode B live evaluation with its dedicated scoring breakdown infographic (Figure 7 and Figure 8).

Use Case 4: Cybersecurity Case Study Weighted Rubric Grading (uc4_student_essay.pdf)

What this test checks in plain English: Given a student's PDF case study and a 100-point grading rubric, can ZOMA check required topics, rate four quality dimensions, check for penalties, and compute an exact, hallucination-free grade in Python?

In Use Case 4, a 52,224-byte student cybersecurity case study PDF (samples/uc4_student_essay.pdf Ref) was graded against a 100-point rubric (samples/uc4_checklist.json Ref; saved output: results/uc4_result.json Ref) containing 14 criteria: 6 mandatory element checks worth +5.0 pts each (30.0 pts), 4 ordinal 0–4 rubric dimensions totaling 70.0 pts, and 4 negative penalty flags (-10.0 to -15.0 pts), with a 75.0 cutoff and ±3.0 borderline margin. The single Decisions API call finished in 702.58 ms (0 retries) using 3,261 input tokens (2,221 text + 1,040 image tokens) and 0 output tokens (estimated cost $0.000326), saving 13 sequential API calls. The deterministic final score was 86.17 / 100.0 (86.2%), yielding PASS, as detailed in Figure 7.

Figure 7: UC4 Cybersecurity Essay Weighted Rubric Grading — Live Test Results
Figure 7: Live Mode B rubric grading breakdown for UC4 (uc4_student_essay.pdf, 14 criteria, 702.6 ms, 3,261 input tokens, 0 output tokens, $0.000326), showing 25.0/30.0 mandatory points, 61.17/70.0 rubric points, 0.0 penalties, and a final score of 86.17/100.0 vs. the 75.0 cutoff.

Figure 7 breaks down every exact point calculated offline by evaluator.py:

  • Mandatory Elements (25.00 / 30.00 pts): Five required elements passed with full +5.0 credit—addresses_hipaa (p = 0.965), references_nist_800_207 (p = 0.953), has_exec_summary (p = 0.947), has_phased_roadmap (p = 0.931), and addresses_legacy_iomt (p = 0.854). The student omitted a detailed 3-year TCO budget table (has_3yr_tco_budget: p = 0.028, confidence 0.972), which evaluator.py deterministically marked FAIL (0.0 / 5.0 pts).
  • Weighted Ordinal Rubric Dimensions (61.17 / 70.00 pts): Python converted each 0–4 expected score linearly via (score / 4.0) * weight: threat_modeling_score (3.548 / 4 → 13.31 / 15.0 pts), architecture_rigor_score (3.487 / 4 → 17.43 / 20.0 pts), operational_feasibility_score (3.427 / 4 → 17.13 / 20.0 pts), and writing_coherence_score (3.547 / 4 → 13.30 / 15.0 pts). Summing 25.00 + 13.3055 + 17.4333 + 17.1343 + 13.3004 yields 86.1735 pts (86.17 / 100.0), clearing the 75.0 cutoff by +11.17 pts—well outside the ±3.0 borderline review band.
  • Zero False Penalties & Zero Low-Confidence Escalations: All four negative penalty flags stayed tightly near zero—penalty_missing_conclusion (p = 0.021), penalty_off_topic (p = 0.031), penalty_factual_blunder (p = 0.039), and penalty_placeholder_text (p = 0.042)—deducting 0.0 pts. Because every noul item exceeded 0.85 confidence and every score item concentrated its top-2 adjacent probability mass (P(3) + P(4) = 0.920–0.958) above 0.85, low_confidence_items was empty (0 / 2 cap), enabling safe automated grading.

UC4 Summary (Input → Findings): Grading a student's cybersecurity case-study PDF against a 14-item, 100-point rubric took 703 ms and revealed 5 of 6 mandatory elements present (25.0 / 30.0, catching the omitted 3-year TCO budget table), strong qualitative scores (61.17 / 70.0), and zero penalty deductions—deterministically yielding PASS at 86.17 / 100.0 (+11.17 pts above the 75.0 cutoff).

Use Case 5: R&D Grant Proposal Knock-Out + Weighted Screening (uc5_grant_proposal.pdf)

What this test checks in plain English: When screening an R&D grant application PDF, can ZOMA enforce strict pass/fail eligibility rules first and then score technical merit, impact, and budget realism against a 70-point cutoff?

In Use Case 5, a 60,088-byte R&D grant proposal PDF (samples/uc5_grant_proposal.pdf Ref) was screened against 15 criteria (samples/uc5_checklist.json Ref; saved output: results/uc5_result.json Ref): 4 hard knock-out eligibility gates (weight = 0.0, mandatory pass), 6 completeness/impact binary checks (+5.0 pts each = 30.0 pts), 4 ordinal merit rubric scores (70.0 pts total), and 1 conflict-of-interest / ethics penalty flag (-15.0 pts), against a 70.0 cutoff and ±3.0 borderline margin. The single API call completed in 769.60 ms (0 retries) using 3,339 input tokens (2,299 text + 1,040 image tokens) and 0 output tokens (estimated cost $0.000334), saving 14 sequential API calls. The proposal cleared all 4 knock-out gates and scored 91.40 / 100.0 (91.4%), returning PASS, as presented in Figure 8.

Figure 8: UC5 R&D Grant Proposal Knock-Out + Weighted Screening — Live Test Results
Figure 8: Live Mode B screening results for UC5 (uc5_grant_proposal.pdf, 15 criteria, 769.6 ms, 3,339 input tokens, 0 output tokens, $0.000334), verifying 4/4 hard knock-out eligibility gates, 30.0/30.0 completeness points, 61.40/70.0 merit points, and 91.40/100.0 total score vs. the 70.0 cutoff.

Figure 8 illustrates how hard eligibility logic and nuanced merit scoring coexist deterministically in one batch:

  • All 4 Hard Knock-Out Eligibility Gates Cleared (4/4 PASS): ko_open_source_commitment (p = 0.974), ko_budget_cap <= $250,000 (p = 0.965), ko_eligible_org (p = 0.964), and ko_timeline_12_24m (p = 0.948) all passed well above the 0.85 threshold. In evaluator.py, if any single knock-out gate had returned FAIL, the overall verdict would have been forced to FAIL immediately regardless of the numeric score; if any knock-out had fallen below 0.85 confidence, it would have forced NEEDS_REVIEW.
  • Completeness & Merit Point Calculation (30.00 + 61.40 = 91.40 / 100.0 pts): All six +5.0 completeness checks passed cleanly—has_local_partners (p = 0.980), has_validation_plan (p = 0.975), has_quarterly_milestones (p = 0.967), has_qualified_team (p = 0.961), overhead_under_15pct (p = 0.960), and has_itemized_budget (p = 0.954)—earning 30.00 / 30.00 pts. The four weighted merit scores contributed technical_merit_score (3.736 / 4 → 18.68 / 20.0 pts), public_impact_score (3.329 / 4 → 16.65 / 20.0 pts), budget_realism_score (3.459 / 4 → 12.97 / 15.0 pts), and sustainability_score (3.495 / 4 → 13.10 / 15.0 pts), summing to 91.4037 pts (+21.40 pts above the 70.0 cutoff).
  • Zero Penalty & Zero Low-Confidence Escalations: penalty_coi_or_ethics (-15.0 pts) remained cleanly absent (p = 0.037, confidence 0.963), and all 15 criteria cleared their confidence gates (low_confidence_items = []), allowing immediate automated advancement to finalist review.

UC5 Summary (Input → Findings): Screening an R&D grant proposal PDF against 4 hard eligibility knock-outs and 11 weighted merit criteria in 770 ms verified all 4/4 eligibility gates (p = 0.948–0.974), awarded full completeness points (30.0 / 30.0) plus strong merit scores (61.40 / 70.0) with zero ethics penalties, and deterministically approved the proposal (PASS at 91.40 / 100.0, +21.40 pts above cutoff).


5. Cross-Use-Case Empirical Benchmarks & Cost Analysis

Aggregating telemetry across all five live CLI executions (uc1_result.json through uc5_result.json) reveals how consistently the 1-Input × N-Criteria architecture performs across Markdown, multi-page PDF, and high-resolution PNG payloads. Figure 9 summarizes end-to-end API latency, shared-input token savings, and per-run cost across all five use cases.

Figure 9: Cross-Use-Case Live Benchmarks — Latency, Token Savings & Cost
Figure 9: Live benchmark summary across UC1–UC5 showing sub-second API latency (497.4–856.4 ms, avg 732.6 ms), 92.9%–95.0% input token reduction vs. naive sequential N× calls, and $0.001526 total cost across all 83 criteria with strictly 0 output tokens.

Four empirical findings stand out from Figure 9:

  • Consistent Sub-Second Latency Across All Modalities: End-to-end HTTP round-trip latency ranged from 497.37 ms (UC1, 18 criteria on Markdown) to 856.42 ms (UC2, 20 criteria on a multi-page PDF), with an overall average of 732.6 ms across all 5 runs (UC3 = 836.97 ms, UC4 = 702.58 ms, UC5 = 769.60 ms) and 0 retries. Every run completed in a single API batch (batches = 1).
  • 92.9% to 95.0% Input Token Reduction vs. Sequential Calls: Sending the shared document once instead of repeating it once per criterion saved 78 sequential API calls across the 5 workflows (83 total criteria evaluated in 5 calls). Compared with a naive sequential baseline (N × total_input_tokens, analogous to re-sending the entire document once for every single checklist question), shared-input evaluation cut input token volume by 94.4% on UC1 (2,562 vs. 46,116), 95.0% on UC2 (3,809 vs. 76,180), 93.8% on UC3 (2,286 vs. 36,576), 92.9% on UC4 (3,261 vs. 45,654), and 93.3% on UC5 (3,339 vs. 50,085).
  • Strictly Zero Output Tokens Across All 83 Criteria: Across all five runs, total_input_tokens summed to 15,257 tokens, while output_tokens remained strictly 0 ($0.00 output cost).
  • Sub-Cent Total Cost ($0.001526 for All 5 Audits Combined): At $0.10 per 1M input tokens Ref, individual audit costs ranged from $0.000229 (UC3) to $0.000381 (UC2). Evaluating all 83 multimodal criteria across five full documents cost $0.001526 total—roughly 655 full multi-document audit suites per US dollar.

6. Beyond These Five Use Cases: Future Horizons for ZOMA

The five live benchmarks in this article focused on Markdown, PDF, and PNG inputs, yet gemini-decision-1 natively supports a 262,144-token unified multimodal context spanning text, JSON, PDFs, images, audio, and video Ref. Whenever an organization needs to inspect one rich artifact against dozens or hundreds of structured rules, the exact same ZOMA pattern applies without changing the architecture. Figure 10 highlights six additional high-leverage applications across industries.

Figure 10: Beyond These 5 Use Cases — Future Horizons for ZOMA
Figure 10: Six additional real-world applications of Zero-Output Multimodal Auditing (ZOMA) across audio, video, combined image+PDF packets, code diffs, long regulatory PDFs, and autonomous AI agent guardrails.

As illustrated in Figure 10, ZOMA extends naturally well beyond document and ad checks:

  • Customer Support Call & Sales Recording QA (AUDIO): Submit one recorded support or sales call natively as audio against 50+ compliance, script-adherence, empathy, and mandatory legal-disclosure rules (noul + score) in a single pass—with no separate speech-to-text transcription pipeline required.
  • Video Ad, Tutorial & Broadcast Compliance Screening (VIDEO): Evaluate one short promotional clip or training video directly against brand safety, age-rating, logo visibility, caption accuracy, and regulatory claim policies before publication.
  • Insurance Claim & Field Inspection Verification (IMAGE + PDF): Combine damage photos and a contractor estimate PDF into one shared input and audit it against policy coverage knock-outs, fraud indicators, and automated payout tiers using Mode B (weighted_scoring).
  • CI/CD Pull Request & Infrastructure Policy Gate (CODE / DIFF): Screen one pull-request diff, Dockerfile, or Terraform plan against 100+ internal security, privacy, and architectural guidelines in under a second inside CI/CD pipelines or autonomous coding loops.
  • Clinical Trial, ISO & ESG Regulatory Dossier Pre-Audit (LONG PDF 256K): Pre-check lengthy statutory filings—such as medical study protocols, ISO quality manuals, or ESG sustainability disclosures—against hundreds of regulatory clauses before paying for formal external audits.
  • Real-Time AI Agent Safety & Tool-Call Guardrails (JSON / AGENT): Gate proposed actions, tool arguments, or generated deliverables from autonomous agents (such as Antigravity or Claude) against dozens of safety, PII, and policy boundaries in a single sub-second forward pass before execution.

7. Limitations, Best Practices & Summary

While Zero-Output Multimodal Auditing (ZOMA) excels at high-throughput verification and structured scoring, treating it as a drop-in replacement for every generative workflow is a mistake. Five engineering principles keep production deployments reliable:

  • Pair Decisions API with a Reasoning Model When Explanations Are Required: Because gemini-decision-1 emits zero output tokens, it tells you which clauses failed (risk_uncapped_customer_indemnity: p = 0.973) and how confident it is, not how to redline the contract prose. The optimal production pattern is a two-stage cascade: run decisions_audit.py on 100% of incoming documents at ~$0.0003 each, and invoke a generative reasoning model only on the specific FAIL or NEEDS_REVIEW items that require written redlines or student feedback.
  • Embed ZOMA Directly Inside AI Agents (Antigravity, Claude, and Beyond): Because the tool is a stateless Python CLI with --format json output, agentic platforms like Antigravity and Claude can call cli/decisions_audit.py as an external quality gate during autonomous workflows—checking their own generated manuscripts, specs, or images against dozens of organization rules in under a second for roughly $0.0003, then fixing only the flagged FAIL or NEEDS_REVIEW items before handing the final output to a human.
  • Write Atomic, Observable Checklist Criteria: Compound questions ("Does the contract include SOC 2, AES-256, and 72-hour breach notice?") blur probabilities when only two of three clauses are present. Splitting them into atomic noul criteria costs only a few extra question tokens per item while keeping calibrated probabilities sharp.
  • Tune Confidence Thresholds & Borderline Margins to Domain Risk: Defaulting to confidence_threshold = 0.85 works well for general pre-flight checks, as demonstrated by UC1 and UC2 catching ambiguous items automatically. For regulated legal or medical gates, raising the threshold to 0.90–0.95 widens the NEEDS_REVIEW safety band so borderline cases always reach human reviewers.
  • Respect the 1,000-Question Batch Boundary: Each POST /v1beta/decisions request accepts up to 1,000 questions Ref. Our client.py automatically chunks larger checklists into sequential 1,000-question batches while preserving the shared input, though keeping single-document checklists focused and non-redundant maximizes signal clarity.

Summary

Instead of asking an AI chatbot to read a file and write long answers one question at a time, Zero-Output Multimodal Auditing (ZOMA) sends one document, PDF, or image once to Google's Gemini Decisions API (gemini-decision-1) Ref and checks up to 1,000 rules in a single pass—with zero text generated and exact, trustworthy results:

  • Under a Second and Almost Free to Run: Across all five live tests (83 checks across Markdown, PDF, and PNG files), every audit finished in under 1 second (average 732.6 ms), generated 0 output tokens, cut input tokens by 92.9%–95.0% compared to checking rules one by one, and cost $0.001526 in total—roughly 655 full five-document audits for a single US dollar.
  • Catches Real Problems Without Blindly Guessing (Mode A): On technical drafts, vendor contracts, and ad images, ZOMA reliably caught confidentiality leaks, risky legal clauses, and prohibited ad promises—and whenever a rule fell in a gray area, it automatically flagged NEEDS_REVIEW so a human could make the final call.
  • Exact, Math-Error-Free Grading and Screening (Mode B): On student case studies (86.17 / 100) and grant applications (91.40 / 100), the AI evaluates each rubric item while a simple Python script handles all additions, penalties, and mandatory eligibility rules—eliminating AI calculation mistakes completely.
  • Ready for Both Everyday Users and AI Agents: You can immediately run the same tool on your own local files and custom checklists without building OCR or complex code, and autonomous AI agents like Antigravity and Claude can call it directly as a fast, low-cost self-check before delivering finished work.

All scripts, sample documents, checklists, and live test logs are ready to clone and run from tanaikech/gemini-decisions-api-python Ref.

Top comments (0)