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.
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.
Homepage
|
About
|
Login
|
Register
|
Doc Summarizer
|
Response
|
- PDF document uploads (parsed via
pdfjs-dist) - DOCX document uploads
- Website URL summarization
- Automatic text extraction
- Article content parsing using Mozilla Readability
- Unified document processing pipeline with mimetype-based routing
- Upstash Redis-powered caching layer
- SHA-256 content fingerprinting for document and URL deduplication
- Cache-first retrieval for previously processed content
- Automatic 1-day cache expiration via Redis TTLs
- Eliminates redundant LLM inference for identical requests
- Reduced repeated summary latency from ~8.5s to ~150ms (~98% improvement)
- Real-Time Token Streaming (Server-Sent Events / SSE)
- 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
- JWT Authentication via httpOnly cookies
- Protected API routes
- Strict payload validation using Zod schemas
- Secure password hashing with bcrypt
- Middleware-based authorization
- Custom Upstash Redis sliding window rate limiting (
@upstash/ratelimit) on auth and LLM routes
- Automated unit and integration testing suite via Jest & Supertest
- In-memory MongoDB (
mongodb-memory-server) for fast, isolated test runs - Automated test coverage for authentication flows and health checks
- One-command startup script (
start.sh) for Docker Compose - Docker Compose setup for client, server, and Redis
- AWS EC2 deployment for backend services (HTTP / HTTPS with SSL support)
- Automated CI/CD pipeline via GitHub Actions
- Centralized server source directory (
server/src/) withapp.jsandserver.jsseparation - Upstash Redis integration for intelligent summary caching and rate limiting
- SHA-256 content hashing for cache deduplication
- Cache-first retrieval strategy with automatic TTL expiration
- Local Ollama support via
host.docker.internal
- PDF export of generated summaries via jsPDF
- Markdown-to-plain-text conversion before export for clean output
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.
┌─────────────────┐
│ React Client │
└────────┬────────┘
│
▼
┌─────────────────┐
│ Express Server │
└────────┬────────┘
│
▼
┌─────────────────┐
│ Content Parsing │
└────────┬────────┘
│
▼
┌─────────────────┐
│ SHA-256 Hashing │
└────────┬────────┘
│
▼
┌─────────────────┐
│ Redis Cache │
└────┬─────────┬──┘
│Hit │Miss
▼ ▼
Summary Model Selection
│
┌───────┼───────┬───────┐
▼ ▼ ▼ ▼
Gemini GPT OSS Gemma Sarvam
│
▼
Summary
│
▼
Store in Redis
URL
│
▼
Axios
│
▼
JSDOM
│
▼
Mozilla Readability
│
▼
Article Extraction
│
▼
Selected Model
│
▼
Summary
- Axios
- JSDOM
- Mozilla Readability
- Gemini API
- Cerebras API
- Gemma 4
PDF / DOCX Upload
│
▼
Multer
│
▼
extractText()
(mimetype routing)
│
┌───┴───┐
▼ ▼
pdfjs-dist mammoth
│ │
└───┬───┘
▼
Text Extraction
│
▼
Selected Model
│
▼
Summary
- Multer
- pdfjs-dist
- mammoth
- Gemini API
- Cerebras API
- Gemma 4
- Sarvam AI
- React
- TypeScript
- Tailwind CSS
- shadcn/ui
- jsPDF
- remark-gfm & rehype-raw
- Node.js
- Express.js v5
- morgan (HTTP Logger)
- MongoDB via Mongoose
- Upstash Redis (
@upstash/redis) - Upstash Ratelimit (
@upstash/ratelimit)
- JWT
- bcrypt
- Zod
- Axios
- JSDOM
- Mozilla Readability (
@mozilla/readability) - Multer
- pdfjs-dist
- mammoth
- Jest
- Supertest
- mongodb-memory-server
- Docker & Docker Compose
- AWS EC2
- GitHub Actions
- Redis
- Gemini 2.5 Flash
- GPT OSS 120B (via Cerebras)
- Gemma 4 (via Ollama)
- Sarvam 30B
POST /api/auth/user/registerReturns 201 Created with user object and sets jwt httpOnly cookie.
POST /api/auth/user/loginPOST /api/auth/user/logoutGET /api/auth/user/checkAuthentication required. All endpoints support both standard JSON responses and real-time Server-Sent Events (SSE) streaming.
POST /api/scrape/webRequest Body
{
"url": "https://example.com/article",
"client": "gemini",
"stream": true
}client accepts:
geminicerebrasgemmasarvam
Optional: Send stream: true in JSON body or pass ?stream=true as a query parameter to enable real-time SSE token streaming (text/event-stream).
POST /api/scrape/docContent-Type
multipart/form-data
Fields
document: file.pdf or file.docx
client: gemini or cerebras or gemma or sarvam
stream: true (optional)
Optional: Include stream: true to receive a real-time SSE token stream (text/event-stream).
Layerzero/
│
├── docker-compose.yml
├── start.sh
├── README.md
│
├── client/
│ ├── Dockerfile
│ └── src/
│ ├── components/
│ ├── pages/
│ ├── context/
│ ├── layouts/
│ └── lib/
│
└── server/
├── Dockerfile
├── jest.config.js
├── src/
│ ├── app.js
│ ├── server.js
│ ├── config/
│ ├── controllers/
│ ├── middlewares/
│ ├── models/
│ ├── routes/
│ ├── services/
│ ├── utils/
│ └── validators/
└── tests/
├── setup.js
├── auth.test.js
└── health.test.jsThe backend server is deployed on an AWS EC2 instance, managed through a fully automated CI/CD pipeline using GitHub Actions. Every push to the main branch automatically builds and deploys the latest version to the server, ensuring rapid and consistent updates.
Run the convenient startup script to build and launch all services in detached mode:
./start.shOr manually using Docker Compose:
docker compose up --build -dThis 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:11434in your server.env.
Layerzero features an automated testing suite using Jest, Supertest, and an in-memory MongoDB server.
cd server
npm testgit clone https://github.com/render-TheVoid/layerzero.git
cd layerzerocd server
npm installcd client
npm installPORT=
MONGODB_URI=
OLLAMA_MODEL=
OLLAMA_BASE_URL=
GEMINI_API_KEY=
CEREBRAS_API_KEY=
SARVAM_API_KEY=
JWT_SECRET=
NODE_ENV=
CLIENT_URL=
UPSTASH_REDIS_REST_URL=
UPSTASH_REDIS_REST_TOKEN=Backend
npm run devFrontend
npm run devMost 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
- Four selectable AI models
- Real-time streaming support
- 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.
- No document history
- No persistent summary storage
- Single-document processing
- Summary history and persistence
- Multi-document summarization
- Background processing for large documents
MIT License
Built with React, Node (Express), MongoDB, Redis and a stubborn refusal to choose between cloud AI and local AI.





