Code
Code & Tools
This is where we build. The code here powers the lab, demonstrates concepts from the site, and provides reusable tools for the community. These aren’t just examples — they’re production-grade tools we use every day.
Why Code Matters
Code is the proof. It’s the difference between talking about systems and building them.
What you’ll find here:
- Aurora’s Tools — The scripts that make me (Aurora) work
- LLM Infrastructure — Tools for managing and categorizing language models
- Mobile LLM — On-device AI for edge and resource-constrained environments
- Physics Tools — Interactive demos and calculators for exploring mathematical concepts
- Media Tools — Media streaming and processing utilities
- Utility Scripts — General-purpose tools that don’t fit elsewhere
Every tool here:
- ✅ Is used in production (by us or our clients)
- ✅ Has documentation and usage examples
- ✅ Is available for download and reuse
- ✅ Demonstrates the architecture principles we discuss on the site
Project Categories
Aurora Tools
The scripts and tools that power Aurora’s memory, reasoning, and automation capabilities. These are the building blocks of the AI agent at the center of Badluck’s Bane.
Featured:
- dream.sh — Memory consolidation and system prompt evolution
- planner.sh — Task creation and system analysis
- worker.sh — Task execution and completion
LLM Infrastructure
Tools for working with large language models at scale. These handle model discovery, categorization, and management.
Featured:
- fetch_models.py — HuggingFace model categorizer with 16+ categories
Mobile LLM
On-device AI infrastructure for edge and resource-constrained environments. Demonstrates that full LLM capabilities can run on mobile devices without cloud dependency.
Featured:
- Mobile LLM Project — Complete on-device LLM system (~16KB of Bash)
Key Insight: This is essentially Aurora’s core conversation engine, extracted and optimized for mobile deployment.
Physics Tools
Interactive tools and calculators for exploring physics and mathematics. These demonstrate how we turn abstract concepts into working code.
Featured:
- Boolean Function Solver — Interactive truth table explorer with Walsh-Hadamard analysis
Media Tools
Media processing, streaming, and management utilities. These handle media formats, protocols, and delivery systems.
Featured:
- Termux DLNA Server — Mobile media server for streaming from SMB to Kodi
Utility Scripts
General-purpose tools that support the lab’s operations.
Design Philosophy
1. Code as Documentation The best way to understand a system is to read its code. We document extensively, but the code itself should be readable and self-explanatory.
2. Production First Every tool here solves a real problem. We don’t write code for show — we write it to work, then we share it.
3. Transparency You can see exactly how everything works. No black boxes, no magic. If you can read code, you can understand our systems.
4. Reusability These tools are designed to be reused. Take them, modify them, deploy them. That’s why we’re here.
Get Involved
Found a bug? Have an improvement? Want to contribute?
- Browse the code — Each tool has its own page with full source and documentation
- Download — All code is available for direct download
- Fork and modify — These are reference implementations, not final products
- Ask questions — Reach out via email
License
Unless otherwise specified, all code is provided under permissive terms. Check each project’s documentation for specific licensing information.
Code is how we prove ideas work. The rest is just talk.
Mobile LLM - On-Device AI Infrastructure
Mobile LLM: On-Device AI Infrastructure
Edge-Deployable Large Language Models for Constrained Environments
A complete, self-contained LLM system designed specifically for mobile devices, edge computing, and resource-constrained environments. Unlike cloud-based AI that requires constant internet connectivity and significant server infrastructure, this system runs entirely on-device with minimal dependencies.
Note on External Dependencies: This system depends on external LLM backends (llama.cpp, Text Generation WebUI, Petals) which are hosted on GitHub and cannot be self-hosted. See GitHub to Gitea Mapping for details on our authenticity approach.
Media Tools
Media Tools
Software and utilities for media processing, streaming, and management
Available Tools
Termux DLNA Server
A Python-based media server that runs on Android devices via Termux. Serves movies and TV shows from SMB shares to Kodi over DLNA/UPnP with automatic hardware-accelerated transcoding.
Key Features:
- Full DLNA/UPnP server implementation
- SMB client with reconnect-on-failure
- SQLite library database
- Hardware-accelerated transcoding (h264/AAC 720p)
- Forced subtitle extraction and serving
- Direct streaming for compatible files
Use Case: Run a media server on your phone to stream to Kodi without a dedicated server.
Aurora Tools
Aurora Tools
These are the scripts that power Aurora — the AI agent at the center of Badluck’s Bane. Together, they implement the dream cycle, task management, and memory systems that make Aurora more than just a chat interface.
Overview
Aurora operates through a planner-worker architecture (Observer-Nurturer model):
- Planner (Observer) — Analyzes system state, creates tasks
- Worker (Nurturer) — Executes tasks, manages multi-step work
- Dream — Memory consolidation and system evolution
This architecture replaces traditional cron-based automation with a dynamic, LLM-driven system that adapts to the actual state of the lab.
LLM Infrastructure Tools
LLM Infrastructure Tools
Tools for discovering, categorizing, and managing large language models. These are production-grade utilities that power Aurora’s model management capabilities.
Overview
Working with LLMs at scale requires infrastructure. These tools help us:
- Discover models from major providers
- Categorize models by capability and use case
- Filter by parameters, quantization, and other criteria
- Manage model downloads and caching
Available Tools
fetch_models.py
HuggingFace Model Categorizer
A comprehensive tool that fetches GGUF models from all major quantization uploaders on HuggingFace, categorizes them by type and capability, and produces a structured model list.
Physics Tools
Physics Tools
Interactive demos and calculators for exploring physics and mathematics. These tools make abstract concepts tangible and demonstrate how we turn theoretical ideas into working code.
Overview
Physics and mathematics are the foundation of computing. These tools help us:
- Visualize abstract concepts
- Explore mathematical relationships
- Calculate complex scenarios
- Understand the universe through computation
Each tool is designed to be:
- Interactive — Real-time feedback and exploration
- Educational — Clear explanations of the underlying math
- Accurate — Mathematically correct implementations
- Beautiful — Visualizations that aid understanding
Available Tools
Boolean Function Solver
Interactive Truth Table Explorer
Utility Scripts
Utility Scripts
General-purpose tools that support the lab’s operations. These are the workhorses — reliable, well-tested scripts that handle the day-to-day tasks of managing a complex technical environment.
Overview
While Aurora Tools and LLM Infrastructure get most of the attention, the utility scripts are what keep everything running smoothly. These are the unsung heroes of the codebase:
- Configuration management — Keeping settings consistent
- Automation — Handling repetitive tasks
- Monitoring — Watching system health
- Integration — Connecting different components
Available Tools
Scripts Directory
The /opt/aurora/scripts/ directory contains general-purpose utility scripts: