DEV Community

Naresh Kumawat
Naresh Kumawat

Posted on

Submit to the week 4 DEV Challenge

Hacktoberfest Open-Source AI Challenge: Ghost in the Machine Submission πŸ‘»πŸŒΌ

Lazy β€” A Ghost That Organizes Your Digital Chaos πŸ‘»

What I Built

Lazy is the ghost that quietly haunts your cluttered desktopβ€”not to scare you, but to resurrect order from digital chaos. Inspired by the Ghost in the Machine theme, Lazy brings forgotten files, abandoned projects, and years of accumulated digital clutter back under control using open-source AI. It acts like a silent digital guardian, scanning messy folders such as Downloads and Desktop, intelligently categorizing files, and proposing an organized structure without moving anything until you approve it.

Unlike traditional AI file organizers that require uploading private documents to cloud services, Lazy follows a local-first, privacy-respecting approach. Your files never leave your disk, and when cloud AI is enabled, only filenames and extensions are evaluated. Every file operation is review-first, with collision-safe moves, automatic renaming or skipping instead of overwriting, and one-click undo backed by SQLite transaction logs. Obvious file types are handled through deterministic rules with zero AI tokens and minimal latency, while open-weight models such as Qwen, Llama, and Gemma handle ambiguous filenames. With local inference through Ollama, optional hosted inference providers, and a fully offline rules-only mode, Lazy makes intelligent file organization accessible, private, and free from vendor lock-in.

Demo

Live Demo: https://lazydesk-web.onrender.com

Source Code

GitHub: https://github.com/Nareshkumawat-star/lazy-desk

How I Built It

Lazy uses a secure two-tier architecture wrapped in a native desktop application.

Electron Desktop Shell
(Context Isolation, Sandbox, Native File Picker)
                |
                v
Next.js 15 Frontend
(React, TypeScript, Tailwind CSS, Lucide Icons)
                |
                | Typed HTTP + Loopback
                | X-Lazy-Token Header
                v
FastAPI Local Service
(Python 3.12, 127.0.0.1:8765)
                |
                +-- Categorization Engine
                |   (Rules + Open-Weight Models)
                |
                +-- Collision-Safe Operation Planner
                |
                +-- SHA-256 Duplicate Detection
                |
                +-- SQLite Storage
                    (Sessions, Operations, Rules,
                     Embeddings)
Enter fullscreen mode Exit fullscreen mode

Technology Stack

  • Desktop: Electron
  • Frontend: Next.js 15, React, TypeScript, Tailwind CSS, Lucide Icons
  • Backend: Python 3.12, FastAPI
  • Database: SQLite
  • Local AI: Ollama with Qwen 2.5, Llama 3.2, Phi-3 Mini, and Gemma 2
  • Embeddings: nomic-embed-text
  • Hosted inference: Pollinations, Groq, OpenRouter, and Hugging Face adapters
  • Security: Context isolation, sandboxing, strict path validation, and collision-safe file operations
  • Deployment: Render Blueprint for the web demo and supporting services

User Workflow

  1. Scan: Select a cluttered folder, such as Downloads or Desktop, and let Lazy scan its files.
  2. Categorize: The rules engine and optional AI model classify files into meaningful categories.
  3. Review: Preview the proposed organization and inspect every suggested move before approving.
  4. Organize: Approve the plan and let Lazy safely move files, renaming or skipping conflicts instead of overwriting existing files.
  5. Undo: Restore files to their original locations with one-click Undo if needed.

The entire workflow prioritizes user control, privacy, and safe file management, with offline, rules-only operation available when AI is not needed.

Open-Source AI and Local Inference

Lazy supports local inference through Ollama, including:

  • Qwen 2.5
  • Llama 3.2
  • Phi-3 Mini
  • Gemma 2

Semantic search uses the nomic-embed-text embedding model. For users who prefer hosted inference, optional adapters support Pollinations, Groq, OpenRouter, and Hugging Face.

Lazy uses structured JSON extraction and Pydantic validation to treat model responses as untrusted input. Suggested categories are checked against defined values, and model output cannot directly determine arbitrary filesystem paths.

Deterministic rules handle obvious file types, such as images, videos, and PDFs, without AI inference. Open-weight models are reserved for ambiguous filenames that require more contextual interpretation.

Defensive Filesystem Safety

When working with personal files, safety is just as important as intelligence.

Lazy includes several protective mechanisms:

  • Symbolic links are not traversed during scans or moves.
  • Directory traversal attempts, such as ../, are blocked through path validation.
  • Source files and destination paths are validated before operations.
  • Existing files are never overwritten; conflicts are renamed or skipped.
  • Undo operations validate source and destination paths before restoring files.
  • SQLite records operation history to support safe recovery.
  • SHA-256 hashing helps identify duplicate files.

These safeguards help ensure that AI recommendations remain suggestions rather than unrestricted commands over the user's filesystem.

Why Does Open Innovation Matter?

When dealing with a user's personal desktop, privacy is paramount. Traditional proprietary tools may require subscriptions, rely on closed cloud services, or send sensitive information to external systems.

Open innovation makes Lazy possible in ways that closed, cloud-dependent systems may not.

True Local Privacy: Open-weight models such as Qwen, Llama, and Gemma allow file categorization to run on the user's own machine. In local mode, file information can remain on the device without being sent to an AI provider.

Works Without Internet: Lazy offers a rules-only mode for basic file organization without requiring an internet connection or an external AI service.

No Paywalls or Vendor Lock-In: Users can choose local models, supported hosted inference providers, or rules-only processing based on their hardware, preferences, and budget.

Verifiable and Extensible: The open-source code allows developers and security researchers to inspect the implementation, contribute improvements, and experiment with different models and categorization strategies.

For Lazy, open innovation is not just a technical choice. It gives users more control over their files, their AI models, and the tools they depend on.

Prize Categories

Best Use of Render

Lazy includes a Render Blueprint (render.yml) designed to configure the FastAPI service and exported Next.js frontend, with service-token wiring, explicit CORS restrictions, and health checks.

Best Use of Gemma

Lazy supports Gemma 2 (gemma2:2b) for lightweight file categorization, making it a suitable option for users experimenting with local inference on compatible hardware.

Team Leader

Username: nareshkumawatstar

Final Thoughts

Lazy is built around a simple idea: your computer should handle the boring work while you stay in control. By combining open-source AI, local-first architecture, deterministic automation, and safe file operations, Lazy turns digital clutter into an organized workspace without making privacy the price of convenience.

Sometimes, the best ghost is the one that quietly cleans up after you.

Top comments (0)