DEV Community

Abhishek
Abhishek

Posted on

NameLock

Hacktoberfest Open-Source AI Challenge Week 2: Side Hustle Submission 💸

This is a submission for the Hacktoberfest Open-Source AI Challenge Week 2: Side Hustle

The banner is already printed when the shop notices. The customer wrote Aadhya, with two a's, not Adya. The sheet says Adya. That sheet gets thrown away, and the shop prints it again.

A chat tool does this on its own. It "fixes" a spelling. For a flex and wedding shop, that fix is the mistake.

So I built NameLock. A local Gemma model drafts the banner line from the WhatsApp note. A plain Python check then refuses to print if one letter of a name has changed. I have not sold it, and I did not invent a shop or a first customer.

Do not print: the banner says Adya, the customer wrote Aadhya

The customer wrote Aadhya. A tool that "fixes" spellings put Adya on the banner. That is a reprint. NameLock stamps Do not print, shows the two spellings, and keeps the print button off until the letters match.

What I Built

A print-shop name proof. The shop is the customer. A reprint costs a banner. I have not sold this to anyone, and I did not invent a shop or a price.

Orders look like this:

blue flex 6 by 3, birthday, name Aadhya, with two a's, not Adya

Gemma drafts Happy Birthday Aadhya. Then a plain Python check compares every name to the customer's own words. If a letter changed, the page stamps Do not print. One click puts the customer's spelling back. The stamp turns Safe to print, and the button turns on.

The check, in order:

  1. Blocks a spelling the customer rejected ("not Adya").
  2. Blocks a name that is not in the customer's message.
  3. Blocks a name missing from the banner. A near miss (Adya for Aadhya) is named, and a repair is offered.
  4. Asks for a confirmation, not a silent merge, when a name is close to a spelling the shop already approved.

Accents count: José is not Jose. The model may arrange the line. It may not change a name.

What it will not do:

  • It will not print a changed name. Skipping the button and posting Adya straight to /api/print still returns 409 and no page.
  • It will not store the WhatsApp message. Tiger gets the approved spelling only, after a banner actually prints.
  • It will not merge a close name on its own. Priyanca after an approved Priyanka asks the shop to confirm. It does not become Priyanka.

1. The desk. One page. The four steps (Message, Draft, Lock, Print) show where the job is.

The NameLock desk

2. The customer's message. Paste the WhatsApp text, or pick a sample. The page shows size, colour and occasion as tags. On the shop laptop, Gemma reads this. In the public demo, a scripted drafter does.

The customer's message

3. The lock stops a changed name. The drafted line is Happy Birthday Adya. The customer wrote Aadhya. Print stays off.

Do not print: Adya instead of Aadhya

4. One click puts the name back. Use the customer's spelling on the banner restores Aadhya. The lock runs again. The repair is only offered if that text itself passes.

Safe to print: Aadhya restored

5. The print sheet. Proof passed, the names that were checked, and a yellow banner that fits the text. The server runs the lock a second time before it returns this page. Posting Adya straight to /api/print still gets a 409.

The print sheet

6. The shop remembers. Printed names are saved as approved spellings. The next time a message has a name that is close but not the same (Priyanca after Priyanka), the page asks. It does not merge them silently.

Demo

Live sample demo: PASTE-RENDER-URL-HERE

That page has no model. A scripted drafter builds the line. Tick Imitate a tool that fixes spellings, pick Two a's, not Adya, and draft. You should see the red stamp, then one click to green. The label on the page says it is scripted. Nothing you type is stored.

The real Gemma run stays on the shop laptop. A public page cannot call it.

Code

GitHub logo abhishekmsm51w-star / namelock

Banner name proof: Gemma drafts the line, a spelling lock blocks a changed name.

NameLock

This is a submission for the Hacktoberfest Open-Source AI Challenge Week 2: Side Hustle

One wrong letter in a name means a banner gets thrown away and printed again. NameLock lets a local open-weight model draft the banner line, then refuses to print if any name is not exactly as the customer wrote it.

What I Built

A flex-banner and wedding-card print shop gets orders as messy WhatsApp messages:

blue flex 6 by 3, birthday, name Aadhya, with two a's, not Adya

NameLock reads the message and drafts the banner (Happy Birthday Aadhya). Then a plain Python check compares every name on the banner to the customer's own words. If a letter changed, the page stamps Do not print, shows the customer's spelling next to the banner's spelling, and keeps the print button off One click puts the customer's spelling back, the stamp turns Safe to…

MIT. Two files decide whether a banner can print. namelock/lock.py is the check, and it has no model in it. namelock/book.py is the spelling book, SQLite on the laptop or Tiger Cloud when DATABASE_URL is set.

The print gate in namelock/app.py

@app.post("/api/print")
def print_page(o: Order):
    v = verify(o.note, o.names, o.banner, approved=book.names())
    if not v.printable:
        raise HTTPException(409, "Not printable: " + "; ".join(i.message for i in v.issues))
    for n in v.names:
        book.approve(n)  # a printed name is an approved spelling
    return _print_html(o.banner, v.names)
