Skip to content

render-TheVoid/layerzero

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

47 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LayerZero

AI-powered content summarization platform built with React, Express.js, MongoDB, and a hybrid LLM architecture.

LayerZero allows users to summarize PDFs, DOCX files, and web content using cloud-based or locally hosted language models. The platform focuses on simplicity, speed, and flexibility while providing a secure authentication layer and a clean content-processing pipeline.


Overview

Most content summarization tools force users into a single AI provider.

LayerZero takes a different approach.

Users can choose between:

  • Gemini 2.5 Flash for powerful cloud-based inference
  • GPT OSS 120B via Cerebras for fast, open-source cloud inference
  • Gemma 4 via Ollama for local inference and privacy-focused workflows*
  • Sarvam 30B for Hinglish and multilingual conversational workflows*

Whether you're summarizing a research paper, technical documentation, blog post, or an article you definitely intended to read later, LayerZero extracts the content and generates concise summaries within seconds.


Screenshots

Homepage
About
Login
Register
URL Summarizer
Response

Features

Content Ingestion

  • PDF document uploads
  • DOCX document uploads
  • Website URL summarization
  • Automatic text extraction
  • Article content parsing using Mozilla Readability
  • Unified document processing pipeline with mimetype-based routing

AI-Powered Summarization

  • Gemini 2.5 Flash integration
  • GPT OSS 120B integration via Cerebras
  • Gemma 4 integration via Ollama
  • Sarvam 30B integration
  • Four user-selectable AI models
  • Hybrid cloud/local architecture
  • Flexible inference workflows
  • Hinglish-friendly and multilingual support via Sarvam

Authentication & Security

  • JWT Authentication via httpOnly cookies
  • Protected API routes
  • Secure password hashing with bcrypt
  • Middleware-based authorization
  • Rate limiting on auth and LLM routes via express-rate-limit

Infrastructure

  • Docker Compose setup for client, server, and Redis
  • Separate Dockerfiles for frontend and backend
  • Redis-ready architecture for caching
  • Local Ollama support via host.docker.internal

Export

  • PDF export of generated summaries via jsPDF
  • Markdown-to-plain-text conversion before export for clean output

Multilingual Support

LayerZero includes Sarvam 30B support for Hinglish and multilingual interactions.

This enables more natural summarization and conversational workflows for users who frequently switch between English and Indian languages, while maintaining the same unified processing pipeline used across all supported models.


Architecture

┌─────────────────┐
│   React Client  │
└────────┬────────┘
         │
         ▼
┌─────────────────┐
│  Express Server │
└────────┬────────┘
         │
         ▼
┌─────────────────┐
│ Content Parsing │
└────────┬────────┘
         │
         ▼
┌─────────────────┐
│  Model Selection  │
└────────┬────────┘
          │
   ┌─────┼─────┬──────┐
   ▼     ▼     ▼       ▼
Gemini  GPT  Gemma   Sarvam
Cloud   OSS   Local  Cloud
   │     │      │      │
   └─────┴──────┴─────┘
         ▼
      Summary

Website Summarization Flow

URL
 │
 ▼
Axios
 │
 ▼
JSDOM
 │
 ▼
Mozilla Readability
 │
 ▼
Article Extraction
 │
 ▼
Selected Model
 │
 ▼
Summary

Technologies Used

  • Axios
  • JSDOM
  • Mozilla Readability
  • Gemini API
  • Cerebras API
  • Gemma 4

Document Summarization Flow

PDF / DOCX Upload
       │
       ▼
    Multer
       │
       ▼
  extractText()
  (mimetype routing)
       │
   ┌───┴───┐
   ▼       ▼
pdf-parse mammoth
   │       │
   └───┬───┘
       ▼
 Text Extraction
       │
       ▼
 Selected Model
       │
       ▼
   Summary

Technologies Used

  • Multer
  • pdf-parse
  • mammoth
  • Gemini API
  • Cerebras API
  • Gemma 4

Tech Stack

Frontend

  • React
  • TypeScript
  • Tailwind CSS
  • shadcn/ui
  • jsPDF

Backend

  • Node.js
  • Express.js

Database

  • MongoDB

Authentication

  • JWT
  • bcrypt

Content Processing

  • Axios
  • JSDOM
  • Mozilla Readability
  • Multer
  • pdf-parse
  • mammoth

Infrastructure

  • Docker
  • Docker Compose
  • Redis
  • express-rate-limit

AI Models

  • Gemini 2.5 Flash
  • GPT OSS 120B (via Cerebras)
  • Gemma 4 (via Ollama)
  • Sarvam 30B

API Endpoints

Authentication

Register

POST /api/auth/user/register

Login

POST /api/auth/user/login

Logout

POST /api/auth/user/logout

Check Authentication

GET /api/auth/user/check

Protected Routes

Authentication required.

Website Summarization

POST /api/scrape/web

Request Body

{
  "url": "https://example.com/article",
  "client": "gemini"
}

client accepts:

  • gemini
  • cerebras
  • gemma
  • sarvam

Document Summarization (PDF / DOCX)

POST /api/scrape/doc

Content-Type

multipart/form-data

Fields

document: file.pdf or file.docx
client: gemini or cerebras or gemma or sarvam

Project Structure

LayerZero/
│
├── docker-compose.yml
│
├── client/
│   ├── Dockerfile
│   └── src/
│       ├── components/
│       ├── pages/
│       ├── context/
│       ├── layouts/
│       └── lib/
│
├── server/
│   ├── Dockerfile
│   ├── app.js
│   ├── controllers/
│   ├── middlewares/
│   ├── routes/
│   ├── models/
│   ├── services/
│   └── config/
│
└── README.md

Running with Docker

docker-compose up --build

This starts the client, server, and Redis containers together.

To use Gemma locally inside Docker, ensure Ollama is running on your host machine and set OLLAMA_BASE_URL=http://host.docker.internal:11434 in your server .env.


Running Locally (without Docker)

Clone Repository

git clone https://github.com/render-TheVoid/layerzero.git
cd layerzero

Install Backend Dependencies

cd server
npm install

Install Frontend Dependencies

cd client
npm install

Configure Environment Variables

PORT=3000
MONGODB_URI=
JWT_SECRET=
GEMINI_API_KEY=
CEREBRAS_API_KEY=
OLLAMA_BASE_URL=http://localhost:11434
OLLAMA_MODEL=
NODE_ENV=development

Run Development Servers

Backend

npm run dev

Frontend

npm run dev

Why LayerZero?

Most summarization platforms rely entirely on cloud-hosted AI.

LayerZero combines cloud and local inference, giving users more control over privacy, performance, and operational costs.

Benefits include:

  • Reduced API dependency
  • Local AI execution
  • Three selectable AI models
  • Improved privacy via local inference
  • Hybrid cloud/local architecture

Because sometimes you want the power of a cloud model, and sometimes you want your laptop to suffer instead.


Current Limitations

  • No document history
  • No persistent summary storage
  • Single-document processing

Coming Soon

  • Redis caching for repeated requests
  • Streaming responses
  • Summary history and persistence
  • Multi-document summarization

License

MIT License


Built with React, Express, MongoDB, and a stubborn refusal to choose between cloud AI and local AI.

About

Hybrid AI-powered document summarization platform with PDF/DOCX/URL ingestion, multi-model routing (Gemini 2.5 Flash, GPT OSS 120B, Gemma 4, and Sarvam 30B), secure JWT authentication, rate limiting, and containerized deployment via Docker Compose. Built with React, TypeScript, Express.js, and MongoDB.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors