慣性聚合 高效追讀感興趣之博客、新聞、科技資訊
閱原文 以慣性聚合開啟

推薦訂閱源

博客园 - 司徒正美
V
V2EX
T
Tailwind CSS Blog
有赞技术团队
有赞技术团队
aimingoo的专栏
aimingoo的专栏
Apple Machine Learning Research
Apple Machine Learning Research
IT之家
IT之家
Blog — PlanetScale
Blog — PlanetScale
A
About on SuperTechFans
月光博客
月光博客
T
The Blog of Author Tim Ferriss
宝玉的分享
宝玉的分享
Martin Fowler
Martin Fowler
博客园 - 聂微东
The GitHub Blog
The GitHub Blog
V
Visual Studio Blog
WordPress大学
WordPress大学
酷 壳 – CoolShell
酷 壳 – CoolShell
Engineering at Meta
Engineering at Meta
GbyAI
GbyAI

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 Common SOC 2 Failures (Real World) Stop Vibe-Checking Your AI App: A Practical Guide to Evals How to Use SonarQube and SonarScanner Locally to Level Up Your Code Quality Your Next To-Do App Is Dead — I Replaced Mine with an OpenClaw AI Sign a Nostr event in 60 lines of Python using coincurve — no nostr-sdk, no nbxplorer, no rust toolchain ITGC Audit Explained Like You’re in Big 4 Patch Tuesday abril 2026: Microsoft parcha 163 vulnerabilidades y un zero-day en SharePoint Stop scraping everything: a better way to track competitor price changes Listing on MCPize + the Official MCP Registry while routing payments OUTSIDE the marketplace — how I kept 100% of my x402 revenue Building an AI-Powered Risk Intelligence System Using Serverless Architecture Why We Ripped Function Overloading Out of Our AI Toolchain Testing AI-Generated Code: How to Actually Know If It Works SaaS Churn Is Killing Your Business. Here Is What to Do About It (Without a Support Team) The Speed of AI Is No Longer Linear - And Self-Improving Models Are Why How to Implement RBAC for MCP Tools: A Practical Guide for Engineering Teams From Standard Quote to Persuasive Proposal: AI Automation for Arborists I built a CLI that scaffolds complete multi-tenant SaaS apps Axios CVE-2025–62718: The Silent SSRF Bug That Could Be Hiding in Your Node.js App Right Now The dashboard that ended our friendship Data Pipelines Explained Simply (and How to Build Them with Python)
力卡斯:菲列宾离线灾情伴侣,以设备端Gemma 4 E2B驱动之
John Paul Cu · 2026-05-24 · via DEV Community

此乃Gemma 4之挑战提交:以Gemma 4筑之

所筑何物

LIKAS国之灾厄时,尔之伴侣也.

Likas,菲语也,意为自然,亦为避之使去. LIKAS乃离线之智灾伴侣,助菲律宾人于天灾之际得安。

于菲律宾,灾患至。 通信中断。2024年台风季仅30日,已现六场巨风;此国年均遭~20台风、100–150有感地震,及火山频发,74%之民处灾害易地。当台风登陆或地壳崩裂,电塔倾颓,网络骤断 ,适逢人家亟需知避难所之所在、及如何可达之时。 吾所试之"灾祸应用",皆以为灾厄之时,必有一事为妄:网络之通。

LIKAS者,乃React Native之应用(Android/iOS),化手机为自足之求生器。地图、避难所、预算之OSM人行路线图、NDRRMC/PAGASA/PHIVOLCS之规程,及精调之Gemma 4 E2B模型,皆于安装时并集。运行时无网络调用——非权宜之计,乃既定之规。

居中者,乃一人工智能之助,其故意为之也。非也若为聊机器人行。一供二商之模,若放任其言,则患生焉;一供二商之模,若意导径至实据乃一資也。故 LIKAS 以 Gemma 4 為之。专务之器遣使:每转必发一JSON之函——或为工具之唤,或为言语之应,绝无散文绕之.

一实问,自首至尾:用户以Taglish书之,"Saan kami pwedeng lumikas? May aso at lola ako"(《何地可避?吾有犬与祖母》)。第一转——模型发{"action":"tool","name":"route_to_nearest_evacuation","args":{}}。应用于此机上全然解之.迪克斯特拉于人行图寻可行路径,复以权重评分列中心。distance·0.4 + pwd·0.3 + pet·0.2 + capacity·0.1). 转二 — 喂入结果,模型产出终解因设备档案而个性化: 揭示宠物友好、残疾人士可进入之中心故也题曰犬与洛拉,乃他加禄语。无一字节离机。

