Downloads · 30 days
0
Ansaribilal/momo-1.0
momo-1.0 is a text generation model from Ansaribilal. Use it when you need the model to write or continue text. It is set up for peft. The card lists the license as apache-2.0.
Momo 1.0 is a tiny, fast, fully self-contained decision model. Whatever the user says, Momo decides everything by itself — what to remember, what to update, what to forget, what to search in personal memory, what to s…
Downloads · 30 days
0
Access
Public
Updated Sep 4, 2026
Repo size
—
Likes
0
Public
Click a slice to open those files.
.jsonl4.4 MB · 97%
From the Hugging Face model README
Momo 1.0 is a tiny, fast, fully self-contained decision model. Whatever the user says, Momo decides everything by itself — what to remember, what to update, what to forget, what to search in personal memory, what to search on Google, and what to anonymize before it ever leaves the device. There are no agents.md files, no skills folders, no LangChain agents — every decision comes from the model weights.
momo-1.0Qwen/Qwen2-0.5B-Instruct + LoRA adapter (r=32, α=64, all attention+MLP projections)data/brain.jsonl — 3,000 rows of decision supervisionBAAI/bge-small-en-v1.5Momo receives one user message and replies with exactly one JSON object:
{
"action": "STORE_MEMORY|UPDATE_MEMORY|DELETE_MEMORY|MEMORY_ONLY|WEB_ONLY|HYBRID",
"memory_query": "",
"web_query": "",
"need_memory_search": false,
"need_web": false,
"memory_text": ""
}
| Action | Meaning | Pipeline effect |
|---|---|---|
STORE_MEMORY | user shares a new personal fact | memory_text is saved to memory |
UPDATE_MEMORY | correction / changed fact | memory searched by memory_query, old record replaced by memory_text |
DELETE_MEMORY | "forget that…" | memory searched by memory_query, matched records deleted |
MEMORY_ONLY | question about the user's own life | memory searched with memory_query, answered from memory (Source of Truth) |
WEB_ONLY | general / world / external question | Google (Serper) searched with web_query |
HYBRID | personal + world mix (or save + search) | memory and web paths both run; may also store memory_text |
Special MEMORY_ONLY with empty queries/flags = pure chit-chat (no retrieval needed).
Memory is the Source of Truth; Google search is extra. Momo is trained to strip all
private details — names of people in the user's life, phone numbers, emails, IDs — from
web_query before anything is sent to Google:
"My girlfriend Sarah loves hiking — gift ideas for her birthday?" →
memory_query: "Sarah gift preferences and interests"(stays local) →web_query: "birthday gift ideas for girlfriend"(anonymized)
app.py adds a second, regex-based safety net (anonymize_web_query) that scrubs any
leak before the Serper call. City names are kept only when the query is location-dependent
(e.g. weather), which carries no personal identity.
momo-1.0/
├── data/brain.jsonl # 3,000-row decision-training dataset
├── train.py # LoRA training (T4-friendly)
├── test.py # local test battery + PII-leak checks + latency
├── app.py # FastAPI / Lightning App: decide → search → answer
├── momo_core.py # single source of truth: prompt, schema, parser, validator
├── scripts/
│ ├── generate_brain_data.py # regenerates data/brain.jsonl (seed=42)
│ ├── validate_brain_data.py # dataset schema + anonymization validator
│ └── setup_git.sh # git init → GitHub repo → push → set HF_TOKEN secret
├── .github/workflows/push-to-hf.yml # mirrors every push to HF: Ansaribilal/momo-1.0
├── requirements.txt
└── README.md
data/brain.jsonl3,000 rows in chat format (system → compact Momo contract, user → message,
assistant → canonical JSON decision). Distribution:
| Action | Rows | Examples |
|---|---|---|
STORE_MEMORY | 700 | "Remember that my favorite food is sushi." |
UPDATE_MEMORY | 500 | "I moved from Pune to Bangalore, update my city." |
DELETE_MEMORY | 450 | "Forget my old phone number." |
MEMORY_ONLY | 560 | "What's my favorite food?" (+ chit-chat rows) |
WEB_ONLY | 460 | "Is the Pixel 8 worth buying?" (+ anonymization-heavy rows) |
HYBRID | 330 | "My boss Priya said keto is bad — is that true?" |
Every row passed scripts/validate_brain_data.py: schema validity, flag consistency,
and a hard PII-leak scan proving no private name ever appears in a web_query.
Runs on a T4 (16 GB) in ~10 minutes, costing well under the 15 credits/month budget. Loss is computed only on the assistant JSON (prefix masking), fp16, cosine LR, 3 epochs, batch 8 × grad-accum 2, LR 2e-4.
pip install -r requirements.txt
python train.py # → ./adapter (LoRA weights + tokenizer + meta)
python train.py --push Ansaribilal/momo-1.0 # optionally push adapter to HF
python test.py --mock # logic-only: parser + validator round-trips (no model)
python test.py # full battery: 16 cases, action accuracy, PII checks, latency
export SERPER_API_KEY=... # google.serper.dev
export HF_TOKEN=... # to pull the adapter from HF (or keep ./adapter local)
python app.py # FastAPI on :8000 (also runs in a Lightning Studio)
lightning run app app.py # Lightning App mode
| Endpoint | Purpose |
|---|---|
POST /decide | fast path: text → Momo JSON decision only |
POST /chat | full pipeline: decision → memory ops → memory search (bge-small) → Serper → final answer |
GET /health | status, device, avg decision latency, web enabled |
curl -s localhost:8000/chat -H 'Content-Type: application/json' \
-d '{"text":"My girlfriend Sarah loves hiking - gift ideas for her birthday?","user_id":"bilal"}'
Response includes the decision, the anonymized web_query_sent, memory hits with
relevance scores, memory ops performed, and per-stage timings (memory_filter ms).
scripts/setup_git.sh — creates the GitHub repo, pushes, and uploads the HF_TOKEN
Actions secret automatically..github/workflows/push-to-hf.yml — on every push to main, mirrors the entire repo
(code, dataset, trained adapter) to https://huggingface.co/Ansaribilal/momo-1.0.momo_core.parse_decision repairs minor slips and falls back to a safe memory search.LocalJSONMemory is a fallback —
plug Babymomo's production memory backend via get_backend().