Warning
OpenStax large-document validation remains intentionally deferred and must not be run without explicit user approval. This workflow consumes live Gemini API quota when provider-backed summaries are enabled. Confirm quota limits and API key settings before running.
This document describes the validation workflow for integrating large-document validation using actual OpenStax content.
Before attempting bounded OpenStax validation, ensure:
- Pipeline Lifecycle Controls: Integration of pause, resume, and cancel is complete and verified across all services.
- Batch-Size Escalation: Synthetic batch-size scaling limits are verified and stable (tested via
scripts/canary_gemini_batch_escalation.py). - API Quota Verification: Headroom for the target Gemini API model has been checked and confirmed.
Determine active Gemini API tier limits and active lane allocation. Check that lane_rpm times lane_count does not exceed overall API quota ceilings.
Start with an extremely limited bounded environment to minimize API call count and cost:
- SUMMARY_SERVICE_PROVIDER:
gemini - SUMMARY_SERVICE_ENABLE_PROVIDER_CALLS:
true - SUMMARY_MAX_PROVIDER_CALLS_PER_JOB:
2(Force the job to terminate/fail if it attempts more than 2 calls) - SUMMARY_BATCH_MAX_RECORDS:
5 - SUMMARY_LANE_RPM:
10
Run command (Terminal 1):
SUMMARY_SERVICE_PROVIDER=gemini \
SUMMARY_SERVICE_ENABLE_PROVIDER_CALLS=true \
SUMMARY_MAX_PROVIDER_CALLS_PER_JOB=2 \
SUMMARY_BATCH_MAX_RECORDS=5 \
SUMMARY_LANE_RPM=10 \
PYTHONPATH=services/paragraph-summary-service \
uv run --project services/paragraph-summary-service uvicorn app.main:app --host 127.0.0.1 --port 8001- Tiny Subset Only: Only submit a small sample of records (e.g. 5-10 paragraphs), do not upload entire multi-hundred page books.
- Stop Immediately On:
- Any
429rate limiting code. - Any schema validation error in API requests/responses.
- Unexpected job status accounting (e.g. status stuck in running, incorrect count, failed steps).
- Any
- Validation metrics to record:
provider_calls_attemptedfailed_records429occurrences- schema error details
- generated artifact visual quality
Always clean up generated database records and summary artifacts afterwards to keep the local workspace pristine.