No description
  • HTML 52.4%
  • Python 43.1%
  • Shell 3.1%
  • Batchfile 1.4%
Find a file
hackall360 4ce5c944b7 Add error code system and enhanced shutdown with timeout
Error Code System:

- Add ErrorCode enum with standardized codes (E1XX-E9XX)

- Add ERROR_DESCRIPTIONS registry for user-friendly messages

- Add AppError exception class and helper functions

- Add /api/errors endpoint for error code reference

- Wrap model loading, generation functions with error codes

Enhanced Shutdown:

- Add 15-minute timeout with forced exit protection

- Add watchdog thread for timeout monitoring

- Add graceful_shutdown() with proper sequencing

- Second Ctrl+C forces immediate exit

- Proper exit codes on shutdown (E800, E802)

Documentation:

- Add complete error code reference table

- Document shutdown timeout behavior
2025-12-10 15:17:54 -08:00
data Inital files 2025-12-10 14:02:52 -08:00
docs Add error code system and enhanced shutdown with timeout 2025-12-10 15:17:54 -08:00
.gitignore Add .gitignore for Python and project-specific files 2025-12-10 14:06:04 -08:00
index.html Inital files 2025-12-10 14:02:52 -08:00
README.md Add project README with setup instructions and documentation 2025-12-10 14:39:12 -08:00
run.bat Inital files 2025-12-10 14:02:52 -08:00
server.log Inital files 2025-12-10 14:02:52 -08:00
server.py Add error code system and enhanced shutdown with timeout 2025-12-10 15:17:54 -08:00
start.sh Inital files 2025-12-10 14:02:52 -08:00

Local Unity - AI Chat + Image Generation

By Unity AI Lab | www.unityailab.com

A completely local AI assistant that runs entirely on your computer. No internet required, no data sent anywhere, 100% private.

Features

  • Chat with AI - Local LLM text generation (Phi-3, Llama 3, Mistral, Qwen2)
  • Generate Images - Stable Diffusion image generation (DreamShaper, Realistic Vision)
  • Session Management - Save and organize chat history
  • Memory System - Persistent context across sessions
  • Customizable - Change the AI's personality with system prompts
  • Voice Output - Text-to-speech support
  • Dark UI - Hacker-themed interface

Everything runs on YOUR hardware using YOUR graphics card. No subscriptions, no API keys, no cloud services.

System Requirements

Minimum

  • OS: Windows 10/11 (64-bit) or Linux
  • GPU: NVIDIA GTX 1060 6GB or better (CUDA required)
  • RAM: 16 GB
  • Storage: 20 GB free space
  • Python: 3.10 or newer
  • GPU: NVIDIA RTX 3060 12GB or better
  • RAM: 32 GB
  • Storage: 50 GB free space (for multiple models)

Required Software

Quick Start

Windows

# Double-click run.bat
run.bat

Linux/Ubuntu

chmod +x start.sh
./start.sh --setup    # First time only - installs system deps
./start.sh            # Start the server

First run will:

  1. Create virtual environment
  2. Install PyTorch with CUDA
  3. Install llama-cpp-python with CUDA
  4. Install diffusers for image generation
  5. Start server at http://localhost:8080
  6. Auto-open browser (Windows only)

How It Works

You type a message
        |
Browser sends it to the server (server.py)
        |
Server sends it to the AI model on your GPU
        |
AI thinks and generates a response
        |
Response appears in your browser

File Structure

LocalUnity/
├── run.bat              # Windows launcher
├── start.sh             # Linux/Ubuntu launcher
├── server.py            # Flask server
├── index.html           # Web interface
├── data/
│   ├── system_prompt.md # AI personality
│   ├── memories.json    # Persistent memory
│   └── sessions.json    # Chat sessions
├── docs/
│   ├── README.md        # User documentation
│   └── README_TECHNICAL.md  # API reference
└── models/              # AI models (auto-downloaded)
    ├── llama3/          # Text models (GGUF)
    ├── mistral/
    ├── phi3/
    └── image/           # Image models (Diffusers)

Adding Models

Text Models (GGUF format)

Place .gguf files in models/ folder:

models/
├── llama3/Llama-3.2-3B-Instruct-Q4_K_M.gguf
├── mistral/Mistral-7B-Instruct-v0.3.Q4_K_M.gguf
└── phi3/Phi-3-mini-4k-instruct-q4.gguf

Image Models (Diffusers format)

Place model folders in models/image/:

models/image/
├── dreamshaper-8/
├── realistic-vision-v51/
└── epicrealism/

API Reference

See docs/README_TECHNICAL.md for full API documentation.

Quick API Examples

Chat:

POST /api/chat
{"message": "Hello", "session_id": "uuid"}

List Models:

GET /api/models
GET /api/image/models

Generate Image:

POST /api/image/generate
{"prompt": "a cat in space", "width": 512, "height": 512}

Contact

License

Private project by Unity AI Lab.