パキスタン向け安全問題解決のための小型 AI ツール「Pakistan Notice Helper」の開発
Hugging Face の Build Small Hackathon にて、パキスタンの住民が詐欺メッセージの真偽を判断し安全な行動を取るためのトリアージツール「Pakistan Notice Helper」が開発された。
キーポイント
ローカル課題に特化した実用ツールの開発
パキスタンの銀行、税務当局、警察などから偽装した詐欺メッセージが急増する中、一般ユーザーが直感的にリスクを判断できるツールとして構築された。
真偽判定ではなくトリアージ機能としての設計
メッセージの公式な真偽を断定するのではなく、リンククリックや支払いなどの危険な行動を防ぐための「次に何をすべきか」を判断する支援ツールとして位置づけられている。
Hugging Face Hackathon の成果物
「Build Small Hackathon」の参加者である Abid Ali Awan 氏によって、デモに終わらない実社会での有用性を追求して開発されたプロジェクトである。
次期機能:エージェント型検証ワークフロー
現在のトリアージ機能に加え、Web検索やスクレイピングを活用して通知の真正性を検証し、詐欺警告や組織のなりすましを特定する機能を追加予定。
速度と深さのトレードオフ
詳細な検証プロセスを追加すると応答時間が約30秒に延びるため、現状は「即座にリスクを回避する」ことに焦点を当てており、深い検証はユーザーが時間を許容する場合に提供される。
小型モデルの限界と強み
ローカルで焦点を絞り、慎重に設計された問題解決においては小型モデル(4B)でも強力な安全性を提供でき、万能ではないが現実的な課題に対して有用であることが示された。
影響分析・編集コメントを表示
影響分析
この記事は、大規模な汎用モデルだけでなく、特定の地域の深刻な社会的課題(サイバー詐欺)に対して、軽量で実用的なAIソリューションを提供する可能性を示しています。特に、技術的な真偽判定の限界を理解し、ユーザーの意思決定を支援する「トリアージ」というアプローチは、開発者にとって重要な教訓となり得ます。
編集コメント
地域特有の詐欺手口に対応した、極めて実用的な「Small AI」の実装事例であり、技術的な革新性よりも社会課題解決への即効性が際立つ記事です。
Hugging Face のBuild Small Hackathonのために、デモを超えた実用的でローカルかつ有用な何かを構築したいと考えました。
その結果が、Pakistan Notice Helperです。これはパキスタンの人々がリンクをクリックしたり、電話番号に電話をかけたり、OTP を共有したり、支払いを行ったりする前に、不審なメッセージを理解できるよう支援する、安全性を重視した AI ツールです。
このアイデアは、一般的な問題から生まれました。人々は定期的に銀行、宅配便会社、税務当局、交通警察、公共事業会社、携帯電話事業者、政府機関などからのメッセージを受け取ります。中には本物もありますが、多くは詐欺です。難しいのは常にメッセージを読むことではありません。難しいのは、次に何をすべきかを知ることです。
Pakistan Notice Helper は真正性のチェックツールではありません。メッセージが公式に真実であるか偽物であると主張するものではありません。代わりに、これはトリアージ(選別)ツールとして機能します。テキストまたはスクリーンショットを受け取り、リスクラベル、短い説明、目に見えるレッドフラグ、そして安全な次のステップを返します。
なぜこれが Build Small に適合するのか
このプロジェクトはBackyard AIトラックに適合しています。なぜなら、パキスタンにおける詐欺スタイルの通知や不審なメッセージという特定のローカル問題に焦点を当てているからです。
大規模な汎用アシスタントを構築するのではなく、スコープが明確で、プロダクトの動作が定義されており、インターフェースが実際のユーザーを中心に設計されている場合、小規模モデルがどこまで対応できるかを確認したかった。
当初はより大きな Qwen モデルを試したが、最終的な本番環境での選択は llama.cpp を通じた Qwen3.5 4B Q8 となった。私の 10 ケースの評価において、すべての高リスク詐欺事例とスクリーンショットの両方のケースを通過した。これにより、小規模モデル向けの安全アシスタントとして実用的な選択肢となった。
本プロジェクトでは以下の構成を使用している:
Hugging Face Space
→ カスタム Gradio フロントエンド
→ キューイングされた Gradio サーバーエンドポイント
→ Modal エンドポイント
→ CUDA llama.cpp
→ Qwen3.5 4B Q8 MTP GGUF + ビジョンプロジェクター
これにより、ハッカソンの 32B モデル制限内に収まりながら、テキストとスクリーンショットの両方を処理できる小規模モデルスタックが実現された。
アプリケーションの機能
Pakistan Notice Helper は 英語とウルドゥー語 の両方に対応している。これは最も重要な製品判断の一つであった。なぜなら、パキスタンにおける不審なメッセージは、英語、ウルドゥー語、ローマン・ウルドゥー語、あるいはこれら 3 つの混合で書かれていることが多いためである。
ウルドゥー語モードは単なる翻訳されたインターフェースではない。ユーザーがウルドゥー語に切り替えると、アプリはレイアウトを右から左へ変更し、見出し、ラベル、リスクカード、検証メッセージ、結果コントロールを翻訳するだけでなく、モデルに対して明確なウルドゥー文字で評価を生成させるよう指示する。
つまり、ユーザーは不審なメッセージを提出すると、リスクラベル、説明、警戒すべき点、安全な次のステップ、そして適切な場合の返信ドラフトを含む、ウルドゥー語での完全な安全性対応を受け取ることができます。ローカル向けの安全ツールにとってこれは重要であり、人々が最も使い慣れた言語で書かれたアドバイスの方が、信頼しやすく、行動に移しやすいからです。
このアプリは以下のような警告サインを検索します:
- 緊急性の高い脅威やアカウント停止に関する言葉;
- OTP、PIN、パスワード、CVV、CNIC の詳細情報、またはカードデータの要求;
- 不審な支払いリンクや個人の携帯電話番号;
- 銀行、通信会社、宅配業者、税務当局、警察のなりすまし;
- 前払いを必要とする賞品、返金、求人情報、給付金。
その後、ツールはユーザーに安全な次のステップを提供します。例えば、不審なメッセージ内のリンクや電話番号を使用するのではなく、独自に見つけた公式チャネルを通じて確認することです。
構築しながら学んだこと
このプロジェクトから得た教訓は、小型モデルを用いて開発する際は、最高度のベンチマークスコアを追求するよりも、品質・速度・コスト・製品安全性の間の適切なバランスを見つけることが重要だということです。
1. スコープが明確な場合に小型モデルは最も効果的
最大の学びの一つは、タスクを慎重に限定すれば、小型モデルが驚くほどよく機能しうるという点です。
Pakistan Notice Helper は一般的な詐欺調査ツールである必要はありません。目に見えるリスク信号を特定し、過剰な主張を避け、安全な次のステップを提供すれば十分です。そのことが、製品の範囲、プロンプト設計、出力契約を、モデル自体と同様に重要なものにしました。
このアプリは、「これは危険そうに見えます、ここに警告サインがあります、そして安全に次に取るべき行動はこれです」と伝えるために設計されています。「これは間違いなく本物か、あるいは間違いなく偽物だ」と断言するために設計されたものではありません。
2. より大きなモデルから始める
私はまず Qwen3.6 27B から始めましたが、その品質は非常に優れていました。私のテストでは、不審なメッセージを非常にうまく処理し、強力で信頼性の高い説明を生み出しました。
問題はデプロイコストと実用性でした。このモデルはより多くの VRAM を必要とし、より大きな GPU マシンを要し、コールドスタート時の回復にも時間がかかりました。不規則なトラフィックを持つハッカソンのデモとしては理想的ではありませんでした。動作はしましたが、私が構築したかったような小さく焦点を絞ったツールにとっては、コストが高すぎ、重すぎました。
品質面では、このタスクに対してより大きなモデルの評価は 95/100 程度となります。しかし、品質だけでは不十分です。私はコスト、速度、コールドスタート、そしてアプリが応答性を維持できるかどうかについても考えなければなりませんでした。
3. より小さなローカルオプションのテスト
その後、より多くのローカル環境で実行し、サービングコストを削減できることを期待して、はるかに小さいビジョン・ランゲージモデルである MiniCPM-V 4.6 Q8 への移行を試みました。
その実験はうまくいきませんでした。GPU 上では非常に遅く、ZeroGPU を通じて実行しようとすると、クォータとランタイムの問題に直面しました。インターフェースにはまだ約 35 分のクォータが残っていると表示されていたにもかかわらず、アプリは安定して動作しませんでした。これらの問題の原因を完全に特定できてはいませんが、デプロイが不安定になったことは確かです。
その後、元に戻して Modal を通じてモデルをデプロイしました。デプロイ自体は高速で数秒以内にレスポンスが始まりましたが、モデルの品質は十分ではありませんでした。不審なメッセージの検出に苦しみ、テストケースの多くで失敗したため、結局このモデルは採用しませんでした。
4. 「ちょうどいい」モデルを見つける
その後、Artificial Analysis の小規模オープンソースモデルランキングを調べ、このプロジェクトに最適なモデルを見つけました:Qwen3.5 4B です。
これは Build Small という精神に沿って小さく保ちつつ、アプリの体験に必要な速度があり、必要な安全性機能を実現できる能力を持っていました。Qwen3.6 27B と比較すると、このタスクにおいては 80/100 程度と評価できますが、より大規模なモデルは 95/100 に近い性能です。
しかし、そのトレードオフは妥当でした。
4B モデルは提供コストが安く、読み込みが速く、デプロイが容易で、小規模な Modal マシンでも実用的に動作します。このモデルの品質、速度、コスト、コールドスタート時の挙動のバランスが、Pakistan Notice Helper にとって「ちょうどいい」モデルとなりました。
5. プロンプトと出力契約が極めて重要だった
初期バージョンの中には、有用な形で失敗したものもありました。
思考モードは最終的な構造化 JSON を返す前に 500 トークンの出力予算を消費してしまったため、本番環境では思考機能を無効化しました。1 つの密度の高いローマ・ウルドゥー語スクリーンショットが元の完了制限に達したため、画像リクエストにはより大きなトークン予算を割り当てるように変更しました。
別のモデルからの回答は、検証されていない公式に見えるドメインを提案していました。これは深刻な製品上の問題だったため、システムプロンプトを更新して、架空の URL、電話番号、組織、事実の使用を禁止するようにしました。
これらの修正により、システムはより安全で予測可能になりました。モデルには単に「詐欺を検出する」よう求められただけではなく、厳格な安全性契約に従うよう求められたのです。
6. ウルドゥー語 UX には実際の製品開発が必要だった
ウルドゥー語インターフェースも、私が予想していた以上に多くの作業を必要としました。
直訳は不自然に聞こえました。いくつかの見出しには異なる行間が必要でした。ウルドゥー語とラテン文字のモデル名が混在すると、予期せぬ順序で並べ替えられることがありました。モバイルコントロールにはより多くの縦方向のスペースが必要であり、特に右から左へのレイアウトではその傾向が強まりました。
また、バンドルされた Nastaliq ウェブフォントもテストしました。単独で見ると美しく映りましたが、製品 UI 内では可読性が低下し、インターフェースがあまり一貫性がないように感じられました。そのためこれを削除し、改善されたウルドゥー語のコピーと右から左へのレイアウトを維持したまま、システムのアラビア文字フォントスタックに戻しました。
これらは単なるデザインの細部ではありませんでした。アプリが明確で使いやすく、信頼できるものと感じられるかどうかに影響を与える要素だったのです。
7. 最大の教訓
最終的な教訓は、製品に最適なモデルが必ずしも最大規模のモデルではないということです。
このプロジェクトでは、Qwen3.6 27B が最も優れた生データの品質を提供しましたが、Qwen3.5 4B が最高の製品バランスを実現しました。それは小さく、高速で、手頃な価格であり、明確に定義されたタスクに対して十分でした。
このトレードオフこそが、本プロジェクトを「Build Small」の理念に合致するものと感じさせた理由です。
Codex を用いた構築
Codex は、単なるモデルのデモにとどまらないこのプロジェクト全体において、私の作業を大幅に加速させました。Pakistan Notice Helper には、カスタムフロントエンド、Gradio ベックエンド、Modal でホストされた llama.cpp サーバー、スクリーンショット機能、ウルドゥー語モード、テスト、ドキュメント、そしてより安全な出力パイプラインが必要でした。
完全なコードは GitHub リポジトリ で公開されています。
私は Codex を単なるコード生成ツールとしてではなく、エンジニアリングの共同作業者として活用しました。既存のリポジトリの点検、変更の実装、テストの実行、デバッグ、ドキュメントの更新、そしてデプロイされたシステムと Modal、Gradio、llama.cpp のセットアップを整合させることなどにおいて、Codex は大きな役割を果たしました。
最も有用な部分の一つは、Hugging Face Spaces との互換性を Gradio Server を通じて維持しつつ、カスタムの HTML、CSS、JavaScript インターフェースを構築した点です。デフォルトの Gradio コンポーネントレイアウトを使用するのではなく、このアプリは製品スタイルのフロントエンドを採用しており、背景では Gradio のキューイングされた API ルートと SSE プロトコルと通信しています。
これにより、最終的なスペースは標準的なモデルの遊び場というよりも、実際のローカル向け安全ツールといった印象を与えるようになりました。Codex はまた、英語/ウルドゥー語切り替え、モバイルレイアウトの修正、結果カード、キャッシュされた例、トレース制御機能、およびデプロイフローのためのより明確なドキュメントなど、繰り返される UI の改良にも貢献しました。
私にとって最大の利点は、反復速度の速さでした。望む製品動作を記述し、実装を確認し、テストを行い、フロントエンド、バックエンド、モデルエンドポイント、そして安全制約がすべて連携するまでアプリを継続的に改良することができました。
プライバシー保護されたトレース機能
また、ユーザーのプライベートなコンテンツを公開することなく、アプリの利用状況を理解できるようにするためのオプションの公開トレース機能を追加しました。
このトレースオプションはアプリ内部で表示され、各リクエスト前に無効化できます。有効にすると、完全なユーザーメッセージやスクリーンショットではなく、限られたリクエストレベルのメタデータのみが記録されます。テキストは伏字処理され、長さが制限されます。画像は固定された要約を通じて表現され、保存されることはありません。
トレースには、生スクリーンショット、リンク、識別子、生成された説明、返信下書き、エラー、認証情報、および偶然にプライベートな詳細を繰り返す可能性がある自由形式のモデル出力は含まれません。
また、トレースデータセットも公開し、スキーマを確認してどのようなメタデータが共有されるかを見られるようにしました。
データセットはこちらで閲覧できます:
Pakistan Notice Helper public traces
これは、機密情報が元の入力だけでなく、そこから漏洩する可能性があるからです。モデルの説明、返信草案、抽出された電話番号、URL、または例外メッセージは、生メッセージが削除された場合でも個人の詳細を繰り返す可能性があります。これを避けるため、トレースシステムでは限定的なカテゴリ、ブール値、カウント、および固定された要約のみが公開されます。
このアプリは、推論のためにプライベートな Modal エンドポイントへライブのテキストと画像を送信し続けるため、これは非匿名のローカル推論として提示するものではありません。ユーザーには機密性の高い個人データを送信しないよう警告されており、各リクエスト前にパブリックなトレース共有をオフにすることができます。
これまでの結果
小規模な評価スイートは現実世界の精度推定ではありませんが、回帰テストには有用でした。
最終的な評価では以下の結果となりました:
測定項目
結果
初期厳格パス
10 件中 9 件
初期平均スコア
89.5/100
最終回帰パス
10 件中 10 件
最終回帰平均スコア
100/100
高リスク詐欺ケース
すべて合格
スクリーンショットケース
両方とも合格
MTP ドラフト承認
440 トークン中 222 トークン
ドラフト承認率
50.5%
最も重要な結果はスコアそのものではありませんでした。重要だったのは、スコープを限定した 4B モデルが、プロンプト、出力契約、および UI の修正後でも必要な安全性動作を維持できるという点です。
次に構築すること
次の主要機能は、エージェントによる検証ワークフローとなるでしょう。
現在、Pakistan Notice Helper はトリアージ段階で動作しています。提出されたテキストやスクリーンショットを読み取り、目に見えるリスク信号を特定し、安全な次のステップを提示します。次のバージョンでは、アプリがさらに一歩進んで、その通知がオリジナルなのか、コピーされたものなのか、あるいはすでにオンライン上で詐欺として議論されているのかを検証する機能を追加したいと考えています。
このワークフローには、ウェブ検索とスクレイピングのために Olostep を使用することを計画しています。エージェントはウェブ上で現在の詐欺警告を検索し、類似のメッセージが他の人々によって報告されていないか確認し、なりすまされている組織を特定し、主張を独立して発見された公式ソースと比較します。
また、この検証ワークフローを管理するために OpenAI Agents SDK(OpenAI エージェント SDK)の使用も計画しています。エージェントは単にランダムに閲覧するのではなく、制御されたプロセスに従います:おそらくの組織を抽出し、関連する警告を検索し、関連ページをスクレイピングし、ソースをランク付けし、最後にモデルの評価とともに証拠を提示します。
このワークフローには厳格な安全境界が必要です。エージェントは、疑わしいメッセージ内のリンク、電話番号、または連絡先情報を決して信頼してはいけません。独立して発見されたソースのみを使用し、証拠と推論を明確に区別する必要があります。
製品にはトレードオフも存在します。現在のアプリは通常、約 5 秒 で結果を返しますが、コールドスタート時には約 9 秒 かかります。ウェブ検索、スクレイピング、ソース確認、エージェント推論を追加すると、推論コストと応答時間の両方が増加します。完全な検証ワークフローには、現在のトリアージ体験よりもはるかに遅い、およそ 30 秒 を要する可能性があります。
そのため、ハッカソン版では高速な安全ガイダンスに焦点を絞り続けました。不審なメッセージの場合、速度が重要です。現在のバージョンは、ユーザーが素早く立ち止まり、危険な行動を回避するのに役立ちます。一方、将来的なエージェント型バージョンは、ユーザーがより長い時間を待てる場合に、より深い検証を提供できるでしょう。
最後の考え
Pakistan Notice Helper は設計上、小規模です。
あらゆる種類の詐欺を解決しようとするわけではありません。公式通知の検証を行うと主張するものでもありません。銀行、宅配業者、通信事業者、政府ポータルを代替するものではありません。
代わりに、ユーザーが立ち止まり、赤旗(警告)に気づき、より安全な次の一歩を踏み出すのを支援します。
このプロジェクトは、3 日間の集中した執筆、デプロイ、テスト、改善、そして荒削りの除去という期間で構築されました。進捗の大部分は、製品自体と向き合う時間から生まれました:実際のケースのテスト、小さな失敗の発見、プロンプトの修正、インターフェースの調整、そしてあらゆる決定の背後にあるエンジニアリング上の制約についての考察です。
そのプロセスによってプロジェクトは大幅に改善されました。単に機能を追加するだけでなく、テストと計画により多くの時間を費やしたおかげ、モデルサイズ、レイテンシ、コールドスタート、コスト、安全性の境界線、ウルドゥー語での使いやすさ、そして小規模なモデルが現実的にどこまで得意かを考える余地が生まれました。
小規模なモデルを用いた開発について多くを学びました。最大の教訓は、問題がローカルで焦点を絞り、慎重に設計されていれば、小規模なモデルも強力になるということです。すべてを解決できるわけではありませんが、範囲を正直に定義すれば、現実的な課題に対して依然として役立つことができます。
このデジタル世界では、詐欺や不正行為、不審なメッセージに囲まれています。Pakistan Notice Helper は完全な解決策ではありませんが、小さな第一歩です。暗い空の明かりのように、人々が遅くなりすぎないうちに立ち止まり、より安全に過ごし、より良い判断を下せるよう支援するために作られました。
これが私がこのハッカソンで作りたかった小規模 AI の姿です:ローカルで焦点を絞り、自身の限界について正直であり、設計された人々にとって実際に役立つもの。
プロジェクトリンク
アプリを試したり、コードを確認したり、公開されたトレースデータセットを検索したりできます:
- ウェブアプリ: Hugging Face Spaces 上の Pakistan Notice Helper
- YouTube デモ:Pakistan Notice Helper Demo: Check Suspicious SMS, Bills, Bank Alerts, and Notices(不審な SMS、請求書、銀行アラート、通知を確認)
- GitHub リポジトリ:kingabzpro/pakistan-notice-helper
- 公開トレースデータセット:Hugging Face Datasets 上の Pakistan Notice Helper traces
GitHub リポジトリには、アプリケーションコード、デプロイ設定、ドキュメント、モデル実験ノート、その他のプロジェクト詳細が含まれています。Space にはライブアプリがホストされており、データセットでは、生のユーザーメッセージやスクリーンショットを公開することなく、限定的なリクエストレベルのメタデータを公開するために使用されるプライバシー保護されたトレース形式を示しています。
**
注:** このアプリケーションは、法的・金融的・銀行業務・政府検証に関するアドバイスではなく、安全ガイダンスとして意図されています。
原文を表示
For the Hugging Face Build Small Hackathon, I wanted to build something practical, local, and useful beyond a demo.
The result is Pakistan Notice Helper, a safety-focused AI tool that helps people in Pakistan understand suspicious messages before they click a link, call a number, share an OTP, or make a payment.
The idea came from a common problem: people regularly receive messages that look like they are from banks, couriers, tax authorities, traffic police, utilities, mobile operators, or government departments. Some are real. Many are scams. The hard part is not always reading the message. The hard part is knowing what to do next.
Pakistan Notice Helper is not an authenticity checker. It does not claim that a message is officially genuine or fraudulent. Instead, it works as a triage tool. It accepts text or a screenshot and returns a risk label, a short explanation, visible red flags, and safe next steps.
Why this fits Build Small
The project fits the Backyard AI track because it focuses on a specific local problem: scam-style notices and suspicious messages in Pakistan.
Instead of building a large general-purpose assistant, I wanted to see how far a small model could go when the scope was clear, the product behavior was well-defined, and the interface was designed around real users.
I initially tested a larger Qwen model, but the final production choice became Qwen3.5 4B Q8 through llama.cpp. It passed all high-risk scam cases and both screenshot cases in my ten-case evaluation. That made it a practical choice for a small-model safety assistant.
The project uses:
Hugging Face Space
→ custom Gradio frontend
→ queued Gradio Server endpoint
→ Modal endpoint
→ CUDA llama.cpp
→ Qwen3.5 4B Q8 MTP GGUF + vision projector
This gave me a small-model stack that could handle both text and screenshots while staying below the hackathon’s 32B model limit.
What the app does
Pakistan Notice Helper supports both English and Urdu. This was one of the most important product decisions because suspicious messages in Pakistan are often written in English, Urdu, Roman Urdu, or a mix of all three.
Urdu mode is not just a translated interface. When a user switches to Urdu, the app changes the layout to right-to-left, translates the headings, labels, risk cards, validation messages, and result controls, and also asks the model to generate the assessment in clear Urdu script.
This means the user can submit a suspicious message and receive the full safety response in Urdu, including the risk label, explanation, red flags, safe next steps, and optional reply draft when appropriate. For a local safety tool, that matters because advice is easier to trust and act on when it is written in the language people are most comfortable using.
The app looks for warning signs such as:
- urgent threats or account suspension language;
- requests for OTPs, PINs, passwords, CVVs, CNIC details, or card data;
- suspicious payment links or personal mobile numbers;
- impersonation of banks, telecom companies, couriers, tax authorities, or police;
- prizes, refunds, jobs, or benefits that require an advance fee.
The tool then gives users safer next steps, such as verifying through independently found official channels instead of using the link or phone number inside the suspicious message.
What I learned while building it
This project taught me that building with small models is less about chasing the highest benchmark score and more about finding the right balance between quality, speed, cost, and product safety.
1. Small models work best when the scope is clear
One of the biggest lessons was that small models can work surprisingly well when the task is carefully bounded.
Pakistan Notice Helper does not need to be a general scam investigator. It needs to identify visible risk signals, avoid overclaiming, and give safe next steps. That made the product scope, prompt design, and output contract just as important as the model itself.
The app is designed to say: this looks risky, here are the warning signs, and here is what you should do safely next. It is not designed to say: this is definitely real or definitely fake.
2. Starting with a larger model
I started with Qwen3.6 27B, and the quality was excellent. In my testing, it handled suspicious messages very well and produced strong, reliable explanations.
The problem was deployment cost and practicality. The model required much more VRAM, a larger GPU machine, and longer recovery time during cold starts. For a hackathon demo with irregular traffic, that was not ideal. It worked, but it was too expensive and heavy for the kind of small, focused tool I wanted to build.
In terms of quality, I would rate the larger model around 95/100 for this task. But quality alone was not enough. I also had to think about cost, speed, cold starts, and whether the app could stay responsive.
3. Testing smaller local options
After that, I tried moving to a much smaller vision-language model, MiniCPM-V 4.6 Q8, with the hope that it could run more locally and reduce serving cost.
That experiment did not work well. It was very slow on GPU, and when I tried running it through ZeroGPU, I ran into quota and runtime issues. Even when the interface showed that I still had around 35 minutes of quota left, the app did not behave reliably. I am still not fully sure what caused those issues, but it made the deployment unstable.
I then reverted and deployed the model through Modal. The deployment itself was fast and started responding within a few seconds, but the model quality was not good enough. It struggled with detecting suspicious messages and failed too many of my test cases, so I had to drop it.
4. Finding the “Goldilocks” model
I then looked through the small open-source model rankings on Artificial Analysis and found what became the best fit for this project: Qwen3.5 4B.
It was small enough to stay aligned with the Build Small spirit, fast enough for the app experience, and capable enough for the safety behavior I needed. Compared with Qwen3.6 27B, I would rate it around 80/100 for this task, while the larger model was closer to 95/100.
But the tradeoff made sense.
The 4B model was cheaper to serve, faster to load, easier to deploy, and practical on a smaller Modal machine. That balance of model quality, speed, cost, and cold-start behavior made it the “Goldilocks” model for Pakistan Notice Helper.
5. Prompting and output contracts mattered a lot
Some early versions failed in useful ways.
Thinking mode consumed the 500-token output budget before returning the final structured JSON, so I disabled thinking for production. One dense Roman Urdu screenshot reached the original completion limit, so image requests now receive a larger token budget.
Another model response suggested an official-looking domain that had not been verified. That was a serious product issue, so I updated the system prompt to forbid invented URLs, phone numbers, organizations, and facts.
These fixes made the system safer and more predictable. The model was not just being asked to “detect scams.” It was being asked to follow a strict safety contract.
6. Urdu UX needed real product work
The Urdu interface also needed more work than I expected.
Direct translations sounded unnatural. Some headings needed different line heights. Mixed Urdu and Latin model names could reorder unexpectedly. Mobile controls needed more vertical space, especially in right-to-left layout.
I also tested a bundled Nastaliq webfont. It looked beautiful in isolation, but inside the product UI it reduced readability and made the interface feel less consistent. I removed it and returned to a system Arabic font stack while keeping the improved Urdu copy and RTL layout.
These were not just design details. They affected whether the app felt clear, usable, and trustworthy.
7. The main lesson
The final lesson was that the best model for a product is not always the biggest model.
For this project, Qwen3.6 27B gave the best raw quality, but Qwen3.5 4B gave the best product balance. It was small, fast, affordable, and good enough for the clearly defined task.
That tradeoff is exactly what made the project feel right for Build Small.
Building with Codex
Codex helped me move much faster across the project, especially because this was not just a simple model demo. Pakistan Notice Helper needed a custom frontend, a Gradio backend, a Modal-hosted llama.cpp server, screenshot support, Urdu mode, tests, documentation, and a safer output pipeline.
The full code is available in the GitHub repository.
I used Codex as an engineering collaborator rather than only a code generator. It helped inspect the existing repository, implement changes, run tests, debug issues, update documentation, and keep the Modal, Gradio, and llama.cpp setup aligned with the deployed system.
One of the most useful parts was building a custom HTML, CSS, and JavaScript interface while still keeping Hugging Face Spaces compatibility through Gradio Server. Instead of using the default Gradio component layout, the app uses a product-style frontend that talks to Gradio’s queued API routes and SSE protocol in the background.
This made the final Space feel more like a real local safety tool than a standard model playground. Codex also helped with repeated UI refinements, including the English/Urdu switch, mobile layout fixes, result cards, cached examples, trace controls, and cleaner documentation for the deployment flow.
For me, the biggest benefit was speed of iteration. I could describe the product behavior I wanted, review the implementation, test it, and then keep refining the app until the frontend, backend, model endpoint, and safety constraints worked together.
Privacy-safe traces
I also added an optional public trace feature so people can understand how the app is being used without exposing private user content.
The trace option is visible inside the app and can be disabled before each request. When enabled, it records only limited request-level metadata, not the full user message or screenshot. Text is redacted and capped. Images are represented through fixed summaries and are not stored.
The trace excludes raw screenshots, links, identifiers, generated explanations, reply drafts, errors, credentials, and any free-form model output that could accidentally repeat private details.
I also published the trace dataset so people can review the schema and see what kind of metadata is shared.
You can view the dataset here:
Pakistan Notice Helper public traces
This matters because sensitive information can leak from more than the original input. A model explanation, reply draft, extracted phone number, URL, or exception message can repeat personal details even when the raw message is removed. To avoid that, the trace system only publishes limited categories, booleans, counts, and fixed summaries.
The app still sends live text and images to the private Modal endpoint for inference, so I do not present this as anonymous local inference. Users are warned not to submit sensitive personal data, and public trace sharing can be turned off before each request.
Results so far
The small evaluation suite is not a real-world accuracy estimate, but it was useful for regression testing.
The final evaluation reached:
Measurement
Result
Initial strict passes
9 of 10
Initial average score
89.5/100
Final regression passes
10 of 10
Final regression average score
100/100
High-risk scam cases
All passed
Screenshot cases
Both passed
MTP draft acceptance
222 of 440 tokens
Draft acceptance rate
50.5%
The most important result was not the score itself. It was that a scoped 4B model could preserve the safety behavior I needed after prompt, output-contract, and UI fixes.
What I would build next
The next major feature would be an agentic verification workflow.
Right now, Pakistan Notice Helper stops at triage. It reads the submitted text or screenshot, identifies visible risk signals, and gives safe next steps. In the next version, I want the app to go one step further and help verify whether the notice is original, copied, or already being discussed online as a scam.
For that workflow, I plan to use Olostep for web search and web scraping. The agent could search the web for current scam warnings, check whether similar messages have been reported by other people, identify the organization being impersonated, and compare the claims against independently discovered official sources.
I also plan to use the OpenAI Agents SDK to manage this verification workflow. The agent would not simply browse randomly. It would follow a controlled process: extract the likely organization, search for related warnings, scrape relevant pages, rank sources, and then present evidence alongside the model’s assessment.
This workflow needs strict safety boundaries. The agent must never trust links, phone numbers, or contact details inside the suspicious message. It should only use independently discovered sources and clearly separate evidence from inference.
There is also a product tradeoff. The current app usually returns results within around 5 seconds, and around 9 seconds on cold start. Adding web search, scraping, source checking, and agent reasoning would increase both inference cost and response time. A full verification workflow could take closer to 30 seconds, which is much slower than the current triage experience.
That is why I kept the hackathon version focused on fast safety guidance. For suspicious messages, speed matters. The current version helps users pause and avoid risky actions quickly, while the future agentic version could provide deeper verification when users are willing to wait longer.
Final thoughts
Pakistan Notice Helper is small by design.
It does not try to solve every type of fraud. It does not claim to verify official notices. It does not replace banks, couriers, telecom providers, or government portals.
Instead, it helps a user pause, notice red flags, and take a safer next step.
I built this project over three intense days of writing, deploying, testing, improving, and smoothing the rough edges. Most of the progress came from spending time with the product itself: testing real cases, noticing small failures, fixing prompts, adjusting the interface, and thinking through the engineering constraints behind every decision.
That process made the project much better. Because I spent more time testing and planning than simply adding features, I had more space to think about model size, latency, cold starts, cost, safety boundaries, Urdu usability, and what a small model could realistically do well.
I learned a lot about building with small models. The biggest lesson was that small models become powerful when the problem is local, focused, and carefully designed. They may not solve everything, but they can still help with real problems when the scope is honest.
We are surrounded by scams, fraud, and suspicious messages in this digital world. Pakistan Notice Helper is not the full answer, but it is a small start: one light in a dark sky, built to help people slow down, stay safer, and make better decisions before it is too late.
That is the kind of small AI I wanted to build for this hackathon: local, focused, honest about its limits, and useful for the people it is designed for.
Project links
You can try the app, review the code, and inspect the public trace dataset here:
- Web app: Pakistan Notice Helper on Hugging Face Spaces
- YouTube demo: Pakistan Notice Helper Demo: Check Suspicious SMS, Bills, Bank Alerts, and Notices
- GitHub repository: kingabzpro/pakistan-notice-helper
- Public trace dataset: Pakistan Notice Helper traces on Hugging Face Datasets
The GitHub repository includes the application code, deployment setup, documentation, model experiment notes, and other project details. The Space hosts the live app, while the dataset shows the privacy-safe trace format used to publish limited request-level metadata without exposing raw user messages or screenshots.
Note: The app is intended as safety guidance, not legal, financial, banking, or government verification advice.
関連記事
MosaicLeaks:研究エージェントは秘密を守れるか?
Hugging Face は、AI エージェントが機密情報を漏洩するリスクを検証する「MosaicLeaks」という評価フレームワークを発表した。
米国がアンソロピックの「Fable 5」発売を禁止、しかし市場は動じず
米国政府は国家安全保障上の懸念から、アマゾンの研究者らがガードレール回避手法を発見したとして、アンソロピックに対し最新モデル「Fable 5」と「Mythos 5」の販売差し止めを命じた。サイバーセキュリティ研究者らはこの措置が危険だとする公開書簡に署名し、同社も他モデルでも同様の抜け道が存在すると指摘している。
MosaicLeaks:研究エージェントは秘密を守れるか?(10 分読了)
TLDR AI は、プライベート文書とウェブ検索を組み合わせる深層研究エージェントのプライバシーリスク「MosaicLeaks」を指摘し、安全なクエリ構築による報酬学習で情報漏洩を大幅に削減する新手法 PA-DR を提案した。
今日のまとめ
AI日報で今日の重要ニュースをまとめ読み