Skip to content

Runtime Limits ​

This page owns operational limits, quotas, budgets, cooldowns, and timeout values.

Feature docs describe behavior. This page records the numeric values operators may need when debugging load, cost, latency, quota exhaustion, or failed requests.

Deployment Capacity ​

SurfaceLimitValueSource
Backend APICloud Run max serving instances1.github/workflows/deploy.yml
Backend APICloud Run memory1Gi.github/workflows/deploy.yml
Backend APICloud Run request timeout3600s.github/workflows/deploy.yml
Backend APITerraform service template CPU1000mterraform/cloud_run.tf
Podcast ASRCloud Run max instances1.github/workflows/deploy.yml
Podcast ASRCloud Run min instances0terraform/cloud_run.tf
Podcast ASRCloud Run concurrency1.github/workflows/deploy.yml
Podcast ASRCloud Run CPU2.github/workflows/deploy.yml
Podcast ASRCloud Run memory2Gi.github/workflows/deploy.yml
Podcast ASRCloud Run request timeout3600s.github/workflows/deploy.yml
Podcast ASRStartup probe failure threshold/period18 failures / 10s.github/workflows/deploy.yml
Backend APIStartup probe failure threshold/period15 failures / 10s.github/workflows/deploy.yml

The backend is capped at one serving instance because it keeps a local libSQL cache/index and runs in-process workers. Multi-replica scale-out would duplicate worker execution and create per-replica cache divergence. Horizontal backend scaling is blocked until the serving path and worker path are split or coordinated.

Request And User Quotas ​

Config keyDefaultBoundsUsed for
BASELINE_RATE_LIMIT_PER_MINUTE6001-1000Rolling per-client limit for most API routes
EXPENSIVE_RATE_LIMIT_PER_MINUTE1201-1000Rolling per-client limit for AI, chat, search writes, and streams
ANONYMOUS_CHAT_QUOTA301-1000Anonymous chat messages per visitor
USER_IDLE_TIMEOUT_SECS900positive intWorker idle gate after the last user request
BACKEND_CORS_ALLOWED_ORIGINSlocal originsstring listAccepted browser origins
OPERATOR_EMAIL_ALLOWLISTemptystring listLocal accounts with backend operator role

The rate limiter is process-local. It protects one backend instance. Shared rate limiting is tracked as a security hardening gap.

Cooldowns ​

LimitValue / config keyUsed for
Cloud model cooldownOLLAMA_CLOUD_COOLDOWN_SECS, default 432000 secondsBackoff after cloud model rate-limit responses
YouTube quota cooldown86400 secondsBackoff after YouTube Data API quota errors
Transcript dependency cooldown3600 secondsBackoff after temporary transcript failures

Model And Tool Concurrency ​

LaneLimitNotes
Local summary/evaluator/chat/guardrail/planner calls1 concurrent requestCloud-tagged models skip this local semaphore
Search embedding/rerank/HyDE calls1 concurrent requestReserved for future semantic search work
Object-store operations12 concurrent operationsShared object-store helper semaphore
Chat tool loop4 stepsRegular chat turn
Chat tool loop, deep research6 stepsDeep research chat turn
Chat model calls per turn12 callsRegular chat turn
Chat model calls per turn, deep research24 callsDeep research chat turn

Worker Cadence And Batch Limits ​

WorkerActive cadenceIdle cadenceBatch / scan limit
Queue worker5sbacks off from 15s to 60s4 videos
Refresh worker30msame as activesource-dependent
Gap scan worker10msame as active8 videos per channel
Summary evaluation worker7sbacks off from 30s to 120s4 summaries
Search backfillsearch workersearch worker64 sources
Search indexing3sbacks off from 15s to 120s8 sources
Search reconcile60ssearch worker64 sources
Search prunesearch workersearch worker256 sources
Vector-index retrydisabledsearch workersemantic vector search is disabled

All worker loops skip scheduled work when there is no recent user activity.

The summary evaluation worker reads every stored summary only in a full scan. It keeps the list of summaries that need an evaluation and works through it. A new full scan runs only after the list is used up, and only when the number of stored summaries changed or 30m passed since the last scan. Between scans, each round costs one listing call.

Scheduled Catch-Up ​

