feat(google-cloud): GCS storage adapter + Vertex AI Gemini provider (#2)

↗ view on GitHub · Amalanand Muthukumaran · 2026-05-24 · 57c1c1b5

* feat(google-cloud): GCS storage adapter + Vertex AI Gemini provider

Adds two drop-in Google Cloud integrations following the existing
extension points (StorageAdapter + LLMProviderAdapter) so no core files
needed editing beyond exporting the new classes.

**GCS storage adapter** (lib/storage/gcs.ts)
- Implements the StorageAdapter interface backed by @google-cloud/storage
- Auth via Application Default Credentials - covers service account key
  files (GOOGLE_APPLICATION_CREDENTIALS), Workload Identity on GKE /
  Cloud Run, and gcloud CLI for local dev (zero secrets to manage)
- Enabled when GCS_PROJECT_ID or GOOGLE_APPLICATION_CREDENTIALS is set
- Signed URLs use V4 signing; Content-Disposition header supported
- Swap R2 for GCS with one setStorageAdapter() call at startup:
    import { setStorageAdapter } from "./lib/storage";
    import { GCSStorageAdapter } from "./lib/storage/gcs";
    setStorageAdapter(new GCSStorageAdapter());

**Vertex AI Gemini provider** (lib/llm/providers/vertexAI.ts)
- Routes all Gemini model IDs through Google Cloud Vertex AI instead of
  AI Studio - same model IDs, different billing + auth + data residency
- Uses @google/genai (already a dep) with vertexai: true mode - no new
  package required
- Auth via ADC: Workload Identity on GKE/Cloud Run, or
  GOOGLE_APPLICATION_CREDENTIALS locally
- Replaces the built-in gemini provider on re-registration (same id):
    import { setupVertexAI } from "lib/llm/providers/vertexAI";
    setupVertexAI();

**Tests**: 23 new tests (16 GCS adapter, 7 Vertex AI provider); full
suite 151 tests passing.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* docs(readme): rewrite as setup and contribution guide

The previous README was a project retrospective - design rationale,
open-source bets, a 40-row change index - with the actual setup steps
buried partway through. This rewrites it as a task-oriented doc:

- Quick Start: clone → install → env → database → run (5 steps)
- Configuration: all env vars grouped by category with descriptions
- Extending Mike: concrete code snippets for each extension point
  (custom LLM provider, Vertex AI, GCS, custom storage, law library
  plugins, Python SDK)
- Development: test/lint/build/typecheck commands in one place
- Troubleshooting: the four most common issues
- Contributing: short version inline, CONTRIBUTING.md for the rest

The commit history and design rationale move to a collapsed footnote
(<details> block) so they're available without dominating the page.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Repository amal66/mike
Author Amalanand Muthukumaran <mamalanand3@gmail.com>
Authored
Parents abe78b7d
Stats 9 files changed , +1672 , -591
Part of Extensibility registries: LLM providers and storage adapters

Capture this commit into my fork

Download a Markdown prompt that tells Claude how to port this exact commit into your working tree. Run it via claude -p < capture-commit-57c1c1b5.md from inside the repo you want the change in.

⬇ Download capture-commit-57c1c1b5.md