Skip to content

Adding Local AI Generation - #141

Draft
sachin-panayil wants to merge 11 commits into
mainfrom
sachin/local-ai-generation
Draft

Adding Local AI Generation#141
sachin-panayil wants to merge 11 commits into
mainfrom
sachin/local-ai-generation

Conversation

@sachin-panayil

@sachin-panayil sachin-panayil commented Sep 2, 2026

Copy link
Copy Markdown
Collaborator

Adding Local AI Generation

Problem

A chunk of the code.json fields such as long description, status, maturity tier, platforms, categories, and a few others can't be pulled from the GitHub API the way name, license, or languages can. Right now the user has to sit there and fill those in by hand which is slow.

Solution

Added a two-layer suggestion system that kicks in right after a repo URL is submitted. First, a plain rule engine (determinations.js) looks at the repo metadata and root file listing and answers what it can with simple checks. Things like "has a LICENSE and CONTRIBUTING.md" for maturity tier, or "archived flag is set" for status. Whatever's left over gets handed to a small Llama 3.2 1B model running entirely in the browser via WebLLM/WebGPU, in a Web Worker so it doesn't freeze the page. The model only ever sees a condensed README plus a short facts block, and JSON answers are grammar nconstrained against the form's schema so it physically can't return an invalid enum value. Every AI suggestion lands in a review panel first where the user can edit, uncheck, or discard it before applying. On browsers without WebGPU, the whole feature just doesn't show up and the rest of the form works exactly as before.

Result

Users on a capable browser now see an "Enhance with AI" button appear after loading a repo, which drafts the remaining empty fields and shows a review list before anything touches the actual form. The model downloads once and caches locally, with a clear progress bar, a cancel button, and a "clear cached model" option. Everything else about the existing autofill flow is unchanged.

Test Plan

  • Ran through this manually against a handful of real repos with different profiles
  • Checked the WebGPU-unsupported path (Firefox, and Chrome over a plain-HTTP LAN address) to make sure the AI button just stays hidden and the rest of the form still works.
  • Cancel mid download, cancel mid gen, clearing the cached model, and running with an incognito window

@sachin-panayil sachin-panayil self-assigned this Sep 2, 2026
Comment thread js/ai/aiContext.js Fixed
@sachin-panayil
sachin-panayil marked this pull request as draft September 9, 2026 20:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants