Repository navigation
Expand file tree
/
Copy pathrender.yaml
More file actions
168 lines (162 loc) · 6.48 KB
/
Copy pathrender.yaml
File metadata and controls
168 lines (162 loc) · 6.48 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
# 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: "4000"
- key: TIMEOUT_SECONDS
value: "30"
# 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-4-6
- key: CLAIMS_MODEL
value: gpt-5.4-mini
- key: ACCURACY_MODEL
value: claude-sonnet-4-6
- key: EVAL_MODEL_OPENAI
value: gpt-5.4-mini
- key: EVAL_MODEL_ANTHROPIC
value: claude-sonnet-4-6
- key: QUERY_EXPANSION_MODEL
value: gpt-4.1-nano
# Performance
- key: ENABLE_CACHING
value: "true"
- key: LOG_LEVEL
value: INFO
- 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"
# 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"
# 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
# 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
pullRequestPreviewsEnabled: true
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). This works
# without a cyclic dependency because the backend defaults CORS to
# "*" and does not reference this frontend's URL (one-directional).
- key: NEXT_PUBLIC_API_URL
fromService:
name: pydantic-agents-workflows-api
type: web
envVarKey: RENDER_EXTERNAL_URL
routes:
- type: rewrite
source: /*
destination: /index.html