Repository navigation
Expand file tree
/
Copy pathrender.yaml
More file actions
201 lines (194 loc) · 7.82 KB
/
Copy pathrender.yaml
File metadata and controls
201 lines (194 loc) · 7.82 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
# Preview environments are off, so pull requests do not create copies that
# spend the deployer's API keys.
previews:
generation: "off"
# Reusable environment variable groups.
#
# `pydantic-agents-workflows-pipeline` holds the Q&A pipeline config
# (LLM/Logfire secrets, thresholds, model selection). The API gateway and the
# Workflows service both use it, because both run `backend.config.Settings`.
#
# `pydantic-agents-workflows-pipeline-trigger` holds the Render API key that
# the gateway and the ingest cron use to start and poll workflow runs.
envVarGroups:
- name: pydantic-agents-workflows-pipeline
envVars:
# Secrets — prompted once on first apply (no defaults in backend/config.py)
- key: OPENAI_API_KEY
sync: false
- key: ANTHROPIC_API_KEY
sync: false
- key: LOGFIRE_TOKEN
sync: false
- key: LOGFIRE_READ_TOKEN
sync: false
# Pipeline configuration
- key: MAX_TOKENS
value: "5000"
# RAG configuration
- key: RAG_TOP_K
value: "20"
- key: SIMILARITY_THRESHOLD
value: "0.3"
- key: VERIFICATION_THRESHOLD
value: "0.30"
- key: EMBEDDING_MODEL
value: text-embedding-3-small
- key: EMBEDDING_DIMENSIONS
value: "1536"
# Model selection
- key: ANSWER_MODEL
value: claude-sonnet-5-5
- key: CLAIMS_MODEL
value: gpt-5.4-mini
- key: ACCURACY_MODEL
value: claude-sonnet-5-5
- key: EVAL_MODEL_OPENAI
value: gpt-5.4-mini
- key: EVAL_MODEL_ANTHROPIC
value: claude-sonnet-5-5
- key: QUERY_EXPANSION_MODEL
value: gpt-5.4-nano
# Performance
- key: LOG_LEVEL
value: INFO
# Public demo mode. Keep "false" for a normal deploy. See the README
# "Demo mode" section. The limits apply only when DEMO is "true".
# A limit of "0" turns that limit off.
- key: DEMO
value: "false"
- key: DEMO_RATE_LIMIT_PER_MINUTE
value: "3"
- key: DEMO_MAX_QUESTIONS_PER_VISITOR
value: "10"
- key: DEMO_DAILY_QUESTION_LIMIT
value: "200"
- name: pydantic-agents-workflows-pipeline-trigger
envVars:
- key: RENDER_API_KEY
sync: false
projects:
- name: pydantic-agents-workflows
environments:
- name: production
# PostgreSQL database with pgvector extension
databases:
- name: pydantic-agents-workflows-db
databaseName: pydantic_agents_db
user: pydantic_agents_user
plan: basic-1gb
region: oregon
postgresMajorVersion: "18"
# No connections from the public internet. Services in this
# region connect over the private network. Add your own IP here
# to run the ingest scripts from your computer.
ipAllowList: []
# Services in the production environment
services:
# Render Workflows service. Runs the Q&A pipeline and ingestion
# tasks. The gateway and the ingest cron start runs on it.
- type: workflow
name: pydantic-agents-workflows
runtime: python
region: oregon
buildCommand: uv sync --no-dev --frozen
startCommand: uv run render-workflows workflows.app:app
envVars:
- fromGroup: pydantic-agents-workflows-pipeline
- key: DATABASE_URL
fromDatabase:
name: pydantic-agents-workflows-db
property: connectionString
# Match .python-version and uv.lock
- key: PYTHON_VERSION
value: "3.13"
# Send spans every 500 ms so that short chained runs do not
# end before their spans are exported.
- key: OTEL_BSP_SCHEDULE_DELAY
value: "500"
# Backend API gateway (FastAPI + Logfire).
# Starts and polls runs on the Workflows service above.
- type: web
name: pydantic-agents-workflows-api
runtime: python
plan: starter
region: oregon
buildCommand: uv sync --no-dev --frozen
startCommand: uv run uvicorn backend.main:app --host 0.0.0.0 --port $PORT
# Refresh live RAG sources on every deploy via the consolidated,
# data-driven ingest entrypoint (no Render Workflows). Ingests all
# sources in data/sources.py: pricing, autoscaling, nodejs,
# workflows_docs, workflows_tutorial, tutorials_index.
preDeployCommand: uv run python data/scripts/ingest_pages.py
healthCheckPath: /health
envVars:
# Shared pipeline config + secrets (also linked to the Workflows service)
- fromGroup: pydantic-agents-workflows-pipeline
# Render API key (shared with the ingest cron)
- fromGroup: pydantic-agents-workflows-pipeline-trigger
- key: WORKFLOW_SLUG
fromService:
name: pydantic-agents-workflows
type: workflow
property: slug
# Database connection (auto-injected from database)
- key: DATABASE_URL
fromDatabase:
name: pydantic-agents-workflows-db
property: connectionString
# Allow browser requests only from the frontend. A Blueprint
# cannot read a static site's public URL, so set this to the
# frontend URL after the first deploy. See the README.
- key: CORS_ORIGINS
sync: false
# Ingestion refresh cron — triggers the Workflow's `ingest_all`
# fan-out on a schedule (Workflows have no built-in scheduling).
- type: cron
name: pydantic-agents-workflows-ingest
runtime: python
plan: starter
region: oregon
schedule: "0 6 * * *" # daily at 06:00 UTC
buildCommand: uv sync --no-dev --frozen
startCommand: uv run python workflows/trigger_ingest.py
envVars:
- fromGroup: pydantic-agents-workflows-pipeline-trigger
- key: WORKFLOW_SLUG
fromService:
name: pydantic-agents-workflows
type: workflow
property: slug
# Frontend (Next.js Static Site)
- type: web
runtime: static
name: pydantic-agents-workflows-frontend
rootDir: frontend
buildCommand: rm -rf node_modules/.cache .next out && npm ci && npm run build
staticPublishPath: out
headers:
- path: /*
name: X-Content-Type-Options
value: nosniff
- path: /*
name: Referrer-Policy
value: strict-origin-when-cross-origin
- path: /*
name: X-Frame-Options
value: DENY
envVars:
# API URL - auto-injected from the backend service's public URL.
# `fromService` + `envVarKey` pulls Render's auto-injected
# RENDER_EXTERNAL_URL (https://<slug>-XXXX.onrender.com), resolved
# at build time before this static site builds — so NEXT_PUBLIC_API_URL
# is baked into the bundle with the real, suffix-included URL (no
# manual post-deploy step, no guessing the -XXXX suffix). The API
# needs this site's URL in CORS_ORIGINS, which you set by hand.
- key: NEXT_PUBLIC_API_URL
fromService:
name: pydantic-agents-workflows-api
type: web
envVarKey: RENDER_EXTERNAL_URL
routes:
- type: rewrite
source: /*
destination: /index.html