Skip to content

Yash-Marathe91/LocalHost-AI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

13 Commits
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🧠 LocalHost-AI

Fully Offline On-Device LLM Desktop Application

The cloud is optional. Intelligence is not.

LocalHost-AI is a privacy-first, fully offline AI assistant powered by llama.cpp and built with a premium React + Electron desktop frontend. Everything runs locally on your machine β€” no cloud, no API keys, no internet dependency.


πŸ”₯ Why This Project?

Most AI assistants depend on cloud APIs, which introduces critical problems:

Problem LocalHost-AI Solution
❌ Internet Required βœ… Runs 100% offline on 127.0.0.1
❌ Privacy Risks βœ… Data never leaves your hardware
❌ API Costs βœ… Free forever β€” you own the model
❌ Vendor Lock-in βœ… Full sovereignty over your AI

πŸ— Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   React + Electron Desktop   β”‚
β”‚   (Tailwind CSS v4 + Framer) β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
           β”‚ HTTP POST (localhost)
           β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚     llama.cpp Server         β”‚
β”‚     127.0.0.1:8080           β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
           β”‚
           β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  Meta-Llama-3-8B-Instruct    β”‚
β”‚  (GGUF Q4_K_M Β· ~4.7 GB)    β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
         CPU / GPU

βš™ Tech Stack

Layer Technology
Frontend React 19 Β· TypeScript Β· Tailwind CSS v4
Desktop Shell Electron 42 Β· Vite 8
Animations Framer Motion Β· Custom Typewriter Effect
Inference Engine llama.cpp (local HTTP server)
Model Meta-Llama-3-8B-Instruct (GGUF Q4_K_M)
Storage Browser localStorage (persistent memory)
Communication HTTP on 127.0.0.1:8080 β€” zero external calls

✨ Features

🎯 Three Inference Modes

  • ⚑ Quick β€” Fast, concise answers (512 tokens, temp 0.7)
  • 🧠 Reasoning β€” Step-by-step logical analysis (1024 tokens, temp 0.5)
  • ✍️ Writing β€” Long-form, structured Markdown output (2048 tokens, temp 0.7)

πŸ’¬ Smart Chat Experience

  • Typewriter Animation β€” Responses type out naturally with a blinking cursor (click to skip)
  • Streaming & Instant Modes β€” Toggle real-time token streaming or full-response delivery
  • Markdown & Code Highlighting β€” Beautiful rendering with Prism OneDark theme
  • Copy Button β€” One-click copy on any assistant message

🧠 Context Memory

  • Persistent Memory β€” Remembers conversation context across sessions via localStorage
  • Smart Truncation β€” Long responses are summarized before storing to save context tokens
  • Anti-Repetition β€” Llama-3 chat template with explicit deduplication rules
  • Toggle On/Off β€” Enable or disable memory on the fly

πŸ“€ Export & Controls

  • Chat Export β€” Download any session as a formatted Markdown (.md) file
  • New Session β€” Clear chat and start fresh instantly
  • Clear Memory β€” Wipe all stored context with one click
  • Real-time Metrics β€” Live latency (ms), character count, and token budget display

πŸ” Privacy First

  • Zero telemetry β€” no analytics, no tracking
  • Zero external API calls β€” all traffic stays on 127.0.0.1
  • Zero cloud dependency β€” runs in airplane mode

πŸ–₯ Getting Started

Prerequisites

  • Node.js v18+ (for the frontend)
  • llama.cpp compiled with llama-server (build instructions)
  • GGUF model file (e.g., Meta-Llama-3-8B-Instruct-Q4_K_M.gguf)

1. Start the LLM Server

cd C:\testLlama\llama.cpp

build\bin\Release\llama-server.exe ^
  -m models\Meta-Llama-3-8B-Instruct-Q4_K_M.gguf ^
  -ngl 0 ^
  -t 8 ^
  -c 4096 ^
  --host 127.0.0.1 ^
  --port 8080

Note: -ngl 0 runs on CPU only. Set -ngl 99 to offload layers to GPU if available.

2. Launch the Desktop App

cd desktop_llm_chat

# Install dependencies (first time only)
npm install

# Start the dev server + Electron window
npm run dev

The app connects automatically to http://127.0.0.1:8080/completion.

3. Build Portable Executable (Optional)

npm run dist

Produces a standalone .exe in dist-electron/ β€” no Node.js or terminal needed to run!


πŸ“‚ Project Structure

Kill_the_cloud/
β”œβ”€β”€ .gitignore
β”œβ”€β”€ README.md                          # This file
└── desktop_llm_chat/                  # Electron + React application
    β”œβ”€β”€ main.cjs                       # Electron main process
    β”œβ”€β”€ index.html                     # Entry HTML
    β”œβ”€β”€ package.json                   # Dependencies & build config
    β”œβ”€β”€ vite.config.ts                 # Vite + Tailwind v4 config
    β”œβ”€β”€ src/
    β”‚   β”œβ”€β”€ main.tsx                   # React entry point
    β”‚   β”œβ”€β”€ App.tsx                    # Main chat UI & logic
    β”‚   β”œβ”€β”€ config.tsx                 # Inference modes & Llama-3 prompt builder
    β”‚   β”œβ”€β”€ memory.ts                  # localStorage persistence service
    β”‚   β”œβ”€β”€ TypewriterContent.tsx      # Typewriter animation component
    β”‚   └── index.css                  # Tailwind v4 theme tokens
    └── public/                        # Static assets

🧠 Model Information

Property Value
Model Meta-Llama-3-8B-Instruct
Quantization Q4_K_M (~4.7 GB)
Format GGUF
Context Window 4096 tokens
Prompt Format Llama-3 native chat template

Warning

Model files are not included in this repository due to size. Download the weights from HuggingFace and place them in your llama.cpp models/ directory.


πŸ“Œ Use Cases

  • πŸ” Low-connectivity environments β€” Work anywhere, no internet needed
  • πŸ”’ Privacy-critical systems β€” Legal, medical, or personal journaling
  • 🏒 On-device enterprise AI β€” Secure internal knowledge without cloud exposure
  • ⚑ Edge AI deployments β€” Lightweight hardware implementations

πŸš€ Future Improvements

  • File upload & RAG (Retrieval-Augmented Generation) support
  • In-app Model Selector UI
  • Multi-session chat history with tabs
  • Voice-to-Text and Text-to-Voice integration
  • Custom temperature/top-p sliders in settings
  • GPU auto-detection and layer offloading

πŸ† Hackathon Submission

Challenge: DeepSeek vs. Llama β€” "Kill The Cloud" Challenge

Theme: Deploying powerful AI systems without relying on centralized cloud infrastructure.

Author: Yash Marathe


LocalHost-AI demonstrates that advanced AI assistants can operate securely, privately, and efficiently β€” entirely offline.

The cloud is optional. Intelligence is not. 🧠

About

A high-performance local inference engine designed to eliminate API dependency and cloud latency.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors