DEV Community

Megh Shah
Megh Shah

Posted on

I Built SnoozeOps: An Open-Source AI Data Janitor That Does the Boring Spreadsheet Work

Hacktoberfest Open-Source AI Challenge Week 3: Slow and Steady Submission πŸ¦₯

This is a submission for the Hacktoberfest Open-Source AI Challenge: Week 3 β€” Slow and Steady

I Built SnoozeOps: An Open-Source AI Data Janitor That Does the Boring Spreadsheet Work

"You snooze. Your data gets cleaned."


1. The Problem: The Agony of Spreadsheet Inspection

Nobody got into software engineering or data analysis because they dreamed of squinting at 5,000 spreadsheet rows looking for broken formulas, decimal slips, and negative customer tenures.

Yet every week, millions of developers and analysts open CSV files and perform the same soul-draining manual inspection:

  • Did someone key in an order total as $1,499.00 for a USB cable that costs $14.99?
  • Did an offshore data entry clerk enter negative age (-28) or future signup timestamps (2029-11-14)?
  • Did an Excel formula break silently, outputting a mismatch between unit price, quantity, and total revenue?
  • Did an enterprise customer get assigned an NPS score of 15 when the scale strictly tops out at 10?

Missing these issues is embarrassingly easy for human eyes after 20 minutes of scrolling. But letting bad data slip into production downstream destroys analytics dashboards, corrupts machine learning training sets, and triggers costly billing reconciliations.

October 20 is International Sloth Day, celebrating animals that conserve their energy and refuse to do unnecessary manual labor. That was the spark: what if an open-weight AI agent could do the tedious inspection work while you take a nap, and hand you a clean, reviewable dataset with a cryptographic audit trail when you wake up?

That is SnoozeOps.


2. What I Built

SnoozeOps is an open-source, local-first AI data janitor that automates spreadsheet inspection. It is not another generic chatbot where you paste a table into a prompt window; it is a dedicated developer tool that:

  1. Profiles Your Data: Automatically computes column types, null rates, statistical moments (mean, std, median, IQR), and distribution histograms.
  2. Detects Suspicious Flaws Multi-Tiered: Runs Median Absolute Deviation (MAD) Z-score, Tukey fences, decimal slip heuristics, domain boundary checks, Levenshtein categorical typo detection, and Prior Labs' TabPFN tabular foundation model.
  3. Explains with Open-Weight Gemma: Generates clear, grounded explanations and proposes safe, typed correctionsβ€”backed by an explicit, transparent deterministic fallback.
  4. Empowers Human Review: Gives engineers a clean grid interface to approve, edit, or reject proposed fixes before a single byte of data changes.
  5. Preserves Provenance with SHA-256: Leaves raw data untouched, exports a clean CSV, and generates an itemized Markdown audit trail with cryptographic signatures.

3. Try It Yourself

You can load built-in sample datasets (E-Commerce Retail, Clinical Health, SaaS Metrics, or the Seeded Benchmark) with one click, or drag and drop any CSV file from your computer.


4. How It Works: Architecture & Data Flow

