{"id":50940609,"url":"https://github.com/paritoshk/densitygen","last_synced_at":"2026-06-17T14:02:09.742Z","repository":{"id":364658686,"uuid":"1268750193","full_name":"paritoshk/densitygen","owner":"paritoshk","description":"DensityGen — a materials-selection copilot for chip R\u0026D. Next.js web UI on live Materials Project data + a Python ALD-precursor screening engine. Claude Build Day.","archived":false,"fork":false,"pushed_at":"2026-06-13T23:42:21.000Z","size":267,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-14T00:20:39.015Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/paritoshk.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":"AGENTS.md","dco":null,"cla":null}},"created_at":"2026-06-13T22:28:54.000Z","updated_at":"2026-06-13T23:42:25.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/paritoshk/densitygen","commit_stats":null,"previous_names":["paritoshk/densitygen"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/paritoshk/densitygen","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paritoshk%2Fdensitygen","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paritoshk%2Fdensitygen/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paritoshk%2Fdensitygen/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paritoshk%2Fdensitygen/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/paritoshk","download_url":"https://codeload.github.com/paritoshk/densitygen/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paritoshk%2Fdensitygen/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34451342,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-17T02:00:05.408Z","response_time":127,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-06-17T14:02:07.517Z","updated_at":"2026-06-17T14:02:09.730Z","avatar_url":"https://github.com/paritoshk.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# DensityGen\n\n**A materials-selection copilot for chip R\u0026D.** Pick the right thin-film material — and the precursor to deposit it — for a next-generation chip in an afternoon instead of months.\n\n### Why this matters (non-technical)\n\nEvery modern chip — in your phone, in AI data centers, in defense systems — is a stack of *hundreds* of films, each only a few atoms thick, that insulate, conduct, or block. Each new chip generation forces a switch to new materials because the old ones physically stop working. Finding the replacement today takes a specialist **months** of slow, fragile physics simulations, one material at a time — and a wrong pick can blow a multi-year, multi-billion-dollar fab bet. DensityGen compresses that triage loop from weeks to seconds and reserves the expensive simulations for only the final finalists.\n\n**Who it's for:** computational materials scientists and process engineers at semiconductor fabs (Intel, TSMC, Samsung, Applied Materials), defense/aerospace R\u0026D, and the precursor-chemical suppliers (Merck, Entegris, Air Liquide) whose multi-million-dollar bets ride on the choice.\n\n---\n\n## This repo has two parts\n\n| Part | What it is | Stack | Lives in |\n| --- | --- | --- | --- |\n| **1. Web copilot UI** | The interactive demo — translate a fab spec into a ranked candidate shortlist from **live Materials Project data**, explore trade-offs, and watch surface chemistry in 3D. | Next.js 16 · React 19 · Tailwind v4 · Three.js | `app/`, `components/`, `lib/` |\n| **2. Screening engine** | The Python decision engine — a seven-axis ALD-precursor viability scorecard that escalates survivors to a real ML interatomic potential (UMA / CHGNet, hosted on Replicate) and proposes novel precursors via inverse design. | Python · fairchem/UMA · Cog/Replicate | `src/densitygen/`, `deploy/`, `web/` |\n\n---\n\n# Part 1 — Web copilot UI (Next.js)\n\nTurns the two finished design components into a deployable app wired to the **real Materials Project REST API**.\n\n### Six screens\n1. **Intake** — natural-language fab spec → DFT-queryable property targets + hard constraints + periodic search space.\n2. **Candidates** — dense, sortable table of **live MP** dielectric-oxide candidates, composite-ranked, with Pareto-front tags.\n3. **Trade-offs** — κ×E_g Pareto scatter (real κ from `e_total`), HER Sabatier volcano, constraint explorer.\n4. **Compute** — faithful simulation of an atomate2 → SLURM DFT dispatch with custodian convergence handling.\n5. **Material** — **real relaxed crystal structure** (rotatable), computed properties, band sketch, provenance.\n6. **Surface** — interactive Three.js ALD half-reaction with a hero activation-energy readout and \"Confirm with DFT →\".\n\nIf `MP_API_KEY` is missing or MP errors, the web app **silently falls back** to a bundled candidate set (flagged `CACHED`) so a live demo never fails.\n\n### Run / deploy the web UI\n```bash\necho \"MP_API_KEY=your_key_here\" \u003e .env.local   # free key: materialsproject.org/api\nnpm install \u0026\u0026 npm run dev                      # http://localhost:3000\n```\nThe MP key is server-side only and never reaches the browser. Deploys to **Vercel** — set `MP_API_KEY` in project env. See \"Deploying the web UI to Vercel\" below.\n\n---\n\n## DensityGen: ML-Accelerated ALD Precursor Screening\n\nDensityGen tells a chemist **which precursors to prioritize for a target ALD\nfilm**, fast. It runs a seven-axis viability scorecard over candidate precursor\nmolecules and ranks them, escalating only the survivors to real atomistic\nphysics (Meta FAIR's **UMA** universal interatomic potential, hosted on\nReplicate) and finally to DFT/experiment. The goal is not to replace expert\njudgment with a lookup table — it is to make the expensive candidate-triage loop\nseconds instead of weeks.\n\n\u003e **Status: built and runnable.** The repo now contains a working package,\n\u003e CLI, test suite, example requests, and Replicate/Cog deploy specs. (The\n\u003e earlier plan is preserved in `PLAN.md`.)\n\n### Which AI model does the simulation\n\n**Primary: Meta FAIR UMA (`uma-s-1p2`) via `fairchem-core` v2.** It is the SOTA\nuniversal ML interatomic potential — energies/forces on any structure in\nseconds on one GPU, replacing DFT runs that take hours-to-days on a\nsupercomputer. One model, three task heads we map onto ALD questions:\n\n| UMA task head | Computes | ALD question |\n|---|---|---|\n| `oc20` | adsorption energy on a slab | Does it chemisorb? Is it self-limiting? |\n| `omol` | molecular / ligand energetics | Stability, ligand-bond strength, clean removal |\n| `omat` | bulk/surface formation energy | Is the film/byproduct thermodynamically favorable? |\n\n**Backend chain (auto-selected by `get_backend()`):**\n\n1. **Local UMA** (`fairchem-core`, `uma-s-1p2`) — preferred. *Gated on\n   HuggingFace*: needs an `HF_TOKEN` that has been granted access to\n   `facebook/UMA`. The pipeline is verified to run right up to that wall (builds\n   ASE structures, loads fairchem, attempts the gated weight download).\n2. **Hosted UMA on Replicate** — the Cog model in `deploy/uma/` (set\n   `DENSITYGEN_UMA_MODEL`).\n3. **CHGNet** (ungated, ships its own weights) — the backend that **actually\n   runs in this environment today** and produces real energies offline\n   (e.g. WF₆ = −43.47 eV, MoF₆ = −40.07 eV). It is a *materials* potential, so\n   it is trustworthy for slabs/bulk and a labeled *proxy* for isolated precursor\n   molecules — never overclaimed.\n4. **Descriptor scorer** (no ML) — always-available fallback so the tool works\n   with zero heavy deps.\n\nSo UMA is the configured primary; because its weights are gated, an **ungated\nuniversal MLIP (CHGNet)** computes the real numbers here, on the exact same\n`ase.Atoms` interface. Swapping in UMA is a token-access change, not a code\nchange.\n\n**Key finding:** *nothing chemistry-related is pre-hosted on Replicate* — its\ncatalog is media/LLM generation only. \"Best model on Replicate\" therefore means\n**we deploy UMA ourselves via Cog** (`deploy/uma/`).\n\n### Quickstart\n\n```bash\npip install -e .                      # core: pydantic + numpy; runs immediately\nald-screen demo                       # the WF6 -\u003e W headline case\nald-screen recipes                    # the known-good calibration set\nald-screen run examples/wf6_w.json    # full ranked scorecard\n\n## Inverse design: PROPOSE novel precursors you never listed\nald-screen design --film W --co-reactant B2H6 --temperature-max-c 350\n\n## Interconnect demo: screen materials that have precursors, design ones that don't\nald-screen interconnects\n\n## Real ML-potential energies (UMA if you have access, else CHGNet fallback):\npip install -e .[ml]                  # fairchem-core + ase + chgnet\nald-screen demo --uma\nald-screen interconnects --uma\n```\n\n#### Real ML-potential compute (verified)\n\n`--uma` runs an actual interatomic potential. UMA needs HuggingFace access to\n`facebook/UMA`; without it the tool auto-falls-back to **CHGNet** (ungated) and\nstill computes real energies — e.g. `ald-screen demo --uma` returns WF₆'s real\nmolecular energy (−43.47 eV) and a real adsorption energy on a W slab, each axis\ntagged `✓ measured` (UMA) or `~ estimated` (proxy MLIP).\n\nPython API:\n\n```python\nfrom densitygen import screen, ScreeningRequest, Candidate\n\nresp = screen(ScreeningRequest(\n    film=\"W\", co_reactant=\"B2H6\", temperature_max_c=350,\n    candidates=[Candidate(name=\"WF6\"), Candidate(name=\"WCl6\", formula=\"WCl6\")],\n))\nprint(resp.ranked_candidates[0].name, resp.ranked_candidates[0].overall_score)\n```\n\n### The scorecard\n\nEvery candidate gets seven components, each with an **evidence string** and a\n**confidence tag** (`✓ measured` / `~ estimated` / `? unknown`), plus hard gates:\n\n- `delivery` — volatility / can it be delivered as vapor\n- `thermal_window` — survives the line and has a self-limiting window at the cap\n- `surface_reactivity` — chemisorbs / exchanges on the target surface (UMA `oc20`)\n- `self_limiting` — steric saturation stops growth after one layer\n- `clean_ligand` — carbon / halide residue risk\n- `byproduct` — benign vs. etching/corrosive (e.g. HF from fluorides)\n- `integration` — **hard gates**: must contain the film element; honors\n  `forbidden_elements`\n\nA precursor that cannot deliver the film's payload element **hard-fails to 0** —\nno amount of volatility saves a molecule with no tungsten in it. Each candidate\nends with a `recommended_next_step` that enforces the escalation ladder\n(descriptor → UMA → DFT → experiment).\n\n#### Calibration against known recipes\n\nThe tool is validated against literature ALD systems (the regression set in\n`tests/test_screen.py`): WF6→W, TMA→Al2O3, TEMAH/HfCl4→HfO2, TiCl4/TDMAT→TiN.\n`ald-screen demo` shows WF6 ranking #1 for tungsten while honestly flagging its\nHF-byproduct weakness — the real-world integration headache.\n\n### Inverse design — proposing precursors that don't exist yet\n\n`ald-screen design --film \u003cX\u003e` doesn't screen a list you provide — it\n*generates* one. It combinatorially assembles the film's metal with a curated\nligand library (halides, alkyls, alkylamides, alkoxides, hydride, carbonyl, plus\nheteroleptic mixes), scores every proposal with the same scorecard, and ranks\nthem. Cheap descriptors triage the whole combinatorial set; UMA confirms only\nthe top survivors (the escalation ladder). As a built-in sanity check, the loop\nre-derives WF₆ for tungsten and flags it ★ — evidence the search space is sane.\n\n### Interconnect-resistance demo (`ald-screen interconnects`)\n\nThe end-to-end demonstration on a real frontier problem — replacing Cu/W in\nscaled interconnects, where resistivity explodes from electron scattering. Two\nbuckets:\n\n- **Bucket A — materials that have precursors** (Ru, Mo, Co): screened\n  end-to-end with real candidate precursors (Ru(EtCp)₂, MoO₂Cl₂, CoCp₂, …). This\n  exercises the full flow on known chemistry.\n- **Bucket B — materials with no mature ALD precursor** (NbP, MoP, CoSi, NbAs —\n  topological semimetals / intermetallics): the inverse-design loop *proposes*\n  precursors and produces ranked results where no recipe exists.\n\n### Deploying the UMA model to Replicate\n\n```bash\ncd deploy/uma\ncog login\ncog push r8.im/\u003cyour-username\u003e/uma-ald          # GPU image, fairchem + UMA\n```\n\nUMA weights are gated on HuggingFace, so set `HF_TOKEN` as a **Replicate\nsecret** (the predictor downloads weights at cold start, not at build time — the\nbuild env has no secrets and baking gated weights in violates the HF license).\nThen point the screener at it:\n\n```bash\nexport DENSITYGEN_UMA_MODEL=\u003cyour-username\u003e/uma-ald\nald-screen run examples/wf6_w.json --uma\n```\n\nThe screener API itself can also be hosted (CPU) via `deploy/screener/` so\nagents/UIs can POST candidates and get back the ranked JSON.\n\n### Architecture\n\n```\ncandidates ─▶ chem.py        formula/SMILES ─▶ composition + descriptors\n           ─▶ data/          curated precursor / film / recipe ground truth\n           ─▶ scoring.py     7 score components + hard gates\n           ─▶ compute.py     UMA-on-Replicate energies (oc20/omol/omat)  ◀─ optional\n           ─▶ screen.py      orchestrate ─▶ ranked scorecard\n           ─▶ reporting.py   text report + CSV   |  cli.py  |  deploy/*  (Cog)\n```\n\nThe seam that matters: `compute.py` (physics) is fully decoupled from\n`scoring.py` (ALD logic), so the same screener runs on free descriptors today\nand transparently upgrades to real UMA energies once the Cog model is live.\n\n### What this does *not* claim\n\n- ML potentials can be wrong on exotic organometallics, charged species, and\n  transition states — every score carries provenance and an uncertainty tag.\n- Volatility, shelf life, cost, and safety need chemical knowledge beyond\n  atomistic energies; the tool flags `unknown` instead of inventing numbers.\n- A good screen's job is to know what it does not know and say so.\n\nSee `SAMPLE_QUERIES.md` for the chemist questions this is built to answer, and\n`PLAN.md` for the original phased plan and references.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fparitoshk%2Fdensitygen","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fparitoshk%2Fdensitygen","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fparitoshk%2Fdensitygen/lists"}