This is a submission for the Hacktoberfest Open-Source AI Challenge Week 3: Slow and Steady
What I Built
Every cloud engineer knows the dread of opening a monthly invoice and spotting an n1-standard-4 instance that has been running silently for weeks. You spun it up on a Friday afternoon to test something, promised yourself you'd turn it off before leaving, and closed your laptop instead.
Stopping it should be easy, but the friction gets in the way:
- Open the Google Cloud Console.
- Wait for the dashboard to load.
- Jump into Compute Engine.
- Cycle through a dozen regions because you can't remember if the test box was in
us-central1oreurope-west3. - Click through monitoring graphs to confirm CPU has been flat at zero.
SlothOps is built to reward pure developer laziness. It's a local cloud auditor that turns multi-region cleanup into a single terminal command. It lists your compute instances, passes the inventory to a local Gemma 2 (2B) open-weight model, and hands you the exact gcloud command to shut the waste down.
No console hopping, no forgotten test boxes, and no metered API charges.
Demo
SlothOps running inside Google Cloud Shell, auditing a sample idle-instance snapshot:
Running in offline mode against the bundled instances.json snapshot.
Code
Razorbillworks
/
slothops
Local-first GCP FinOps CLI powered by Gemma 2. Identifies idle compute instances and prints ready to run cleanup commands.
🦥 SlothOps
A lazy-friendly GCP cost auditor that finds the VMs you forgot to turn off.
If you spin up test VMs, sandbox boxes or throwaway Redis nodes on Google Cloud and then forget about them, you know the pain: clicking through every region in the console just to check what's idle. SlothOps does that in one command. It lists your compute instances, hands the metadata to a local Gemma 2 (2B) model, and prints a verdict along with ready-to-run gcloud commands to shut the waste down.
Everything runs on your machine. No inference API, no extra bill.
Demo
SlothOps running in Google Cloud Shell in offline mode, auditing the sample instances.json snapshot.
⚙️ How it works
+---------------------+
| SlothOps CLI |
| (Rust) |
+----------+----------+
|
+--------------+--------------+
| |
Live mode Fallback mode
gcloud compute instances read local instances.json
list --format=json |
| |
+--------------+--------------+
|
v
+---------------------+
|…Open source under the MIT License. The repo has the Rust CLI, the Terraform IAM policy, the TypeScript formatting script, and the fallback dataset.
How I Built It
I wanted low friction, predictable behavior, and nothing that can wreck your cloud account.
+------------------------------------+
| SlothOps CLI |
+-----------------+------------------+
|
+-------------+-------------+
| |
[Live Mode] [Fallback Mode]
gcloud compute instances Read instances.json
list --format=json snapshot
| |
+-------------+-------------+
|
v
+------------------------------------+
| Ollama Local Inference Engine |
| Model: Gemma 2 (2B) |
+-----------------+------------------+
|
v
+------------------------------------+
| Terminal Audit Verdict |
| - Flags zero-utilization instances |
| - Computes estimated spend |
| - Prints exact `gcloud stop` flags |
+------------------------------------+
Architecture and components
| Component | Technology | What it does |
|---|---|---|
| CLI core | Rust (tokio, reqwest, serde, colored) |
Native binary in src/main.rs with sub-second startup and a small memory footprint. |
| Local AI | Gemma 2 (2B) via Ollama | Reads the instance metadata, flags idle ones, and extracts the affected names. Nothing leaves your machine. |
| IaC | Terraform / HCL (terraform/main.tf) |
Creates a service account limited strictly to roles/compute.viewer. |
| Scripts | TypeScript (scripts/summary.ts) |
Structured audit output formatting and JSON summaries. |
Safety first: no destructive surprises
Tools that delete cloud resources on their own are risky. SlothOps never executes anything. It isolates the waste, estimates the monthly burn, and prints the exact gcloud command for you to review and run yourself. You stay in control of your cloud state, and the read-only service account backs that up at the permission level.
Execution modes
-
Live mode: when
gcloudis authenticated, it runsgcloud compute instances list --format=jsonagainst your active project. -
Offline / sandbox fallback: if you're not logged in, or you're in an environment like Google Cloud Shell that can't run an Ollama daemon, it falls back to the bundled
instances.jsonwith built-in evaluation logic, so testing never stalls.
Known limitations
Gemma 2 (2B) is a small model and can misjudge an instance, so always read the suggested commands before running them. SlothOps currently covers Compute Engine VMs only, not every GCP resource type.
Why Open Models Matter Here
- Zero inference cost: using an LLM to avoid a surprise $50 bill shouldn't need a paid API. Running Gemma 2 locally costs nothing.
- Privacy: project IDs, zone layouts, and service names stay on your hardware instead of going to a third-party endpoint.
- Offline portability: the model lives on your workstation, so you can audit infrastructure dumps without a connection.
The Lazy Payoff
Instead of logging in through SSO, opening a pile of console tabs and cross-checking charts region by region, you run one command and get the line you need to stop the billing burn. It turns a chore you keep avoiding into something you can do before locking your screen.
Prize Categories
- Primary track: Hacktoberfest Week 3 - Slow and Steady
- Partner category: Best Use of Gemma


Top comments (0)