Deploy Gemma 4 E4B + G1 prompt; remove Swahili (English-only) - #71
Merged
Conversation
Generator: Gemma 3n E4B -> Gemma 4 E4B (gemma-4-E4B-it.litertlm, 3.66 GB, ungated litert-community repo, SHA-256 pinned 0b2a8980...). Prompt: deployed system_en.txt -> the G1 deflection-fix prompt. Both per the mamai-eval generator x prompt + safety evaluation: 3n is more helpful but produces genuine dangerous dosing/drug errors under these prompts (hand-adjudicated); Gemma 4 + G1 fixes deflection with ~zero dangerous answers — the safer deployable choice. Swahili completely removed: deleted system_sw.txt, app_sw.arb, app_localizations_sw.dart; stripped sw code paths in RagPipeline.kt; removed sw context labels + dead switcher strings; regenerated l10n English-only. Retriever (EmbeddingGemma) unchanged. Version 0.3.0+3 -> 0.4.0+4. Device-tested on a real device (9da65e62): fresh in-app download of Gemma 4 from source succeeded + SHA-256 verified; model loaded; query 'How do I measure fundal height?' retrieved 3 guidelines (EmbeddingGemma) and generated a grounded, cited, English clinical answer (TTFT 2.6s). flutter analyze clean; release APK builds. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Rb8sCfVzRDRZko7V5JYxUB
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Deploys Gemma 4 E4B + the G1 deflection-fix prompt, and removes Swahili (English-only). Driven by the
mamai-evalgenerator × prompt + safety evaluation.Why
The
mamai-evalmatrix (Gemma 4 / 3n / Qwen × baseline/+G1/+G1+G2, end-to-end + faithfulness) plus a hand-adjudication of every flagged dangerous answer found:So Gemma 4 + G1 is the safest deployable on-device configuration.
Changes
Generator → Gemma 4 E4B
app_config.jsonllm_model→gemma-4-E4B-it.litertlmintro_page.dart: download URL → ungatedlitert-community/gemma-4-E4B-it-litert-lm, SHA-256 pinned0b2a8980…, size guard 4.92 → 3.66 GB, filename, startup itemsync_models.sh, all "Gemma 3n" labels/comments → Gemma 4Prompt → G1
config/prompts/system_en.txt→ the G1 prompt (deployed clinical system prompt)Swahili removed (English-only)
system_sw.txt,app_sw.arb,app_localizations_sw.dartswcode paths inRagPipeline.kt, removed_swcontext labels + dead switcher strings, regenerated l10n English-onlyRetriever (EmbeddingGemma) unchanged. Version
0.3.0+3→0.4.0+4. Docs updated.Device test (real device
9da65e62) ✅flutter analyze: clean · release APK builds (203 MB)0b2a8980…) + model loaded🤖 Generated with Claude Code