To optimize provider API usage and verify scaling boundaries:
- Current Validated State:
- Live runs validated using a batch size of
5(SUMMARY_BATCH_MAX_RECORDS=5). - Synthetic Gemini hard-profile batch tuning completed manually against
gemini-3.1-flash-liteusing synthetictextbook-hardrecords (dense prose, equations, cross-references, caveats, examples). The documented batch tuning results came from manual live Gemini canary/tuning runs (requiring uvicorn and live provider/API calls from the native terminal). The documentation update itself was docs-only. OpenStax was not used, persistent defaults were not changed, and no secrets were printed or committed. - Validated configurations up to:
- 30 records × ~240 words in one provider call (
SUMMARY_BATCH_MAX_RECORDS=32, cap 2, attempted 1 call). - 32 records × ~240 words with cap 2 (attempted 2 calls, completed successfully).
- 30 records × ~240 words in one provider call (
- Live runs validated using a batch size of
- Recommended Configurations:
- Balanced Production Candidate:
SUMMARY_BATCH_MAX_RECORDS=16SUMMARY_BATCH_TARGET_TOKENS=10000SUMMARY_BATCH_HARD_MAX_TOKENS=14000SUMMARY_BATCH_RESERVED_OUTPUT_TOKENS=3500
- Aggressive Validation Candidate:
SUMMARY_BATCH_MAX_RECORDS=24SUMMARY_BATCH_TARGET_TOKENS=12000SUMMARY_BATCH_HARD_MAX_TOKENS=16000SUMMARY_BATCH_RESERVED_OUTPUT_TOKENS=4000
- Balanced Production Candidate:
- Constraints:
- Persistent defaults and configuration files were not changed.
- Do not default to 32 yet.
- OpenStax remains deferred.
- Phase 1 (Completed & Validated):
- In-memory pause/resume lifecycle controls implemented inside
paragraph-summary-service. - Validated via targeted unit tests and mock-provider smoke tests.
- In-memory pause/resume lifecycle controls implemented inside
- Phase 2 (Completed & Validated):
- Backend pause/resume proxy endpoint additions.
- Polling support updates in the main dashboard server.
- Phase 3 (Completed & Validated):
- Frontend dashboard controls integration (buttons/status pills).
- Phase 4 (Completed & Validated):
- Full mock-smoke validation and developer docs update.
- Makefile execution and helper targets integrated.
- OpenStax large-document validation remains intentionally deferred until explicitly approved.
- Guarded Workflow: A bounded validation workflow is documented at docs/validation-workflows.md and can be checked via
make openstax-bounded-validation-help. - Pre-requisites: Proceed with OpenStax validation only after:
- Pipeline lifecycle controls (pause, resume, cancel) are fully integrated across all layers.
- Batch-size limits are verified and stable.
- API quota headroom is confirmed.
- A reusable synthetic Gemini batch-size escalation canary script is available at scripts/canary_gemini_batch_escalation.py.
- Instructions are queryable via
make canary-gemini-batch-help. - Runs remain manual/deferred and will consume actual Gemini API quota.
- docs/validation-log.md: Records only proven results, completed validation runs, and verified fixes.
- docs/project-log/feature-notes.md: Records future planning, candidate configurations, and deferred scaling tasks.
- Defect tracking: Any known defects or regressions should be cataloged as GitHub issues or listed in the known-gaps logs.