Intended use
Input:
{cnn_result, policy_context:{decision, reason_code, legal_threshold, challenge_threshold}, language}
. Output: one strict-JSON object with the message in the requested language. Languages in
the SFT set: en, sw, yo, ha, am, fr, ar (more in the app picker). Non-English strings should get
native-speaker review before release.
Training data
Synthesized from the Kámárí policy engine, not from child faces: sampled signals run through the same
decide() rules, and approved per-reason, per-language templates render the message. The set is
reason-code balanced (so it is not dominated by ALLOW): 8,000 rows, 7,200 train / 800 eval.
Evaluation
Training loss converged from 3.00 to 0.087 (best eval_loss 0.087). Evaluated through the served
endpoint (the manual KV-cached greedy decode used in production, not the buggy generate() path),
over n=70 cases across 5 reason codes and 7 languages (en, sw, yo, ha, am, fr, ar):
Table with columns: Metric, Value| Metric | Value |
|---|
| JSON validity | 1.00 |
| Schema compliance | 1.00 |
| Decision consistency | 1.00 |
| Policy consistency (reason code) | 1.00 |
| Language correctness | 1.00 |
| Invented-code rate (lower is better) | 0.00 |
The endpoint validates output and falls back to an approved template on any model failure, so the
system always returns valid, schema-correct, policy-consistent JSON; language correctness reflects
in-language generation by the model. (An earlier v0 eval showed 0.0 across the board because it ran
through the buggy generate() path; those numbers are superseded.) Non-English strings still benefit
from a native review.
Serving
Load base Gemma 4 + this adapter, merge_and_unload(), and decode greedily token by token (avoid
generate()). On any validation failure, return a deterministic safe fallback so the caller always
gets valid JSON. Served on a Modal L4 GPU, always-on.
Methodology: https://github.com/Mystique1337/kamari/blob/main/docs/methodology.md
License
Apache-2.0. Every output carries: this is an estimate, not a legal age determination.
Links