Skip to main content

use case · multi-model · guard + tool-calling agent

Multi-model: Two-Stage Safe Local Agent

Never wire untrusted text straight into a tool-calling model. This page runs two independent models in separate Web Workers: Stage 1 (Xenova/mobilebert-uncased-mnli, ~27.2 MB int8) screens the request for prompt injection or policy override; only safe requests advance to Stage 2 (FunctionGemma 270M) to emit and execute real local Notes Vault tools.

1. Two independent local models

Stage 1 · Prompt Safety Guard (MobileBERT-MNLI)

Xenova/mobilebert-uncased-mnli · zero-shot-classification · WASM int8 (~27.2 MB)

Stage 2 · Tool Executor (FunctionGemma 270M)

onnx-community/functiongemma-270m-it-ONNX · text-generation · WebGPU / WASM fp16 (590.8 MB)

2. Test benign vs. prompt-injection requests

Test prompts (benign & adversarial)

3. Pipeline telemetry & live Notes Vault

Stage 1 · MobileBERT-MNLI verdict

Load both models and submit a message to see live Stage 1 zero-shot safety scores.

Stage 2 · FunctionGemma tool call

Runs automatically only when Stage 1 clears the message below the block threshold.

Live local Notes Vault

    Vault settings