| Link | Description |
|---|---|
| ๐ spectrix.netlify.app | Primary deployment |
| โก spectrix-ai.vercel.app | Vercel deployment (better long streamed responses) |
| ๐ taezeem.is-a.dev/spectrix | Custom domain mirror |
โก Local-first by default. Sign in with Google to unlock cloud backup + real-time multi-device sync.
Spectrix AI is a high-performance, PWA-first AI chatbot engineered for students, developers, and power users.
Built from scratch โ zero frameworks, zero bloat โ it combines:
- ๐ค Multi-model AI routing via OpenRouter (Stepfun, Qwen, Nemotron, and more)
- โก Edge-speed backend on Cloudflare Workers with smart key rotation
- ๐งฎ Full LaTeX math rendering via KaTeX + MathJax with copy-to-clipboard
- ๐ก Offline-first architecture with IndexedDB local persistence
- ๐ค Voice I/O โ speak to it, hear it speak back
- ๐ง Persistent AI Memory โ remembers you automatically, across sessions
- ๐ Web search mode โ real-time answers via Firecrawl + OpenRouter
- ๐ผ๏ธ Image + Video generation โ
/imgand/vidcommands - ๐ Incognito mode โ zero trace, zero persistence, zero cloud
- โ๏ธ Firebase Auth + Firestore โ Google Sign-In, profile management, cloud chat backup
Short version: it cooks. consistently. ๐ฅ
| Stat | Value |
|---|---|
| ๐๏ธ Build Duration | 3+ months |
| ๐ Commits | 530+ |
| ๐ Deployments | 280+ |
| ๐ฆ Framework | None (Vanilla JS) |
| โ๏ธ Backend | Cloudflare Workers |
| ๐ฑ Architecture | Single-file PWA (index.html) |
Iteration cycle:
build โ test โ deploy โ refine โ repeat
- Real-time SSE streaming via
/chat/streamโ no waiting for full output - Legacy simulated streamer kept commented in
index.htmlas fallback reference - Animated Thinking... state appears instantly while stream is warming up
- Multi-model routing via OpenRouter โ switch models from the header
- Smart API key rotation โ maximizes uptime and handles rate limits gracefully
- Rate-limit UX โ friendly in-app message, not a dead crash
- Web search mode โ powered by Firecrawl via OpenRouter (
Ctrl+Shift+Sto toggle) - Auto-titled chats โ AI names your conversations after the first exchange
- Retry + Edit โ re-run any response or tweak your message mid-conversation
- Persistent memory across conversations โ the AI knows who you are
- Auto-extraction โ silently learns your name, preferences, goals, and tech stack
- Manual memory โ add facts yourself via the ๐ง panel
- Categorized โ personal, preference, technical, interest, context, general
- Full control โ view all memories, delete individually, or wipe clean
- Toggle on/off โ disable auto-learning anytime
- Cooldown-throttled โ extraction runs max once every 5 minutes, no spam
- Deduplication โ near-identical facts are never saved twice
- IndexedDB-powered โ 100% local, private, zero server dependency
- Voice input via Web Speech API โ tap ๐ค, speak, done
- Text-to-Speech output โ AI responses read aloud via the ๐ toggle
- TTS audio unlock โ mobile-compatible auto-unlock on first user interaction
- Voice confirmation โ audible "Voice enabled" on toggle so you know it works
- Keyboard shortcuts:
Ctrl+B/Cmd+Bโ New chatCtrl+F/Cmd+Fโ Search messages in chatCtrl+Shift+Sโ Toggle web searchCtrl+/โ Focus history search
- KaTeX + MathJax dual-engine โ renders inline
$...$, display$$...$$, and complex environments - Lazy math engine loading โ KaTeX + MathJax load only when math is detected
- Auto-rescue โ bare LaTeX commands wrapped in delimiters automatically
- Copy LaTeX button โ hover any math block to copy the raw TeX
- Code blocks โ syntax highlighting via Highlight.js, copy button, collapse toggle
- Markdown โ full support: tables, blockquotes, headings, bold, italic, lists, images
/img <prompt>โ generates images using your selected model:- Imagen 4 Ultra / Fast
- Nano Banana (Gemini Image)
- FLUX.2 Max
- GPT Image 1.5
/vid <prompt>โ generates short looping videos via ByteDance Seedance- Saved locally โ generated media persisted in IndexedDB as Blobs
- Installable PWA โ install on mobile or desktop like a native app
- Offline-ready โ service worker caches the app shell
- iOS install hint โ smart banner on Safari/iOS guides install
- Auto-update โ new service worker activates without user action
- Single-file architecture โ monolithic
index.html, no build step - Dark/light theme โ toggle anytime, persists to
localStorage - Incognito mode โ full blackout: no IndexedDB writes, no cloud sync, no memory, no profile persistence
- Chat pinning โ pin important conversations to the top
- Chat search โ fuzzy search across all history titles + message content
- In-chat message search โ highlight matching messages with
Ctrl+F - Smart auto-scroll follow โ sticks to latest while near bottom, pauses when you scroll up
- Smooth manual jump + high-FPS stream scroll โ responsive even during long streaming replies
- Export/Import โ download chats as
.mdor.json, re-import anytime - No browser popups โ clean custom modals for all alerts, confirms, and prompts
- Custom select dropdowns โ animated, keyboard-navigable, beautiful
- Google Sign-In via Firebase Auth (popup with redirect fallback)
- Real-time Firestore sync โ chats auto-mirror create/update/delete when logged in
- Fallback timer sync โ polls cloud every 30s if realtime listener is blocked
- Tombstone system โ deleted chats stay deleted across devices, no resurrection
- Profile control hub โ backup, edit name/photo, upload device picture, or sign out
- Profile injected into memory โ name remembered by the AI automatically
- Ad-blocker resilience โ falls back gracefully when Firestore is blocked by extensions
User sends message
โ
โโโ AI responds normally
โ
โโโ Background: Memory Extraction (throttled, async)
โ
โโโ Analyzes conversation for memorable user facts
โโโ Deduplicates against existing memories (80% word-overlap check)
โโโ Categorizes: personal / preference / technical / interest / context
โโโ Saves to IndexedDB โ 'memories' store
โ
โโโ Every future conversation
โ
โโโ Top 30 memories injected into system prompt
โ AI uses context naturally, without repeating it back
๐ All memories stored locally in your browser. Nothing leaves your device unless you're syncing chats โ and even then, memories never go to the cloud.
| Mode | Model | Best For |
|---|---|---|
| โก Quick | stepfun/step-3.5-flash:free |
Everyday use, fast replies |
| ๐ Smart | qwen/qwen3.6-plus:free |
Frontend dev, agentic tasks, fast + smart |
| ๐ง Reasoning | nvidia/nemotron-3-super-120b-a12b:free |
Deep reasoning, hard problems (slower) |
๐พ Model preference saved to
localStorage โ Spectrix_text_modeland persists across sessions.
User Browser
โ
โโโ PWA (Single HTML file โ HTML/CSS/Vanilla JS)
โ โโโ IndexedDB ['chats'] โ Chat history (primary source of truth)
โ โโโ IndexedDB ['memories'] โ AI Memory (persistent user context)
โ โโโ IndexedDB ['media'] โ Generated image/video blobs
โ โโโ Service Worker โ Offline caching + auto-update
โ โโโ Web Speech API โ Voice input + TTS output
โ โโโ KaTeX + MathJax โ Dual-engine math rendering
โ โโโ Firebase Auth โ Google Sign-In
| โโโ Image/Video model endpoints โ Puter.js
โ โโโ Firebase Firestore โ Cloud chat backup + real-time sync
โ
โโโ Cloudflare Workers (Edge Backend)
โโโ API key rotation
โโโ Rate limit handling
โโโ SSE stream relay (`/chat/stream`)
โโโ Request proxying
โโโ OpenRouter โ Multi-model AI routing
โโโ Stepfun 3.5 Flash (Quick)
โโโ Qwen 3.6 Plus (Smart)
โโโ Nemotron 3 Super 120B (Reasoning)
โโโ Firecrawl (Web Search)
# Option 1 โ npx serve
npx serve .
# Option 2 โ Python
python -m http.server 5500
# Option 3 โ VS Code Live Server
# Right-click index.html โ Open with Live ServerThen open:
http://127.0.0.1:5500
No build step. No
npm install. No config files. No.env. Just open and run. โก
| Layer | Tech |
|---|---|
| Frontend | HTML, CSS, Vanilla JavaScript |
| Local Storage | IndexedDB (chats + memories + media) |
| Cloud Sync | Firebase Firestore |
| Auth | Firebase Auth (Google Sign-In) |
| PWA | Service Workers + Web App Manifest |
| Voice | Web Speech API (STT + TTS) |
| Math | KaTeX + MathJax (dual-engine) |
| Markdown | Marked.js (with custom math extension) |
| Code | Highlight.js |
| Backend | Cloudflare Workers |
| AI Routing | OpenRouter |
| Web Search | Firecrawl (via OpenRouter plugins) |
| Image Gen | Imagen 4, FLUX.2, GPT Image, Gemini Image |
| Video Gen | ByteDance Seedance 1.0 |
- ๐ Students โ math rendering, clean explanations, persistent context across sessions
- ๐ป Developers โ debug code, agentic tasks, syntax-highlighted responses
- ๐ง Researchers โ web search + reasoning mode for deep-dive topics
- โก Power Users โ voice I/O, keyboard shortcuts, multi-model switching, full data control
| Interface | Math Rendering |
|---|---|
![]() |
![]() |
| โก Real-time streaming + dark mode | ๐งฎ KaTeX + MathJax + copy button |
Spectrix follows an AI-assisted engineering workflow:
Idea โ AI generates core logic
โ Manually refined & debugged
โ Performance + UX optimized
โ Edge cases hunted down
โ Deployed & iterated relentlessly
AI is the tool โ not the decision-maker. Every architectural choice, every design decision, every UX fix โ made by a human. ๐ง 530+ commits. 280+ deployments. Obsessive iteration. That's Spectrix.
- Folder/tag-based chat organization
- Cloud memory sync (opt-in)
- Custom system prompt editor
- Multi-file upload support
- Conversation branching
Muhammad Taezeem Tariq Matta
Built with AI. Refined with intent. Shipped with ๐ฅ
If Spectrix helped you โ drop a โญ on the repo. It means a lot. ๐
Not just another AI wrapper. A system built for speed, control, memory, and real-world use. โก