四器固本,安危之答,皆据权柄之数,非囿于模之参数也。

  • get_protocol引述 NDRRMC/菲律宾火山地震研究所/PAGASA 之步骤逐字复述创安之术,所禁也。
  • route_to_nearest_evacuation离线,识用户之路由
  • find_nearby离线POI检索(医院、学校、健身房、多功能厅、室内球场)
  • get_user_profile设备内个性化供应(条件、同伴、会面点)

示范

观影视之乐也视频导览: https://www.youtube.com/watch?v=kHHcDSyip-Q

链接GitHub(IT之家) https://github.com/JpCurada/likas

佐证物(皆公器)

吾如何用Gemma 4

吾择Gemma 4 E2B——2B有效参数之边缘变体也——盖因LIKAS之全理,乃模型须栖于方失信号之手机者也。 若4B與31B之變體,則能事更多;然亦不可得。E2B者,唯此一式,Q4_K_M之量化(約1.8GB)可安適於中階Android手機之RAM預算中,與MapLibre、步行者之圖、OSM POI之數據並存。評判之問——"示吾等,何故汝之模型適於此任"——此處有鋒銳之答:灾者,连绝也,故模宜运灾所,唯E2B可之。

然置2B模于要害之途,须二设计之变,吾以为此献中最趣者二:

一。精调Gemma 4 E2B于生死攸关之务——非为更优之聊器。Unsloth之LoRA管路。 吾训 __Gemma 4 E2B__ 之术,与 同也。 九规系统提示应用搭载:直引协议,安全/撤离查询强制工具使用,资料个性,离题拒绝,英/菲/他语同应。因训练与推论共享同一提示直引,故评估笔记与手机间无零散偏移。资料集乃艰难之务——v3生成六百九十二对话,然仅约三十%助人回话独异(直引规则将多仿问映射至)无异协议文本)。其迹昭然:训练损失在24步内骤降,自3.47至0.31,而验证数据几无变动。其解乃守则谨遵之转述生成器何者extract_rules() 之解析,遍察源码之 NDRRMC/PHIVOLCS 各步,皆证其存焉于诸变体——故表意之形各异(简练/编号/急迫/慰藉),而安命之训未尝稍失。

2. 以 llama.cpp 之器运行 Gemma 4,周以 GBNF 之文法。 精调之模,量化为 Q4_K_M GGUF。 而全然于机内运行,经由 llama.rn (^0.12.0) — 凡机内之全 llama.cpp 引擎,不假外求 (n_ctx: 4096n_threads: 4,GPU 层全然卸载,不倚服务器)。取样本恒锁低 (temperature 0.4): 灾害调度者不可独创。每回必为可解析之信封,于电话间,无服务器可重试。仅凭提示不能确保——故解码受限于GBNF语法,此语法源自实时工具注册之典籍:一speak或四工之器其一,工名及引数枚举俱烙为字面量。解码者实不能发非工之名,或未成之器。

文法有保之,非择焉者,信然而不恒——遇避难之问,时发洁净之器,时narrates其器于speak之应,使地无遗物于至要之际。是故遣令之环,裹以之救。:若用户之讯息明确定求疏散或邻近之POI,而匹配之器未尝运行,则应用自唤此器,将路径/标记推于地图,无论模型择何形状。亦有全无LLM之备选:若模型载入不遂或电芯低于十五分之十五,则同此关键词路由仍解疏散与POI之询于设备数据。纵模型已死,接地犹存。

此分野乃吾用Gemma 4之要旨:边缘处本调用,使小模守正。Gemma擅其所长——析乱菲语,应答流畅。器掌不可幻生者——路径、距离、协议文、私数据。模型永无一安全之策;其之。此乃使2B之模可信,得置于疏散之际。

凡物皆可验:Likas/src/services/aiAssistantService.ts主调度之环,aiGrammar.ts自器之录建GBNF,Likas/scripts/build_dataset_v4.py含过拟合之数,而notebooks/Likas_Sample_Prompts.ipynb 复现生产提示与文法,时n_ctx=4096 — 机上行为可察,无需构建应用。