Offline Sovereign AI Lab: Local Gemma + SQLite RAG on GCP IAM Documentation

Regulated Canadian organizations (healthcare, finance, energy, public sector) keep asking the same question: can we run a useful AI assistant completely offline, with zero external API calls and strict local data sovereignty?

Growing up in Lithuania after the Soviet occupation made knowing where information goes, how it is used, and who reads it feel concrete rather than theoretical. In enterprise AI today, that same instinct shows up in real operational risks: third-party API gateways leaking input/output logs to upstream providers, CLOUD Act exposure on US-hosted endpoints, and Canadian PIPEDA and Quebec Law 25 residency requirements.

Most online demos answer "yes" to offline AI using a couple of PDFs and forgiving questions. That hides all the hard parts. To test where offline AI actually works and where it breaks, I picked a domain with zero tolerance for hallucination: Google Cloud IAM permissions and role hierarchies, using the full public GCP documentation stored locally in SQLite.

Constraints

Architecture Overview

[Public GCP IAM Docs]
        │
        ▼
[Structured Parser & Chunker] ──▶ [SQLite DB: FTS5 + Embeddings]
                                            │
                                   Hybrid Retrieval
                                            ▼
[User IAM Query] ──▶ [Local Fine-Tuned Gemma] ──▶ [Grounded Answer + Citations]
                                            │
                                            ▼
                                 [Security Eval Harness]

What Breaks Immediately

Two specific questions this lab is built to benchmark:

  1. Fine-tuning vs. RAG boundary: Use LoRA/QLoRA fine-tuning on Gemma strictly for behavior (domain reasoning, structured answers, and refusing to guess when context is missing), never for memorizing volatile permission lists that change every month.
  2. Fully offline vs. regional Canadian cloud: Measure real local latency, hardware cost, and hallucination rates so regulated teams have honest numbers when comparing an air-gapped box against a regional Canadian landing zone (GCP northamerica-northeast1 or Azure Canada Central).

When Offline Wins (And When Regional Cloud Is Better)

An air-gapped local box only earns its hardware and maintenance overhead if it clears a strict accuracy and latency bar on the security eval harness. If local Gemma plus hybrid SQLite retrieval cannot answer permission questions reliably without hallucinating, I will not recommend shipping an offline box just to check a sovereignty checkbox. In that case, the better architecture is a locked-down Canadian regional landing zone (northamerica-northeast1 or Azure Canada Central) with private endpoints, zero-retention provider contracts, and automated DLP.

Status

In progress. The full GCP documentation corpus is already ingested into SQLite. Once the hybrid retrieval benchmarks and security eval harness numbers are ready, I will publish the results in Writing and link the public GitHub repo here.