Inspiration

Most gaming PCs have a powerful GPU that sits idle most of the day. Meanwhile, developers pay for cloud GPUs or hosted APIs just to use open AI models. We wanted to connect the two. The name comes from moonlighting: working a second job on the side, often at night. With Moonlight, your GPU moonlights. When you're not using it, it picks up a side job serving AI models and earns you money.

What it does

Moonlight is a marketplace for spare GPU power.

  • Sellers run one command. Moonlight finds the AI models already on their computer and serves them to buyers. Sellers keep 90% of every request, and Moonlight steps aside whenever they need their GPU back.
  • Buyers get one OpenAI-compatible API. Change the base URL in the OpenAI SDK, and you're done. You pay only for the tokens you use.
  • Verification: How do you know a seller really runs the model they listed? Moonlight hides test questions among real requests and compares the answers with a trusted GPU. Sellers who fake their model get caught, and their earnings are held.

How we built it

  • Gateway: Node.js on Google Cloud, with SQLite and WebSockets
  • Seller agent: a single file with no dependencies, built for 5 platforms with Bun
  • Web app: React, Vite, three.js, and Firebase sign-in
  • Models: Ollama, plus the open Laya model from Hugging Face

Challenges we ran into

The hardest part was catching cheaters without flagging honest sellers. The same model gives slightly different answers on different GPUs, so comparing whole answers didn't work. Instead, we give the seller the start of a trusted answer and check only the next few words. Honest sellers pass about 99% of the time; a seller faking its model passes about 9%.

Accomplishments that we're proud of

  • It's live at moonlight.hajunshin.com
  • A seller can join with one command and one click.
  • Our demo cheater gets caught within a few checks.

What we learned

Even the same AI model doesn't give exactly the same answer on different hardware, so verification has to be designed around that.

What's next for Moonlight

  • Real payouts (balances are demo credit for now)
  • Testing on real Macs
  • Verifying bigger models

Built With

Share this project:

Updates

Submission history