Document
Hybrid policy loading…
Hybrid policy loading…
No saved answer yet. Questions use the same hybrid policy as summaries.
PREFER_ON_DEVICE). If the model is present, the text never leaves
the machine and costs nothing.
inferenceSource; the badge above is read straight from it, never guessed.
Chunk size and the default policy come from Firebase Remote Config, so the trade-off can be tuned without shipping a new build.
A research assistant for students and field researchers who work with long documents in places with bad Wi-Fi. It runs on the device when it can, and quietly borrows the cloud when it can't — and always tells you which one answered.
Field notes, transcripts and PDFs are long, personal and often handled offline. Cloud-only assistants upload everything and stop working in a basement or a nature reserve. On-device assistants are private and free, but the model is only on some machines and has a small context window. Neither alone is a reliable tool.
document ──▶ chunk (Remote Config size) ──▶ ┌───────────────┐
│ AI Logic │
│ PREFER_ON_ │──▶ Gemini Nano (device)
│ DEVICE │ │ no model /
└───────────────┘ │ too long
▲ ▼
└──── Gemini (cloud fallback)
response.inferenceSource → badge + latency
GenerativeModel per mode,
generateContent() for each chunk, a reduce pass over the chunk summaries, and a
question pass grounded in the most relevant chunks.users/{uid}/notes by security rules.chunk_size, max_chunks,
hybrid_policy and qa_context_chars, fetched at start-up, so the
cost/latency trade-off is tunable without a deploy.
Gemini Nano ships with Chrome on Windows, macOS and ChromeOS (desktop,
version 139+), behind chrome://flags/#prompt-api-for-gemini-nano-multimodal-input.
Linux builds of Chrome/Chromium do not include the model service, so demo runs there always
answer in cloud — the fallback is the feature, not a bug.
countTokens() is unreliable across paths, so chunking is character-based.Documents are stored in Firestore only when you press Save, under your anonymous uid, and are deletable from the list. When a request is served on-device, the document text is not sent to Google; when it is served in the cloud, it is sent to the Gemini API under the project's quota.
Built for #BuildHybridAI 2026. Source: github.com/matrixneoaiagent/hybrid-scribe.