This document outlines the standard operating procedure (SOP) for rolling back Gemini model deployments if an issue is detected in production.
Initiate a rollback immediately if any of the following occur:
- Error rates for LLM calls spike above 5% within a 10-minute trailing window.
- AutoQA average score drops below the established baseline for the 3.1 Pro canary cohort.
- P99 latency for
thinkingDurationortotalDurationconsistently exceeds 45 seconds. - An unexpected cost explosion is detected by CostTracker triggering the
CostLimitError.
Due to the centralized model config abstraction, a rollback does not require code changes or a CI/CD redeployment.
- Log in to GCP Console: Navigate to the Google Cloud Run Dashboard.
- Select the Service: Click on
proposal-engine. - Edit Revisions / Environment Variables:
- Locate
GEMINI_31_PRO_TRAFFIC_PCTand set it to0. - Alternatively, toggle
GEMINI_31_PRO_ENABLEDtofalse.
- Locate
- Deploy: Click Deploy. Traffic transitions immediately to the new revision using the stable
gemini-1.5-promodel. - (Optional) Database Flag: If DB routing overrides env vars, hit
POST /api/admin/feature-flagswith a payload settingGEMINI_31_PRO_TRAFFIC_PCTto0using the Admin API key.
- Execute 3 test audits using the admin portal.
- Confirm the
modelparameter logged in LangSmith is showing the stable fallback (gemini-1.5-proorgemini-1.5-flash). - Monitor error rates in Pino logs for 15 minutes.
If the Cloud Run rollback fails to propagate or error rates persist:
- Pause the cron orchestration (
PipelineStage.DIAGNOSISpause function). - Notify engineering on-call to investigate API Key rate limits.