SettingValueSource
Scheduleevery 4 hours (0 */4 * * *, UTC)terraform/scheduler.tf
Run lengthuntil no transcript or summary is pending, at most 10mbackend/src/handlers/catch_up
Progress checkevery 15sbackend/src/handlers/catch_up
Scheduler deadline900s, no retriesterraform/scheduler.tf

Each run marks the backend as active, refreshes every channel, and keeps the request open so Cloud Run allocates CPU while the queue worker processes pending videos. Only one run happens at a time.

Content Processing Limits ​

LimitValueUsed for
Queue distillation retries3Transcript and summary processing attempts
Summary auto-regeneration attempts2Low-quality summary regeneration
Unusable evaluator answers3Failed evaluations before "Unscorable"
Transcript formatting attempts5Model-assisted transcript cleaning
Transcript formatting hard timeout270sTranscript cleaning
Description-like transcript threshold1000 wordsYouTube transcript fallback detection

Search Limits ​

LimitValueUsed for
Transcript target chunk size300 wordsSearch projection chunking
Transcript chunk overlap40 wordsSearch projection chunking
Transcript chunks per source80 maxSearch projection chunking
Summary target chunk size300 wordsSearch projection chunking
Summary chunks per source80 max, including full-document chunkSearch projection chunking
Embedding dimensionsdisabledSemantic search placeholder
Embedding batch sizedisabledSemantic search placeholder
Embedding request timeoutdisabledSemantic search placeholder
HyDE timeoutdisabledSemantic search placeholder
Rerank timeoutdisabledSemantic search placeholder
Rerank candidate capdisabledSemantic search placeholder
FTS query term cap4 termsKeyword search parser
Snippet window420 charactersSearch result excerpts
Search result limitdefault 8, clamped 1-25 video groups/api/search
Hybrid FTS candidatesdisabledSemantic search placeholder
Keyword FTS candidateslimit * 2, clamped 10-50Keyword-only leg
ANN semantic candidatesdisabledSemantic search placeholder
Exact semantic candidatesdisabledSemantic search placeholder

Chat Limits ​

LimitValueUsed for
Fact source budget6Specific lookup intent
Synthesis source budget12Cross-video synthesis intent
Recommendation source budget14Best/worth-watching intent
Comparison source budget20Comparison intent
Pattern source budget24Corpus-wide pattern intent
Deep research source budget48Maximum selected sources
Recent activity source budget12Recent activity intent
Recent activity video limit6Recent activity intent
Retrieval passes3Multi-pass chat retrieval
Queries per pass3 regular, 5 deep researchQuery planning
Queries per turn5Query planning
Deep research primary queries6Query planning
Deep research expansion queries8Query planning
Retrieval candidate limitmin 8, max 48Candidate selection
Synthesis videos6Final answer context
Synthesis chunks per video3Final answer context
Source excerpt size1200 charactersFinal answer context
Chat context text size1400 charactersCandidate ranking context
Conversation history in prompt12 messagesChat answer context
Stored conversation messages200 messagesStorage validation and trimming
Stored conversation payload500000 charactersStorage validation and trimming
User message size12000 charactersRequest validation
Stored sources per message48 sourcesStorage validation and trimming
Conversation title80 charactersTitle generation and validation
Planner context6000 charactersPlanning prompt
Classifier timeout15sChat intent classification
Mention scope timeout5sChat mention resolution
Stream timeout30mChat response streaming
Stream retry attempts3Chat response streaming

CHAT_MULTI_PASS_ENABLED=false disables multi-pass retrieval and keeps chat to the first retrieval pass.

Local ASR Limits ​

Config keyDefaultUsed for
LOCAL_ASR_MAX_AUDIO_BYTES262144000Maximum podcast audio download size
LOCAL_ASR_TIMEOUT_SECS3600Download and transcription request timeout

Billing Alert Budgets ​

Config keyDefaultUsed for
billing_budget_app_monthly_amount_units5Monthly all-service alert budget
billing_budget_cloud_run_monthly_amount_units3Monthly Cloud Run service-scoped alert budget
billing_budget_cloud_storage_monthly_amount_units1Monthly Cloud Storage service-scoped alert budget
billing_budget_thresholds50%, 80%, 100% actual, 100% forecastedAlert thresholds

Billing budgets are alerts only. They do not cap, stop, or throttle spend.