Abid Ali Awan Codex commited on
Commit
453edd1
·
1 Parent(s): 4c1b9da

Add local AI field notes

Browse files

Document the model, ZeroGPU, OCR, structured-output, and Docker lessons behind making NoticeCheck locally deployable.

Co-authored-by: Codex <codex@openai.com>

Files changed (2) hide show
  1. README.md +1 -0
  2. docs/field-notes.md +81 -0
README.md CHANGED
@@ -51,6 +51,7 @@ on a local NVIDIA GPU.
51
  - [GitHub repository](https://github.com/kingabzpro/local-notice-check)
52
  - [LinkedIn project post](https://www.linkedin.com/posts/1abidaliawan_huggingfacehackathon-huggingface-ai-ugcPost-7471594790506192896--_53/)
53
  - [Demo GIF](docs/app-demo.gif)
 
54
  - [Privacy-safe trace dataset](https://huggingface.co/datasets/build-small-hackathon/pakistan-notice-helper-traces)
55
 
56
  NoticeCheck is a safety assistant for suspicious Pakistani messages, bills,
 
51
  - [GitHub repository](https://github.com/kingabzpro/local-notice-check)
52
  - [LinkedIn project post](https://www.linkedin.com/posts/1abidaliawan_huggingfacehackathon-huggingface-ai-ugcPost-7471594790506192896--_53/)
53
  - [Demo GIF](docs/app-demo.gif)
54
+ - [Field notes: making NoticeCheck fully local](docs/field-notes.md)
55
  - [Privacy-safe trace dataset](https://huggingface.co/datasets/build-small-hackathon/pakistan-notice-helper-traces)
56
 
57
  NoticeCheck is a safety assistant for suspicious Pakistani messages, bills,
docs/field-notes.md ADDED
@@ -0,0 +1,81 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Field Notes: Making NoticeCheck Fully Local
2
+
3
+ NoticeCheck started as a cloud-backed version of my Pakistan Notice Helper app.
4
+ For the Hugging Face Hackathon, I rebuilt it so the same pipeline could also run
5
+ locally with Docker Compose and an NVIDIA GPU.
6
+
7
+ ## What I Tried
8
+
9
+ I tested several vision-language model setups before settling on the current
10
+ architecture. Smaller MiniCPM-V experiments were not reliable enough on
11
+ high-risk scam cases. Qwen experiments performed better, but introduced larger
12
+ models, separate vision projectors, cold starts, and more infrastructure.
13
+
14
+ The final app uses:
15
+
16
+ - `openbmb/MiniCPM5-1B` for structured notice assessment
17
+ - `nvidia/NVIDIA-Nemotron-Parse-v1.2` for screenshot text extraction
18
+ - Hugging Face ZeroGPU for the hosted demo
19
+ - Docker Compose and local CUDA for private local deployment
20
+
21
+ ## Problems I Hit
22
+
23
+ Structured output was one of the first major issues. Models sometimes returned
24
+ incomplete or malformed JSON. I added a strict schema, bounded prompts,
25
+ normalization, retries, and a repair pass so every successful result follows the
26
+ same contract.
27
+
28
+ The ZeroGPU deployment exposed several integration problems:
29
+
30
+ - CUDA and PyTorch ABI mismatches
31
+ - missing OCR dependencies such as `einops`, `open_clip_torch`, and `ftfy`
32
+ - GPU quota handling and Hugging Face iframe token forwarding
33
+ - model-loading and cold-start failures hidden behind worker wrappers
34
+
35
+ Screenshot handling also required more than OCR. Ordinary photos could produce
36
+ image descriptions or parser output instead of notice text. Sending that output
37
+ to the language model caused generic generation failures. I added semantic
38
+ region filtering and a dedicated warning that asks the user to upload a clear
39
+ notice or message screenshot.
40
+
41
+ The local Docker build revealed another practical problem: one Python dependency
42
+ needed compilation, so the CUDA image required `build-essential`. CUDA base
43
+ images and model caches are also large, which made persistent volumes and Docker
44
+ disk cleanup important parts of testing.
45
+
46
+ ## What I Learned
47
+
48
+ Making an AI application local is not only about downloading model weights. A
49
+ usable local product also needs:
50
+
51
+ - reproducible GPU and dependency setup
52
+ - predictable structured output
53
+ - explicit input validation
54
+ - clear user-facing failure messages
55
+ - privacy-aware tracing
56
+ - persistent model caching
57
+ - realistic disk and VRAM planning
58
+
59
+ I also learned to treat model evaluation as part of product development. A model
60
+ that works in a simple smoke test may still fail on phishing links, OTP theft,
61
+ Roman Urdu screenshots, harmless reminders, or the application's JSON contract.
62
+
63
+ ## Result
64
+
65
+ NoticeCheck now has a redesigned English interface and can run in two modes:
66
+
67
+ - hosted on Hugging Face ZeroGPU
68
+ - fully local on an NVIDIA GPU
69
+
70
+ The local version starts with:
71
+
72
+ ```bash
73
+ docker compose up --build
74
+ ```
75
+
76
+ ## Links
77
+
78
+ - [Live demo](https://huggingface.co/spaces/build-small-hackathon/noticecheck)
79
+ - [GitHub repository](https://github.com/kingabzpro/local-notice-check)
80
+ - [Privacy-safe trace dataset](https://huggingface.co/datasets/build-small-hackathon/pakistan-notice-helper-traces)
81
+ - [LinkedIn project post](https://www.linkedin.com/posts/1abidaliawan_huggingfacehackathon-huggingface-ai-ugcPost-7471594790506192896--_53/)