Skip to content

Route routine AI through free Gemini tier - #2

Draft
oosuhada wants to merge 4 commits into
mainfrom
feat/free-ai-routing
Draft

Route routine AI through free Gemini tier#2
oosuhada wants to merge 4 commits into
mainfrom
feat/free-ai-routing

Conversation

@oosuhada

@oosuhada oosuhada commented Aug 19, 2026

Copy link
Copy Markdown
Owner

Goal

Move routine PM and ordinary technical-comment interpretation off paid Vertex without weakening formal review/reasoning paths. No event batching is added.

Routing

  • routine PM + ordinary GitHub technical-comment PM: Gemini Developer API Free Tier gemini-3.5-flash-lite first
  • free API failure: Vertex Flash-Lite fallback only while the paid automatic budget remains available
  • formal pull_request_review, chat and commit reasoning: Vertex gemini-3.7-flash
  • project-memory refresh obeys the same paid fallback guard, so an automatic docs refresh cannot silently bypass the paid cap
  • paid and free automatic budgets are tracked separately

Validation

  • backend pytest: 19 passed
  • Python compile smoke
  • git diff --check
  • production free API smoke: provider=gemini-developer-free, billingClass=free, model=gemini-3.5-flash-lite
  • live production after rollout: paid counters stayed at 26 calls / 1,264,963 input while 2 automatic PM calls / 82,942 input were recorded separately as free-tier usage
  • repeated service restart with unchanged semantic state did not reopen paid usage

Production

Deployed to the Mac mini service. /api/health reports simpleProvider=gemini-developer-free, freeTierEnabled=true, and separate paid/free budgets. The paid automatic budget remains capped while routine free-tier PM can continue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant