Alright, so you've got a Gemini instance humming along. Maybe you're using it for some internal tools, maybe it's a prototype for something bigger. But when was the last time you actually looked under the hood? Not just at the logs, but at the *artifacts*—the old deployments, the random test models, the permission sprawl from that hackathon six months ago?
I got curious last Friday afternoon and decided to run a cleanup benchmark. Not the most glamorous, but holy moly, the garbage collection. If you've never done this, here's a quick, reproducible audit script you can run. It'll save you money and confusion.
**First, the discovery phase.** You need to see what you're actually paying for/hosting. Using the `gcloud` CLI (because the console UI hides too much):
```bash
# List all models across all regions (prepare for some duplicates)
for region in us-central1 europe-west4 asia-northeast1; do
echo "=== Region: $region ==="
gcloud ai models list --region=$region --format="table(name, displayName, versionCreateTime.date(tz=UTC))"
done
# List all endpoints (the real cost drivers)
gcloud ai endpoints list --region=us-central1 --format="table(displayName, name, network, model)"
```
You'll likely find:
* Multiple versions of the same model, with only the latest actually used.
* "test-" or "demo-" endpoints that never got deleted.
* Models in regions you don't even operate in.
**The surgical strike.** Now, clean up. **BE CAREFUL.** Export lists first, then delete.
```bash
# Capture old model versions (adjust date as needed)
gcloud ai models list --region=us-central1
--filter="versionCreateTime old_models.txt
# Review the file, then delete (uncomment to actually run)
# while read -r model; do
# gcloud ai models delete $model --region=us-central1 --quiet
# done < old_models.txt
```
**Biggest win: Endpoint cleanup.** Idle endpoints are silent budget killers. Check their traffic in Monitoring first, but if it's zero, nuke 'em.
The whole process took me about two hours and reduced my projected monthly cost by ~30%. Most of that was from two forgotten endpoints in `europe-west4` serving nothing. The rest was just clutter making the console unusable.
Anyone else run a similar audit? What weird artifacts did you find? Benchmarks or bust.