Adding Local AI Generation - #141
Draft
sachin-panayil wants to merge 11 commits into
Draft
Conversation
…racter sanitization' Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
sachin-panayil
marked this pull request as draft
September 9, 2026 20:06
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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