AI systems · Thesis
Horizon AI
An offline AI pipeline that refactors Java, and shows every step.

The problem
Java codebases accumulate small decisions that make the next change harder.
Cloud models can help, but they add cost, latency and a trust problem: the code has to leave the machine. Horizon asks whether small local models, coordinated well, can do useful refactoring on commodity hardware.
The project was built as a thesis around one constraint: the whole system has to run offline, in one container, without API keys.
The system
GPU detected at runtime; CPU fallback otherwise. No cloud calls, no API keys.
Three small models take separate roles: a planner classifies the refactor, a generator proposes code, and a judge verifies the result.
Six phases move a candidate from plan to ranked output. FastAPI streams every step over WebSocket to a Next.js studio.
Role and team
Lead and full-stack developer. I built the orchestration flow, the API and the studio.
Team
- Joshua Lopez, lead / full-stack
- Jericho Varde, frontend
- Christian Balinado, contributor
- Andrew Dejito, contributor
What I built
- The six-phase orchestration flow
- The FastAPI and WebSocket API
- The Next.js refactoring studio
Outcome
20.1%
lower peak GPU memory than a 7B-model baseline, a saving of 812 MB.
78.5%
pipeline acceptance, up from 63.4% after automated validation and repair.
$0
cloud API cost. All inference runs locally on the machine.
Fully offline
No cloud dependency, no API keys, no code leaving the machine.
One image, GPU or CPU
The container detects hardware at runtime and falls back to CPU.
Live pipeline
WebSocket streams analysis, diffs and progress into the studio.
Six phases
Plan, generate, verify, mutate, deduplicate, rank.
Open source
MIT licensed; the repository is public.
A thesis, shipped
Built with a team, from research question to running system.
