Commit ·
9b17df4
1
Parent(s): 5066100
Pivot runtime to OpenBMB MiniCPM
Browse filesCo-authored-by: Codex <codex@openai.com>
- AGENT_TRACE.md +4 -1
- CODEX_BUILD_LOG.md +3 -1
- FIELD_NOTES.md +14 -1
- README.md +8 -5
- SETUP.md +3 -1
- app.py +2 -1
- eval/README.md +3 -1
- jawbreaker/analyzers.py +10 -3
AGENT_TRACE.md
CHANGED
|
@@ -34,12 +34,15 @@ Codex helped:
|
|
| 34 |
- redesign the Gradio UI around a calm safety-card experience
|
| 35 |
- add copyable trusted-person handoff text
|
| 36 |
- patch Gradio dark-mode/loading-opacity leakage
|
|
|
|
|
|
|
| 37 |
|
| 38 |
Current decisions:
|
| 39 |
|
| 40 |
-
- Deployed model: `
|
| 41 |
- Deployed backend: Transformers on ZeroGPU.
|
| 42 |
- Local/eval model path: llama-cpp-python remains available for GGUF models.
|
| 43 |
- Fine-tuning: cut for this submission.
|
| 44 |
- Primary badges: Off-Brand, Sharing is Caring, Field Notes.
|
| 45 |
- Defensible badges: Off the Grid and Llama Champion, documented carefully.
|
|
|
|
|
|
| 34 |
- redesign the Gradio UI around a calm safety-card experience
|
| 35 |
- add copyable trusted-person handoff text
|
| 36 |
- patch Gradio dark-mode/loading-opacity leakage
|
| 37 |
+
- pivot the deployed model default to `openbmb/MiniCPM4.1-8B` for OpenBMB eligibility
|
| 38 |
+
- add `trust_remote_code` support for MiniCPM's Transformers loader path
|
| 39 |
|
| 40 |
Current decisions:
|
| 41 |
|
| 42 |
+
- Deployed model: `openbmb/MiniCPM4.1-8B`.
|
| 43 |
- Deployed backend: Transformers on ZeroGPU.
|
| 44 |
- Local/eval model path: llama-cpp-python remains available for GGUF models.
|
| 45 |
- Fine-tuning: cut for this submission.
|
| 46 |
- Primary badges: Off-Brand, Sharing is Caring, Field Notes.
|
| 47 |
- Defensible badges: Off the Grid and Llama Champion, documented carefully.
|
| 48 |
+
- Sponsor target: OpenBMB, because MiniCPM is now central to the app.
|
CODEX_BUILD_LOG.md
CHANGED
|
@@ -27,7 +27,7 @@ Codex helped expand the initial seed eval into a 100-case labeled dataset and up
|
|
| 27 |
|
| 28 |
Codex then made the eval runner backend-aware so the same 100 cases can score the heuristic stub, saved JSONL predictions, or local GGUF models through `llama-cpp-python`.
|
| 29 |
|
| 30 |
-
## Runtime
|
| 31 |
|
| 32 |
Codex helped compare the practical runtime paths and move the deployed app to Transformers on ZeroGPU with `Qwen/Qwen3-0.6B`.
|
| 33 |
|
|
@@ -40,3 +40,5 @@ Follow-up hardening included:
|
|
| 40 |
- deterministic heuristic guardrails for obvious scam danger
|
| 41 |
- hidden model warmup on Space load
|
| 42 |
- Gradio loading and dark-mode fixes for a stable demo surface
|
|
|
|
|
|
|
|
|
| 27 |
|
| 28 |
Codex then made the eval runner backend-aware so the same 100 cases can score the heuristic stub, saved JSONL predictions, or local GGUF models through `llama-cpp-python`.
|
| 29 |
|
| 30 |
+
## Runtime Pivots
|
| 31 |
|
| 32 |
Codex helped compare the practical runtime paths and move the deployed app to Transformers on ZeroGPU with `Qwen/Qwen3-0.6B`.
|
| 33 |
|
|
|
|
| 40 |
- deterministic heuristic guardrails for obvious scam danger
|
| 41 |
- hidden model warmup on Space load
|
| 42 |
- Gradio loading and dark-mode fixes for a stable demo surface
|
| 43 |
+
|
| 44 |
+
Codex then helped pivot the deployed default to `openbmb/MiniCPM4.1-8B` for OpenBMB sponsor eligibility. The app now exposes `JAWBREAKER_TRUST_REMOTE_CODE` so MiniCPM can load through Transformers while keeping the Qwen default available as an environment-variable fallback if Space latency becomes unacceptable.
|
FIELD_NOTES.md
CHANGED
|
@@ -46,6 +46,19 @@ What was cut:
|
|
| 46 |
|
| 47 |
- Fine-tuning. The project does not have enough separate training data to fine-tune responsibly without overfitting.
|
| 48 |
- Multi-model switching UI. It adds confusion without helping the person the tool is built for.
|
| 49 |
-
- Additional sponsor-specific runtime pivots. A stable Backyard AI submission matters more than chasing every possible badge.
|
| 50 |
|
| 51 |
Current remaining field-work need: collect or choose one realistic, sanitized scam story for the demo video. The story should show a person pasting a suspicious message, receiving one safe action, and copying the trusted-person handoff.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 46 |
|
| 47 |
- Fine-tuning. The project does not have enough separate training data to fine-tune responsibly without overfitting.
|
| 48 |
- Multi-model switching UI. It adds confusion without helping the person the tool is built for.
|
| 49 |
+
- Additional sponsor-specific runtime pivots beyond OpenBMB. A stable Backyard AI submission matters more than chasing every possible badge.
|
| 50 |
|
| 51 |
Current remaining field-work need: collect or choose one realistic, sanitized scam story for the demo video. The story should show a person pasting a suspicious message, receiving one safe action, and copying the trusted-person handoff.
|
| 52 |
+
|
| 53 |
+
## 2026-06-06 OpenBMB Pivot
|
| 54 |
+
|
| 55 |
+
Kickoff made clear that MiniCPM needs to be central for OpenBMB award eligibility. Jawbreaker moved the deployed ZeroGPU default from `Qwen/Qwen3-0.6B` to `openbmb/MiniCPM4.1-8B`.
|
| 56 |
+
|
| 57 |
+
Why:
|
| 58 |
+
|
| 59 |
+
- MiniCPM is now the primary scam-analysis model, not a side mention.
|
| 60 |
+
- The model remains under the 32B limit and fits the small-model theme.
|
| 61 |
+
- The OpenBMB model family is explicitly positioned for efficient local and edge deployment.
|
| 62 |
+
- The heuristic guard remains in place so obvious scam danger is not under-called if the model output is weak or malformed.
|
| 63 |
+
|
| 64 |
+
Fallback plan: if Space latency or memory behavior is unacceptable, switch `JAWBREAKER_TRANSFORMERS_MODEL_ID` back to `Qwen/Qwen3-0.6B` and document the OpenBMB bakeoff result honestly.
|
README.md
CHANGED
|
@@ -10,6 +10,8 @@ tags:
|
|
| 10 |
- gradio
|
| 11 |
- build-small-hackathon
|
| 12 |
- backyard-ai
|
|
|
|
|
|
|
| 13 |
- local-first
|
| 14 |
- llama-cpp
|
| 15 |
- zerogpu
|
|
@@ -53,16 +55,17 @@ Jawbreaker is deliberately narrow. It does not try to be a general assistant or
|
|
| 53 |
|
| 54 |
## Model Runtime
|
| 55 |
|
| 56 |
-
The deployed Space uses `
|
| 57 |
|
| 58 |
Why this model:
|
| 59 |
|
| 60 |
-
- It
|
| 61 |
-
- It
|
|
|
|
| 62 |
- It avoids external commercial model APIs.
|
| 63 |
- It can produce the structured JSON that Jawbreaker validates before rendering.
|
| 64 |
|
| 65 |
-
The local/eval path still supports GGUF models through `llama-cpp-python`, including
|
| 66 |
|
| 67 |
Safety architecture:
|
| 68 |
|
|
@@ -83,7 +86,7 @@ Safety architecture:
|
|
| 83 |
## Sponsor Eligibility Notes
|
| 84 |
|
| 85 |
- OpenAI Codex Track: public GitHub repo with Codex-attributed commits linked in this README.
|
| 86 |
-
- OpenBMB Awards:
|
| 87 |
- Modal Awards: not currently targeted; Modal is not part of the deployment path.
|
| 88 |
- NVIDIA Nemotron Quest: not targeted; no NeMoTron model is used.
|
| 89 |
|
|
|
|
| 10 |
- gradio
|
| 11 |
- build-small-hackathon
|
| 12 |
- backyard-ai
|
| 13 |
+
- openbmb
|
| 14 |
+
- minicpm
|
| 15 |
- local-first
|
| 16 |
- llama-cpp
|
| 17 |
- zerogpu
|
|
|
|
| 55 |
|
| 56 |
## Model Runtime
|
| 57 |
|
| 58 |
+
The deployed Space uses `openbmb/MiniCPM4.1-8B` through Hugging Face Transformers on ZeroGPU.
|
| 59 |
|
| 60 |
Why this model:
|
| 61 |
|
| 62 |
+
- It makes OpenBMB MiniCPM central to the app, matching the hackathon sponsor track.
|
| 63 |
+
- It is still well below the 32B parameter limit and fits the "small model" constraint honestly.
|
| 64 |
+
- MiniCPM4.1 is built for efficient end-side inference, which fits Jawbreaker's local-first safety premise.
|
| 65 |
- It avoids external commercial model APIs.
|
| 66 |
- It can produce the structured JSON that Jawbreaker validates before rendering.
|
| 67 |
|
| 68 |
+
The local/eval path still supports GGUF models through `llama-cpp-python`, including Qwen and MiniCPM GGUF candidates. The CPU GGUF path is kept as evidence and tooling, while the judge-facing Space uses ZeroGPU because first-click cold-start latency matters for the product experience.
|
| 69 |
|
| 70 |
Safety architecture:
|
| 71 |
|
|
|
|
| 86 |
## Sponsor Eligibility Notes
|
| 87 |
|
| 88 |
- OpenAI Codex Track: public GitHub repo with Codex-attributed commits linked in this README.
|
| 89 |
+
- OpenBMB Awards: targeted; MiniCPM is the deployed model and performs the central scam analysis.
|
| 90 |
- Modal Awards: not currently targeted; Modal is not part of the deployment path.
|
| 91 |
- NVIDIA Nemotron Quest: not targeted; no NeMoTron model is used.
|
| 92 |
|
SETUP.md
CHANGED
|
@@ -69,7 +69,9 @@ For responsive model inference without paid hardware:
|
|
| 69 |
|
| 70 |
- set Space hardware to `ZeroGPU`
|
| 71 |
- set Space variable `JAWBREAKER_BACKEND=zerogpu`
|
| 72 |
-
- keep `JAWBREAKER_TRANSFORMERS_MODEL_ID=
|
|
|
|
|
|
|
| 73 |
|
| 74 |
CPU fallback remains available with `JAWBREAKER_BACKEND=llama-cpp`.
|
| 75 |
|
|
|
|
| 69 |
|
| 70 |
- set Space hardware to `ZeroGPU`
|
| 71 |
- set Space variable `JAWBREAKER_BACKEND=zerogpu`
|
| 72 |
+
- keep `JAWBREAKER_TRANSFORMERS_MODEL_ID=openbmb/MiniCPM4.1-8B` for the OpenBMB-targeted build
|
| 73 |
+
- keep `JAWBREAKER_TRUST_REMOTE_CODE=true`; MiniCPM requires custom model code through Transformers
|
| 74 |
+
- fallback model if latency is unacceptable: `Qwen/Qwen3-0.6B`
|
| 75 |
|
| 76 |
CPU fallback remains available with `JAWBREAKER_BACKEND=llama-cpp`.
|
| 77 |
|
app.py
CHANGED
|
@@ -136,11 +136,12 @@ def get_analyzer():
|
|
| 136 |
|
| 137 |
if backend in {"transformers", "zerogpu"}:
|
| 138 |
return build_transformers_analyzer(
|
| 139 |
-
os.getenv("JAWBREAKER_TRANSFORMERS_MODEL_ID", "
|
| 140 |
max_new_tokens=_env_int("JAWBREAKER_MAX_TOKENS", 192) or 192,
|
| 141 |
temperature=float(os.getenv("JAWBREAKER_TEMPERATURE", "0")),
|
| 142 |
device_map=os.getenv("JAWBREAKER_DEVICE_MAP", "auto"),
|
| 143 |
dtype=os.getenv("JAWBREAKER_TORCH_DTYPE", "auto"),
|
|
|
|
| 144 |
)
|
| 145 |
|
| 146 |
raise ValueError(f"Unsupported JAWBREAKER_BACKEND: {backend}")
|
|
|
|
| 136 |
|
| 137 |
if backend in {"transformers", "zerogpu"}:
|
| 138 |
return build_transformers_analyzer(
|
| 139 |
+
os.getenv("JAWBREAKER_TRANSFORMERS_MODEL_ID", "openbmb/MiniCPM4.1-8B"),
|
| 140 |
max_new_tokens=_env_int("JAWBREAKER_MAX_TOKENS", 192) or 192,
|
| 141 |
temperature=float(os.getenv("JAWBREAKER_TEMPERATURE", "0")),
|
| 142 |
device_map=os.getenv("JAWBREAKER_DEVICE_MAP", "auto"),
|
| 143 |
dtype=os.getenv("JAWBREAKER_TORCH_DTYPE", "auto"),
|
| 144 |
+
trust_remote_code=_env_bool("JAWBREAKER_TRUST_REMOTE_CODE", True) or False,
|
| 145 |
)
|
| 146 |
|
| 147 |
raise ValueError(f"Unsupported JAWBREAKER_BACKEND: {backend}")
|
eval/README.md
CHANGED
|
@@ -23,10 +23,12 @@ The eval intentionally includes legitimate alerts and ordinary messages. A scam
|
|
| 23 |
|
| 24 |
## Current Runtime Decision
|
| 25 |
|
| 26 |
-
The deployed Space uses `
|
| 27 |
|
| 28 |
The GGUF / `llama-cpp-python` path remains available for local eval and badge evidence, but it is not the primary live demo path. The live app also uses a deterministic heuristic guard so an obvious high-risk scam is not rendered as safe if the small model under-calls the risk.
|
| 29 |
|
|
|
|
|
|
|
| 30 |
## Running Backends
|
| 31 |
|
| 32 |
Heuristic baseline:
|
|
|
|
| 23 |
|
| 24 |
## Current Runtime Decision
|
| 25 |
|
| 26 |
+
The deployed Space uses `openbmb/MiniCPM4.1-8B` through Transformers on ZeroGPU to make OpenBMB MiniCPM central to the app.
|
| 27 |
|
| 28 |
The GGUF / `llama-cpp-python` path remains available for local eval and badge evidence, but it is not the primary live demo path. The live app also uses a deterministic heuristic guard so an obvious high-risk scam is not rendered as safe if the small model under-calls the risk.
|
| 29 |
|
| 30 |
+
If MiniCPM Space latency is unacceptable during final demo testing, `Qwen/Qwen3-0.6B` remains the fallback via `JAWBREAKER_TRANSFORMERS_MODEL_ID`.
|
| 31 |
+
|
| 32 |
## Running Backends
|
| 33 |
|
| 34 |
Heuristic baseline:
|
jawbreaker/analyzers.py
CHANGED
|
@@ -178,6 +178,7 @@ def build_transformers_analyzer(
|
|
| 178 |
temperature: float = 0.0,
|
| 179 |
device_map: str = "auto",
|
| 180 |
dtype: str = "auto",
|
|
|
|
| 181 |
) -> Analyzer:
|
| 182 |
try:
|
| 183 |
import torch
|
|
@@ -189,11 +190,17 @@ def build_transformers_analyzer(
|
|
| 189 |
|
| 190 |
started = perf_counter()
|
| 191 |
print(
|
| 192 |
-
|
|
|
|
| 193 |
flush=True,
|
| 194 |
)
|
| 195 |
-
tokenizer = AutoTokenizer.from_pretrained(model_id)
|
| 196 |
-
model = AutoModelForCausalLM.from_pretrained(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 197 |
model.eval()
|
| 198 |
device = getattr(model, "device", "unknown")
|
| 199 |
hf_device_map = getattr(model, "hf_device_map", None)
|
|
|
|
| 178 |
temperature: float = 0.0,
|
| 179 |
device_map: str = "auto",
|
| 180 |
dtype: str = "auto",
|
| 181 |
+
trust_remote_code: bool = False,
|
| 182 |
) -> Analyzer:
|
| 183 |
try:
|
| 184 |
import torch
|
|
|
|
| 190 |
|
| 191 |
started = perf_counter()
|
| 192 |
print(
|
| 193 |
+
"jawbreaker transformers load_start "
|
| 194 |
+
f"model_id={model_id} device_map={device_map} dtype={dtype} trust_remote_code={trust_remote_code}",
|
| 195 |
flush=True,
|
| 196 |
)
|
| 197 |
+
tokenizer = AutoTokenizer.from_pretrained(model_id, trust_remote_code=trust_remote_code)
|
| 198 |
+
model = AutoModelForCausalLM.from_pretrained(
|
| 199 |
+
model_id,
|
| 200 |
+
dtype=dtype,
|
| 201 |
+
device_map=device_map,
|
| 202 |
+
trust_remote_code=trust_remote_code,
|
| 203 |
+
)
|
| 204 |
model.eval()
|
| 205 |
device = getattr(model, "device", "unknown")
|
| 206 |
hf_device_map = getattr(model, "hf_device_map", None)
|