Lighthouse Keeper 0.1

Keeper is the text safety model inside Lighthouse, a child safety app from Prosperity Tech. It reads short messages on a child's phone and scores them for 13 kinds of risk. It is small enough to run on a cheap Android phone with no internet connection, so the message never has to leave the device.

We built it for Nigerian children. It understands Nigerian English, Pidgin, Yoruba, Hausa and Igbo, including the way teenagers actually type: mixed languages, slang, no tone marks, typos.

This is our first version.

What it does

Give it one message. It returns a score for each of these 13 categories:

bullying, eating disorders, gambling, graphic content, grooming, hate speech, privacy threats, scams, self harm, sextortion, sexual content, substance use, violence.

For each category you get four numbers that add up to 1: how likely the message is at level none, low, review or high.

  • high: act now. A stranger asking a child to keep a secret and send photos.
  • review: a parent should look. A friend pushing a betting app.
  • low: worth counting, not worth an alert. A mild insult between classmates.
  • none: nothing there, even if the message uses the same words.

In the Lighthouse app we take the category with the highest level and only flag it when the chance of any risk is at least 0.8. When two categories tie, the more serious one wins, so a threat to share nudes shows as sextortion and not bullying. The order is in config.json. You can pick your own cutoff.

Size and speed

Parameters 8.3 million
keeper.onnx (int8, what we ship) 8.5 MB
keeper-fp32.onnx 33 MB
keeper.spm (word pieces) 0.6 MB
Longest input 128 word pieces, longer messages are cut
Speed under 1 ms per message on a laptop CPU

The model is a 4 layer encoder, 256 wide, with its own 20,000 piece SentencePiece vocabulary. It takes any length up to 128.

How to use it

pip install onnxruntime sentencepiece huggingface_hub numpy
python example.py "how far, wetin be your house address and which school you dey"

example.py in this repo shows the whole thing in about 30 lines: split the message with keeper.spm, put id 2 in front, run keeper.onnx, read back 13 rows of 4 numbers. The category order and level names are in config.json.

How we built it

We did not have a big labelled dataset for Nigerian languages, so we made one.

  1. We wrote a short rule sheet for each category: what counts, what doesn't, and examples of each level. The rules come from public child safety guidance and Nigerian hate speech research.
  2. We collected about 300,000 messages from public datasets and had gpt-oss-120b write about 100,000 more in Nigerian English and Pidgin.
  3. A large open safety model, gpt-oss-safeguard-20b, read every message against every rule sheet and gave a score from 0 to 3. We kept its full probabilities, not just its answer.
  4. Keeper learned to copy those scores. This is called distillation: the big model teaches, the small one learns.
  5. The first versions were weak on Yoruba and Hausa. So we had AfriqueQwen 9B write 68,000 new messages in Yoruba, Hausa and Igbo, each with an English meaning. The teacher scored the English meaning and Keeper learned that score for the original message. We also let human labels from AfriHate win over the teacher, and we read 2.4 million lines of Yoruba, Hausa, Igbo, Pidgin and English web text before training.

The final training set is about 460,000 messages. Training takes under an hour on one GPU.

How well it works

We test on 746 messages that Keeper never saw in training: real AfriHate tweets, messages from OpenAI's teen safety test pack, and messages we wrote across all five languages and all 13 categories. A message passes when Keeper puts it at the right level for its category.

Keeper 0.1
All 746 messages 80%
Risky messages caught 84%
Safe messages flagged by mistake 12%
Pidgin 87%
Igbo 81%
Yoruba 78%
English 76%
Hausa 74%
Real AfriHate tweets 74%

For comparison, the phrase word list that Lighthouse used before scores 37% on the same test and catches 22% of risky messages. The teacher model itself scores 85%.

The 557 messages we wrote are published as a test set: Prosperitytech/keeper-nigerian-safety-test. Keeper gets 84% on that part. The tweets and the OpenAI pack are not ours to republish.

Data we trained on

All of it allows commercial use. Thank you to everyone who made these public.

Models used to build it: gpt-oss-safeguard-20b and gpt-oss-120b from OpenAI (Apache 2.0), and AfriqueQwen 9B from McGill NLP (CC BY 4.0).

We are not publishing the training set itself. Parts of it are written to look like grooming and sextortion, and we don't want that text floating around on its own.

License

Apache 2.0. You can use Keeper in your own products, paid ones included. Please credit Prosperity Tech and link back here.

Contact

Prosperity Tech, makers of Lighthouse. Open an issue on this page or reach us through lighthouse on GitHub. If Keeper gets something wrong in your language, we want to hear about it.

Downloads last month
-
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Space using Prosperitytech/lighthouse-keeper 1