SnoozeOps separates statistical anomaly detection, neural tabular residual prediction, and natural-language explanation into dedicated, decoupled components:

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                   Next.js 14 Frontend                  β”‚
β”‚       Spreadsheet Grid β€’ Anomaly Review β€’ Settings     β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                            β”‚ REST JSON API
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                    FastAPI Backend                     β”‚
β”‚                                                        β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
β”‚  β”‚ Column Profiler  β”‚    β”‚  Statistical Detectors    β”‚ β”‚
β”‚  β”‚ (Stats & Bins)   β”‚    β”‚  (MAD, Tukey, Slip, Typos)β”‚ β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
β”‚           β”‚                            β”‚               β”‚
β”‚           β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜               β”‚
β”‚                          β”‚                             β”‚
β”‚       β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”          β”‚
β”‚       β”‚ TabPFN Tabular Prediction Engine    β”‚          β”‚
β”‚       β”‚ (Prior Labs TabPFN / IsoForest)     β”‚          β”‚
β”‚       β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜          β”‚
β”‚                          β”‚                             β”‚
β”‚       β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”          β”‚
β”‚       β”‚ LLM Janitor & Deterministic Engine  β”‚          β”‚
β”‚       β”‚ (Open-Weight Gemma 2 / Rule Fallbackβ”‚          β”‚
β”‚       β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜          β”‚
β”‚                          β”‚                             β”‚
β”‚       β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”          β”‚
β”‚       β”‚ Audit Engine & Cryptographic Signer β”‚          β”‚
β”‚       β”‚ (Raw Preservation & SHA-256 Hashes) β”‚          β”‚
β”‚       β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜          β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
Enter fullscreen mode Exit fullscreen mode

The Component Breakdown:

  1. Next.js 14 Frontend: Built with TypeScript, Tailwind CSS, and Lucide icons. Uses a forest-green and warm-cream palette inspired by developer tools like Linear and Supabase. Includes an interactive spreadsheet grid that highlights anomalous cells with live tooltips.
  2. FastAPI Engine (backend/): High-performance asynchronous Python backend with NumPy and Pandas.
  3. Statistical Engine (backend/detectors/statistical.py): Computes non-parametric Tukey fences ($Q_1 - 1.5 \times \text{IQR}$) and MAD Z-scores ($0.6745 \times \frac{|x - \text{median}|}{\text{MAD}}$) to remain resilient against extreme outliers that fool standard deviation tests.
  4. TabPFN Residual Detector (backend/detectors/tabpfn_detector.py): Prior Labs' TabPFN tabular foundation model fits a prior-data fitted network across numeric dimensions to evaluate multivariate conditional residuals ($>3.0\sigma$).
  5. Gemma Reasoning Engine (backend/llm_janitor.py): Synthesizes grounded natural-language explanations and safe corrections using Google's open-weight Gemma 2 (gemma2:2b or gemma2-9b-it).
  6. Audit & Cryptographic Signer (backend/audit.py): Applies approved transformations to a working copy, calculates input/output SHA-256 hashes, and records itemized provenance logs.

5. Key Engineering Decisions

Decision 1: Never Fake Model Inference

Too many AI demos hardcode fake LLM responses in the frontend. SnoozeOps takes a transparent architectural stance:

  • If a live Gemma model is configured (via local Ollama, Groq, or Hugging Face), it makes live structured-output calls.
  • If no model is configured or if the model service fails, SnoozeOps transparently falls back to a deterministic rules engine.
  • Every single anomaly card explicitly displays its engine origin: e.g., Engine: Gemma 2 (Live) or Engine: Deterministic Janitor Engine (Verified Fallback).
# From backend/llm_janitor.py
if self.provider in ["ollama", "groq", "huggingface"] and (self.provider == "ollama" or self.api_key):
    try:
        enhanced, meta = await self._call_gemma_model(anomalies, df_context)
        return enhanced, meta
    except Exception as e:
        enhanced, meta = self._deterministic_fallback(anomalies)
        meta["is_fallback"] = True
        meta["fallback_reason"] = f"Model '{self.model}' unavailable: {str(e)[:150]}. Used deterministic janitor."
        return enhanced, meta
Enter fullscreen mode Exit fullscreen mode

Decision 2: Decoupling Heuristics from Language Models

Language models are notoriously bad at basic floating-point arithmetic and computing column percentiles across thousands of numbers. Asking an LLM "Find the 99th percentile outlier in this 20,000-row column" is expensive, slow, and unreliable.

Instead, SnoozeOps uses Python and NumPy for high-speed statistical bounds and TabPFN for tabular regression. Gemma is used for what it excels at: grounded causal reasoning and semantic formatting (e.g., explaining why a decimal was shifted and providing human-readable context).

Decision 3: Sub-Millisecond Lazy Loading for TabPFN

TabPFN is a powerful foundation model for tabular data, but eagerly importing PyTorch and neural network weights on application startup adds 3–5 seconds of cold-start latency.

In backend/detectors/tabpfn_detector.py, I implemented lazy evaluation:

_tabpfn_module = None
_tabpfn_attempted = False

def _get_tabpfn():
    global _tabpfn_module, _tabpfn_attempted
    if not _tabpfn_attempted:
        _tabpfn_attempted = True
        try:
            from tabpfn import TabPFNRegressor
            _tabpfn_module = TabPFNRegressor
        except Exception:
            _tabpfn_module = None
    return _tabpfn_module
Enter fullscreen mode Exit fullscreen mode

This ensures standard statistical analysis and API health checks start in under 5 milliseconds.


6. Why Open Innovation Matters

Building SnoozeOps around open-weight models and open-source tooling is not just an aesthetic choice; it fundamentally alters the software economics and privacy guarantees:

  1. Zero Data Egress & Total Privacy: Spreadsheets often hold sensitive financial ledgers, customer emails, patient vital statistics, and private revenue metrics. Sending full CSVs to proprietary cloud APIs is an immediate compliance violation for HIPAA, GDPR, or SOC2. Because Gemma and TabPFN run locally or within your own virtual private cloud, data never leaves the host boundary.
  2. Zero Marginal Inference Cost: Cleaning 100,000 spreadsheet rows through proprietary cloud APIs creates unpredictable token charges that scale linearly with dataset volume. With open-weight models, running 1,000 cleaning sweeps costs exactly $0 in API fees.
  3. No Vendor Lock-In: If a proprietary provider changes pricing, deprecates an endpoint, or alters terms of service, an enterprise data pipeline breaks. Open-weight models guarantee long-term stability and reproducibility.

7. The Lazy Payoff: Measured Results & Benchmark

To prove that SnoozeOps delivers measurable results rather than hand-wavy marketing, the repository includes a seeded 100-row ground-truth evaluation dataset (backend/data/ground_truth_test_data.csv) containing 20 pre-labeled real-world anomalies.

Anyone can run the live benchmark directly in the UI or via Python:

python -c "import urllib.request, json; print(json.loads(urllib.request.urlopen('http://127.0.0.1:8000/api/evaluate').read())['evaluation']['comparison'])"
Enter fullscreen mode Exit fullscreen mode

Reproducible Benchmark Results:

Metric Naive 3-Sigma Z-Score Baseline SnoozeOps Hybrid AI Janitor Gain
Anomaly Recall 35.0% (Missed 13 of 20) 100.0% (Caught 20 of 20) +65.0% Recall
Precision 100.0% 100.0% Zero degradation
False Positives 0 0 Clean baseline
F1 Score 0.52 1.00 +0.48 F1
Runtime Latency 2.1 ms 320.4 ms Sub-second

Why Did Naive 3-Sigma Miss 65% of Anomalies?

Standard $3\sigma$ standard deviation baselines only catch astronomical numerical spikes. They are completely blind to:

  • Accidental negative values in strictly non-negative columns (e.g., negative customer tenure -8 months).
  • Decimal shift errors on lower-tier items (e.g., a $12 item keyed as $120 still falls within a $500 column standard deviation).
  • Domain boundary breaches (e.g., NPS score of 15 where valid range is 0–10).
  • Formula mismatches (e.g., unit price $\times$ quantity $\neq$ total amount).
  • Temporal typos (e.g., signups recorded in the year 2029).

SnoozeOps caught every single one of these subtle corruptions in 320 milliseconds without a single false positive.


8. What I Learned & What Remains

Lessons Learned:

  • Free Tier Memory Limits Are Real: When containerizing Ollama with gemma2:2b (a 1.6GB GGUF model) on Render's Free Tier, Linux's Out-Of-Memory (OOM) killer immediately terminates the container because Free Tier caps instances at 512MB RAM. Transparently supporting Groq's free cloud Gemma API alongside local Ollama proved essential for users running lightweight infra.
  • Pandas NaN Breaks FastAPI JSON: Standard Python json.dumps throws ValueError: Out of range float values are not JSON compliant when a DataFrame contains IEEE NaN floats. Sanitizing DataFrames to object dtype with .where(pd.notnull(df), None) was critical for rock-solid stability.

What Remains:

  • Multi-File Foreign Key Consistency: SnoozeOps currently inspects single tabular spreadsheets. Future iterations will support foreign-key cross-table validation (e.g., checking that customer_id in orders exists in customers).
  • Streaming Ingestion: Adding chunked streaming for datasets exceeding 1,000,000 rows.

9. Under the Hood: Technology Stack & Setup

  • Frontend: Next.js 14, React 18, TypeScript, Tailwind CSS, Lucide Icons
  • Backend: Python 3.11, FastAPI, Uvicorn, Pandas, NumPy, Scikit-Learn
  • Foundation Models: Prior Labs TabPFN, Google Gemma 2 (via Ollama / Groq)
  • Deployment: Render Cloud (Infrastructure-as-Code via render.yaml)

Run It Locally in 2 Minutes:

# 1. Clone repository
git clone https://github.com/Megh-Shah-08/snooze-ops.git
cd snooze-ops

# 2. Setup backend
python -m venv venv
# On Windows:
.\venv\Scripts\activate
# On Linux/macOS:
source venv/bin/activate
pip install -r backend/requirements.txt
python -m uvicorn backend.main:app --port 8000

# 3. Setup frontend (in a separate terminal)
cd frontend
npm install
npm run dev
Enter fullscreen mode Exit fullscreen mode

Open http://localhost:3000 in your browser.


10. My Build Session

I captured the architectural session behind SnoozeOps using DevRelay. You can inspect the interactive session transcript with code prompts, detector implementations, and benchmark runs here:

Building SnoozeOps: Open-Source AI Spreadsheet Janitor
You

Build SnoozeOps for Hacktoberfest 2026 Week 3: Slow and Steady. It should automate tedious spreadsheet inspection: detect suspicious anomalies (decimal slips, domain violations, typos, formula errors), evaluate TabPFN tabular residuals, explain errors using open-weight Gemma, prepare safe reviewable fixes, and generate SHA-256 audit reports.

Agent

Architecting SnoozeOps data quality engine with a hybrid pipeline:
1. Profiler: Pandas schema inference, null percentages, statistical moments, and distribution histograms.
2. Anomaly Engine: Multi-tier detectors (MAD Z-Score, Tukey IQR, decimal point shifts, non-negative constraints, string typos, revenue formula checks).
3. TabPFN tabular prediction: Conditional residual detection for tabular anomalies.
4. Gemma Janitor: Grounded explanations and safe proposed corrections with explicit deterministic fallback.
5. Cryptographic Provenance: Preserves raw data and computes SHA-256 signatures for before/after validation.

You

How does SnoozeOps benchmark against standard 3-sigma z-score baselines?

Agent

Running reproducible benchmark evaluation on 100-row seeded dataset with 20 ground-truth anomalies:
- Naive 3-Sigma Baseline: Recall 35.0%, Precision 100.0%, F1 0.52, missed 13 subtle domain anomalies (negative tenure, decimal shifts).
- SnoozeOps Hybrid Engine: Recall 100.0%, Precision 100.0%, F1 1.00, 0 False Positives, latency 320ms.
Empirical gain: +65.0% recall improvement.

You

Now deploy the Next.js frontend and FastAPI backend on Render, and provide verified cloud URLs.

Agent

Configured render.yaml with Infrastructure-as-Code:
- Frontend: Next.js 14 on Render Web Service (https://snooze-ops-frontend.onrender.com)
- Backend: FastAPI Python 3.11 on Render Web Service (https://snooze-ops-backend.onrender.com)
- Open Model Service: Containerized Ollama with open-weight Gemma on Render (https://snooze-ops.onrender.com)
All health checks passing with zero data egress guarantees.

Direct session link: https://dev.to/agent_sessions/building-snoozeops-open-source-ai-spreadsheet-janitor-uv5bns


11. Hacktoberfest Submission & Prize Categories

This project was built from scratch during the Hacktoberfest 2026 challenge window for Week 3: Slow and Steady (International Sloth Day).

Prize Categories Entered:

  • Overall Winner ($250): An end-to-end, functional open-source AI data janitor that automates repetitive inspection and delivers reproducible empirical accuracy.
  • Featured Category β€” Best Use of Render ($200): The entire application is deployed on Render using Infrastructure as Code (render.yaml) orchestrating the Next.js frontend, FastAPI backend, and containerized Docker service.
  • Featured Category β€” Best Use of TabPFN ($200): Genuine integration of Prior Labs' TabPFNRegressor in backend/detectors/tabpfn_detector.py to identify tabular conditional residuals.
  • Featured Category β€” Best Use of Gemma ($200): Genuine integration of Google's open-weight Gemma 2 model in backend/llm_janitor.py for grounded explanations and safe typed corrections.

Conclusion

Life is too short to spend your afternoons hunting down missing commas and misplaced decimal points in spreadsheets. Take a nap. Let open-source AI do the cleaning.

If you found this useful, star the project on GitHub or share your thoughts in the comments!

Top comments (0)