惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

博客园_首页
博客园 - 【当耐特】
博客园 - 叶小钗
阮一峰的网络日志
阮一峰的网络日志
WordPress大学
WordPress大学
D
Docker
T
The Blog of Author Tim Ferriss
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Microsoft Azure Blog
Microsoft Azure Blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
月光博客
月光博客
M
MIT News - Artificial intelligence
H
Hackread – Cybersecurity News, Data Breaches, AI and More
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
云风的 BLOG
云风的 BLOG
F
Fortinet All Blogs
罗磊的独立博客
小众软件
小众软件
A
About on SuperTechFans
MyScale Blog
MyScale Blog
D
DataBreaches.Net
The GitHub Blog
The GitHub Blog
C
Check Point Blog
L
LangChain Blog

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant
Policy Storyteller: Turning Nepali Bills into Human Stori...
NIRANJAN LAM · 2026-05-25 · via DEV Community

NIRANJAN LAMICHHANE

Gemma 4 Challenge: Build With Gemma 4 Submission

What I Built

Policy Storyteller helps Nepali citizens understand laws without a law degree.

Pick a bill → get a plain-language brief, three diverse personas (Terai, hill, city — farmer, student, shopkeeper…), each with a day-in-the-life scenario and what becomes riskier / safer → vote on the story. English or नेपाली.

Four bills built in: Social Media Act 2081, IT & Cyber Security 2082, School Education 2080, Privacy Act 2075.

Not legal advice — digital equity for low literacy and patchy 4G.

Demo

Flow: Choose bill → Generate story (~1–2 min) → Explore brief & personas → Vote. Stories cache in localStorage per bill + language.

How I Used Gemma 4

Gemma 4 does everything — no hand-written summaries, no rules engine. A FastAPI backend chains seven focused calls per story:

Step Gemma 4 outputs
Brief JSON: summary, who is affected, key points
Personas 3 diverse Nepali composites
Scenarios 2–3 sentences each, NPR & real places
Risks JSON: riskier / safer lists

Prompts force Nepal context (Nagarpalika, NPR, Dashain, Terai/hill/mountain) and Devanagari Nepali when selected. Pydantic validates JSON; one auto-retry if the model adds markdown fences.

Via OpenRouter (OpenAI-compatible API) — swap model id in .env.

Which Model & Why

Gemma 4 small (2B/4B) — on purpose.

Civic users are on phones and free tiers. Each job is small JSON or a few sentences — not a 31B reasoning marathon. Seven sequential calls already take ~1–2 minutes; small Gemma keeps that affordable, fast enough, and good enough in Nepali. MoE/dense would be overkill; small Gemma is the tool that can run in Nepal, not just about Nepal.

Stack

React + Vite + Tailwind · FastAPI + Pydantic · OpenRouter · no DB (localStorage + file votes)

cd backend && pip install -r requirements.txt && copy .env.example .env
uvicorn main:app --reload --port 8000
cd ../frontend && npm install && npm run dev

Enter fullscreen mode Exit fullscreen mode

Learned (quick)

  • Retry on bad JSON beats switching to a bigger model.
  • Tell Gemma who the reader is (“low legal literacy”) — Nepali output improves a lot.
  • Run calls sequentially on free tier or you hit 429 halfway through a story.

Links

Disclaimer: Educational composites only — verify with official Nepal Government sources.