Skip to content

DiffusionGemma — Zero-Shot Decision Model

Turn declarative .json.tmpl schemas into fast zero-shot Decision Policies with per-option probabilities and a hesitation score for hesitation-gated hand-off—via Decision Studio (Web UI), Model Context Protocol (MCP), HTTP REST API, or CLI across Vertex AI Dedicated Endpoints (/invoke/*), Serverless Cloud Run GPUs, and Apple Silicon Metal.

📝 Policies and decisions

For policy authors and users: write a .json.tmpl policy, read probabilities and hesitation, add samples and follow-up questions, run datasets. Start with Your first decision policy.


🖥️ 1. Decision Studio Web App (dgem serve)

Embedded Lit WebComponents playground (./bin/dgem serve --port 8090) featuring all 26+ .json.tmpl policies, topbar Backend Target selector (vertex_first | vertex | cloudrun), Stage 2 Gemini Cascade (gemini-3.8-flash), an approximate bounding-box canvas (coarse; see what dgem can do with images), and OpenTelemetry Trace Waterfall inspection.

🤖 2. Model Context Protocol (MCP) Server

Connect Gemini CLI, Claude Desktop, Cursor, or cloud agents via dgem mcp (stdio) or POST /mcp (Streamable HTTP). Exposes 6 native MCP tools (decide_policy, locate_bounding_boxes, decide_custom_questions, list_policy_templates, get_health_and_gpu_status, warmup_gpu) with backend (vertex_first | vertex | cloudrun) and Stage 2 Gemini Cascade parameters.

🌐 3. HTTP Gateway REST API (/api/decide & /v1/systemone)

Call POST /api/decide/{template} or POST /v1/systemone with X-DGem-Backend: vertex_first | vertex | cloudrun (X-DGem-Backend-Used returned on every response). Routes to the warm Vertex AI dedicated endpoint with automatic Cloud Run failover (Gateway and routing).

⌨️ 4. CLI & 9 Benchmark Harnesses

Execute sub-second decisions (dgem decide), generative prompts (dgem ask), and seven reproducible benchmark suites (bench, bench-intents, bench-calibration, bench-bbox, bench-jev, bench-permutation, bench-decision-index).


📜 Policy-as-Template (Zero-Shot)

Treat .json.tmpl files as executable decision policies rather than brittle prompts. Add new boolean gates, [A-Z] choices, or ordinal rubrics by editing a template, without retraining encoder heads: tool-call audits, prompt-injection screening, RAG grounding, passage relevance.

📊 Uncertainty Gate & Stage 2 Gemini Cascade

Every field comes with its own probabilities and Shannon entropy HH, which tends to rise when human annotators disagree. Route only high-entropy items to gemini-3.8-flash (or a person) and keep the rest on the fast path.

🎯 Hesitation-Gated Decisions

Clear answers return in one fast pass; hesitant ones go to a larger model. Hesitation % (normalized entropy) is shown on every answer: below 16% Clear, 16–50% Somewhat unsure, above 50% Very unsure. How it works

⚡ Single-Step Slot Denoise (O(1))

Unmask all decision slots simultaneously in one forward step, completely eliminating autoregressive token-by-token generation overhead.


⚖️ Confidence Beyond Shannon

Every answer carries a probability for each option and a hesitation score. Templates and prompt layout are designed not to distort them, option-order bias is measured on every release, and calibration is fitted per domain. Read why dgem decisions can be trusted →

🔎 Listwise Reranking & Image Questions

Continuous Softmax Expectation (r^i=∑g⋅pi,g\hat{r}_i = \sum g \cdot p_{i,g}) scores 10 candidate RAG passages + 2 security gates in 1 pass and answers categorical questions about images (presence, relations, 3×3 location, count) in one pass, routing unsure answers to Gemini (what dgem can do with images).

☁️ Vertex AI (/invoke/*), Cloud Run & Apple Metal

Run with no cold start on Vertex AI Dedicated Endpoints (g4-standard-48 + RTX PRO 6000), scale-to-zero on Cloud Run GPU, or offline on Apple Silicon Metal.


Details and how to measure your own deployment: From laptop to production.

TargetHardwareCold startUse it for
Vertex AI dedicated endpointg4-standard-48 + 1× RTX PRO 6000None (min 1 replica)Production (default vertex_first)
Cloud Run GPU1× RTX PRO 6000Minutes (scale from zero)Failover, batch, scale-to-zero use
Apple Silicon (diffgemma)M-series, 4-bitNoneDevelopment, offline

Launch the interactive Decision Studio Web App, REST API Gateway, and MCP Server in a single command:

Terminal window
# 1. Start Decision Studio Web UI + HTTP API + Streamable HTTP MCP Server on port 8090
./bin/dgem serve -u "https://<CLOUD_RUN_URL>/v1" --gcp-auth --port 8090
# -> Open http://localhost:8090 in your browser for Decision Studio
# -> Connect MCP clients to http://localhost:8090/mcp (or run './bin/dgem mcp' over stdio)
# 2. Call any named .json.tmpl policy over HTTP REST (no dgem CLI needed by caller)
curl -s http://localhost:8090/api/decide/support_triage \
-H "Content-Type: application/json" \
-d '{"variables": {"ticket": "Charged twice on invoice #9481 and prod API locked!"}}' | jq .