Enter fullscreen mode Exit fullscreen mode

Gemma lives in namelock/drafter.py. It asks Ollama for JSON and is never trusted. Whatever it returns goes through verify() before this gate. Sample mode, with no model, is NAMELOCK_BACKEND=demo. The run commands are in the repo README.

How I Built It

The model drafts. The lock decides. The server checks again before anything can print. On the shop laptop that drafter is Gemma through Ollama. On the public demo it is the scripted stand-in. Either way the same check runs, and a pass writes the name into approved_names.

Gemma is untrusted on purpose. gemma3:1b through Ollama returns JSON: names copied as typed, occasion, size, colour, banner line. The prompt says never respell a name. I still send every draft through lock.verify(). Swapping the model does not touch the check.

The lock is plain Python, and the tests notice if it breaks. NFC only, so José is not Jose. A possessive 's is not part of the name. An all-caps banner still matches. A repair is offered only when the repaired text itself passes the same check. 105 tests pass. I deleted the "name missing from the banner" rule on purpose and 26 tests failed, then I put the rule back.

What Gemma actually did. On 15 Oct 2026 I ran 20 invented names (Aadhya, Siobhan, José, D'souza, Mary-Anne and others) through gemma3:1b on this PC. The model did not respell any of them. It dropped 2 off the banner instead: Siobhan became a generic celebration line, and Mary-Anne became the size and colour. The lock caught both. 0 leaked. 0 false alarms. Median draft 0.4s. The first call took 61s while the model loaded.

The red stamp in the screenshots is not that Gemma run. The checkbox Imitate a tool that fixes spellings is a simulation I wrote, so a public page can show the bug without a model. The bench that catches 20 of 20 tests the lock against that simulation. It is not a score for Gemma.

Tiger stores spellings, not messages. After a banner prints, each name goes into one table on Tiger Cloud:

create table if not exists approved_names (
  key text primary key,
  name text not null
);
Enter fullscreen mode Exit fullscreen mode

Next time a note is close to an approved spelling but not the same, the lock asks. This is a plain Postgres table. It is not pgvector and it is not hybrid search.

Render hosts the sample, not the model. render.yaml is one free Python web service with NAMELOCK_BACKEND=demo. There is no DATABASE_URL on Render, so the demo book is memory and dies on restart. Real notes stay on the laptop, where Ollama listens at 127.0.0.1:11434.

GitHub Actions fails the build if a changed name can print. .github/workflows/test.yml runs pytest, then bench.py twice: once with a faithful drafter, once with the simulated autocorrect. A leak is a red build.

Where data goes.

Path Customer message Names
Shop laptop, Ollama Stays on the laptop. The model runs at 127.0.0.1:11434. Approved spellings in local SQLite, or in Tiger Cloud if DATABASE_URL is set. Names only.
Public demo on Render Sample notes. The text you type hits the Render server and is not stored. In memory. Lost on restart.

The page loads fonts from Google Fonts, so the browser contacts Google.

Not done. The 20 names are invented. There is no first user, so this post has no "what they said" section. The public demo cannot show Gemma.

The bug I actually hit

I built the lock because I expected Gemma to "fix" Aadhya into Adya, the way a chat tool does. On the real run it did not do that.

I gave gemma3:1b 20 invented names. It kept the spellings it used. It failed a different way: two names never reached the banner. Siobhan came back as a generic celebration line. Mary-Anne came back as the size and the colour. The lock stopped both. Nothing leaked, and there were no false alarms. The first call took 61 seconds while the model loaded. After that the median draft was 0.4 seconds.

The red Do not print stamp in the screenshots is not that Gemma run. The public demo has no model, so the checkbox Imitate a tool that fixes spellings is a simulation I wrote, to show the reprint bug on a page anyone can open. The 20-out-of-20 bench scores that simulation. It does not score Gemma.

Why Does Open Innovation Matter?

Three things a closed chat tool would not give this shop.

The messages stay on the counter. They hold names and phone numbers. With a local model they never leave the laptop.

There is no fee per banner. The shop prints many small jobs.

The shop can fix the behaviour, not hope for it. The bug is a hosted chat tool that "corrects" a spelling. With an open model I can pin the instructions, swap the model, and put a check after it that does not depend on the model. The lock does not care which model drafted the line.

Prize Categories

  • Best Use of Gemma. gemma3:1b through Ollama drafts every real banner. On the 20-name run it dropped Siobhan and Mary-Anne. The lock caught both. 0 leaked.
  • Best Use of Tiger Data. Printed names go into approved_names on Tiger Cloud, and a near spelling asks for confirmation. Plain table. Not vector search.
  • Best Use of Render. One free web service from render.yaml, sample notes only, no model and no database on the server. Live link is in Demo.
  • Best Use of GitHub Actions. Every push runs the tests and both 20-name benches. The build fails if a changed name could still print.

Built solo.

Top comments (0)