0
stars
1
commits
JavaScript
primary language
Apr 29, 2026
updated
Gemma 4 News is a browser-only React app for reading RSS feeds with a local Gemma model. It fetches headlines from user-configured feeds, sends a compact prompt to an in-browser WebGPU worker, and streams back either a thematic news digest or a personalized briefing. It also includes an article annotation tool that highlights selected spans in pasted article text and explains them according to user-defined criteria.
The app does not require a backend service for inference. Model loading and generation run in the browser through @huggingface/transformers using the ONNX community Gemma 4 E2B instruction model.
onnx-community/gemma-4-E2B-it-ONNX in a Web Worker and runs generation on WebGPU.localStorage, fetches feeds through CORS proxy fallbacks, and parses RSS/Atom XML in the browser.The initial model download is roughly 2 GB. After the first load, browser caching should make subsequent starts faster.
Install dependencies:
npm install
Start the Vite development server:
npm run dev
Open the local URL printed by Vite in a supported Chromium browser.
Build for production:
npm run build
Preview the production build:
npm run preview
This project is configured for Vercel with vercel.json.
npm run builddistThe Vercel config also sends the cross-origin isolation headers required by the in-browser model runtime:
Cross-Origin-Opener-Policy: same-originCross-Origin-Embedder-Policy: require-corpTo deploy from the Vercel dashboard, import the repository and keep the detected Vite settings. To deploy from the CLI:
npx vercel
src/App.jsx owns the main application state, starts the model worker, builds prompts, and routes generated output to either the news or annotation view.
src/worker.js loads the Gemma processor and model with @huggingface/transformers, performs a short warm-up generation, then handles generation requests. It posts loading, streaming, completion, interruption, and error messages back to the React app.
src/feeds.js contains the browser RSS/Atom fetching and parsing logic. Because many feeds do not send permissive CORS headers, feed requests are attempted through a small list of public CORS proxy services.
src/components/NewsPanel.jsx manages the feed list, news actions, cited model output, and source list. Feed URLs are stored under gemma-news-feeds-v1 in localStorage.
src/components/AnnotatePanel.jsx manages pasted article text, annotation criteria, raw model output when needed, and the final highlighted article rendering.
vite.config.js enables ES module workers and sends the cross-origin isolation headers required for WebGPU and high-performance browser ML execution:
Cross-Origin-Opener-Policy: same-originCross-Origin-Embedder-Policy: require-corp.
├── index.html
├── package.json
├── vite.config.js
└── src
├── App.jsx
├── feeds.js
├── main.jsx
├── styles.css
├── worker.js
└── components
├── AnnotatePanel.jsx
├── LoadProgress.jsx
└── NewsPanel.jsx
1 commits
JavaScript
71.8%
CSS
27.5%
0
stars
1
commits
JavaScript
primary language
Apr 29, 2026
updated
Gemma 4 News is a browser-only React app for reading RSS feeds with a local Gemma model. It fetches headlines from user-configured feeds, sends a compact prompt to an in-browser WebGPU worker, and streams back either a thematic news digest or a personalized briefing. It also includes an article annotation tool that highlights selected spans in pasted article text and explains them according to user-defined criteria.
The app does not require a backend service for inference. Model loading and generation run in the browser through @huggingface/transformers using the ONNX community Gemma 4 E2B instruction model.
onnx-community/gemma-4-E2B-it-ONNX in a Web Worker and runs generation on WebGPU.localStorage, fetches feeds through CORS proxy fallbacks, and parses RSS/Atom XML in the browser.The initial model download is roughly 2 GB. After the first load, browser caching should make subsequent starts faster.
Install dependencies:
npm install
Start the Vite development server:
npm run dev
Open the local URL printed by Vite in a supported Chromium browser.
Build for production:
npm run build
Preview the production build:
npm run preview
This project is configured for Vercel with vercel.json.
npm run builddistThe Vercel config also sends the cross-origin isolation headers required by the in-browser model runtime:
Cross-Origin-Opener-Policy: same-originCross-Origin-Embedder-Policy: require-corpTo deploy from the Vercel dashboard, import the repository and keep the detected Vite settings. To deploy from the CLI:
npx vercel
src/App.jsx owns the main application state, starts the model worker, builds prompts, and routes generated output to either the news or annotation view.
src/worker.js loads the Gemma processor and model with @huggingface/transformers, performs a short warm-up generation, then handles generation requests. It posts loading, streaming, completion, interruption, and error messages back to the React app.
src/feeds.js contains the browser RSS/Atom fetching and parsing logic. Because many feeds do not send permissive CORS headers, feed requests are attempted through a small list of public CORS proxy services.
src/components/NewsPanel.jsx manages the feed list, news actions, cited model output, and source list. Feed URLs are stored under gemma-news-feeds-v1 in localStorage.
src/components/AnnotatePanel.jsx manages pasted article text, annotation criteria, raw model output when needed, and the final highlighted article rendering.
vite.config.js enables ES module workers and sends the cross-origin isolation headers required for WebGPU and high-performance browser ML execution:
Cross-Origin-Opener-Policy: same-originCross-Origin-Embedder-Policy: require-corp.
├── index.html
├── package.json
├── vite.config.js
└── src
├── App.jsx
├── feeds.js
├── main.jsx
├── styles.css
├── worker.js
└── components
├── AnnotatePanel.jsx
├── LoadProgress.jsx
└── NewsPanel.jsx
1 commits
JavaScript
71.8%
CSS
27.5%