-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy path.env.example
More file actions
188 lines (173 loc) · 6.73 KB
/
Copy path.env.example
File metadata and controls
188 lines (173 loc) · 6.73 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
# ===========================================
# CodebaseQA Environment Configuration
# ===========================================
# Never commit .env to version control!
#
# WHERE THIS FILE GOES depends on how you run the app -- the two are different:
#
# Local dev: apps/api/.env
# config.py loads env_file=".env" relative to the working directory,
# and the README starts uvicorn from apps/api.
#
# Docker: docker/.env
# docker-compose.yml expands ${VAR} from the file next to itself.
# A .env at the repo root is NOT picked up for that interpolation.
#
# -----------------------
# LLM Providers (at least one required)
# -----------------------
# Leave commented until you have a real key: a placeholder is still a non-empty
# value, so the app would believe it is configured and fail only on first use.
# OPENAI_API_KEY=sk-...
# ANTHROPIC_API_KEY=sk-ant-...
# For local LLM (optional, no key needed)
# OLLAMA_BASE_URL=http://localhost:11434
# -----------------------
# Azure OpenAI (optional)
# -----------------------
# Uses Azure's v1 OpenAI-compatible surface, so the standard OpenAI client talks to
# it directly -- the endpoint below is normalised to <endpoint>/openai/v1 for you.
#
# The two things that differ from public OpenAI:
# 1. You pass DEPLOYMENT NAMES, not model ids. Azure sends the deployment name
# where a model id normally goes.
# 2. Because a deployment name is not a model id, tiktoken cannot derive an
# encoding from it. Name the underlying model in AZURE_OPENAI_TOKENIZER_MODEL
# so token counting (used for truncation and batch splitting) stays exact.
#
# LLM_PROVIDER=azure_openai
# EMBEDDING_PROVIDER=azure_openai
# AZURE_OPENAI_ENDPOINT=https://my-resource.openai.azure.com
# AZURE_OPENAI_API_KEY=...
# AZURE_OPENAI_DEPLOYMENT=my-gpt4o-deployment
# AZURE_OPENAI_EMBEDDING_DEPLOYMENT=my-embedding-deployment
# AZURE_OPENAI_TOKENIZER_MODEL=text-embedding-3-small
#
# Set this to your deployed embedding model's output size, or Chroma will reject the
# insert: text-embedding-3-small is 1536, text-embedding-3-large is 3072.
# OPENAI_EMBEDDING_DIMENSIONS=1536
# -----------------------
# Neo4j graph read model (optional)
# -----------------------
# Off by default. SQL (code_dependencies) stays authoritative; Neo4j is a projection
# rebuilt at index time, and reads fall back to SQL when it is unreachable.
# Enables transitive traversals the SQL path cannot do: blast radius, shortest path
# between two files, and import-cycle detection.
#
# Do NOT use AuraDB Free for a public demo: it auto-pauses after 72h idle and a paused
# instance's hostname stops resolving, so the graph silently degrades to SQL.
# NEO4J_ENABLED=false
# NEO4J_URI=bolt://localhost:7687
# NEO4J_USER=neo4j
# NEO4J_PASSWORD=
# NEO4J_DATABASE=
# -----------------------
# Embedding Providers
# -----------------------
# Uses OpenAI by default. Uncomment to use alternatives:
# EMBEDDING_PROVIDER=openai # openai, azure_openai, or ollama
# LLM_PROVIDER=openai # openai, azure_openai, anthropic, or ollama
# OPENAI_EMBEDDING_MAX_TOKENS_PER_REQUEST=250000
# OPENAI_EMBEDDING_MAX_TEXTS_PER_REQUEST=128
# OPENAI_EMBEDDING_REQUEST_CONCURRENCY=1
# OPENAI_EMBEDDING_MIN_SECONDS_BETWEEN_REQUESTS=0.0
# OPENAI_EMBEDDING_RATE_LIMIT_MAX_RETRIES=6
# OPENAI_EMBEDDING_RATE_LIMIT_BASE_BACKOFF_SECONDS=1.0
# OPENAI_EMBEDDING_RATE_LIMIT_MAX_BACKOFF_SECONDS=30.0
# Ollama TAG (as in `ollama pull <tag>`), never a HuggingFace repo id. A HF id such as
# nomic-ai/nomic-embed-text-v1.5 404s on every request, and fail-open then lands every
# chunk in the index as a zero vector -- which scores every chunk identically.
# LOCAL_EMBEDDING_MODEL=nomic-embed-text
# -----------------------
# GitHub (optional, for private repos)
# -----------------------
# GITHUB_TOKEN=ghp_...
# -----------------------
# Database
# -----------------------
# Defaults to SQLite. Uncomment for PostgreSQL:
DATABASE_URL=sqlite:///./data/codebaseqa.db
# DATABASE_URL=postgresql://user:pass@localhost:5432/codebaseqa
# -----------------------
# Vector Database
# -----------------------
VECTOR_DB_TYPE=chroma
# VECTOR_DB_TYPE=qdrant
# QDRANT_URL=http://localhost:6333
# Optional Redis (recommended for distributed cache/rate-limits)
# REDIS_URL=redis://localhost:6379/0
# -----------------------
# Application Settings
# -----------------------
DEBUG=false
CORS_ORIGINS=http://localhost:3000,http://127.0.0.1:3000
# -----------------------
# Live Demo Mode (optional)
# -----------------------
DEMO_MODE=false
SEED_DEMO=false
DEMO_REPO_URL=https://github.com/vercel/nextjs-subscription-payments
DEMO_REPO_OWNER=vercel
DEMO_REPO_NAME=nextjs-subscription-payments
DEMO_REPO_BRANCH=main
DEMO_ALLOW_PUBLIC_IMPORTS=false
DEMO_BANNER_TEXT=Live demo mode: this deployment is pinned to one featured repository. For your own repository, self-host with your API key.
DEMO_BUSY_MODE=false
# Soft guardrails for public demo traffic
DEMO_RATE_LIMIT_ENABLED=true
DEMO_RATE_LIMIT_COOLDOWN_SECONDS=30
DEMO_CHAT_REQUESTS=18
DEMO_CHAT_WINDOW_SECONDS=60
DEMO_CURRICULUM_REQUESTS=6
DEMO_CURRICULUM_WINDOW_SECONDS=60
DEMO_LESSON_REQUESTS=8
DEMO_LESSON_WINDOW_SECONDS=60
DEMO_GRAPH_REQUESTS=5
DEMO_GRAPH_WINDOW_SECONDS=60
DEMO_CHALLENGE_REQUESTS=10
DEMO_CHALLENGE_WINDOW_SECONDS=60
# Graph V2 settings
# GRAPH_V2_ENABLED=true
# GRAPH_V2_MAX_NODES=160
# GRAPH_V2_MAX_EDGES=600
# GRAPH_V2_ENRICH_DESCRIPTIONS=false
# GRAPH_DENSE_MODE_V21=true
# GRAPH_V21_AUTO_NODES_THRESHOLD=90
# GRAPH_V21_AUTO_EDGES_THRESHOLD=240
# GRAPH_V21_SCOPE_MAX_NODES=220
# GRAPH_V21_SCOPE_MAX_EDGES=420
# GRAPH_V21_MODULE_MAX_NODES=120
# GRAPH_V21_MODULE_MAX_EDGES=260
# GRAPH_V21_CACHE_TTL_SECONDS=45
# GRAPH_V21_CACHE_MAX_ENTRIES=64
# GRAPH_V21_EDGE_BUDGET_FILE_PER_NODE=10
# GRAPH_V21_EDGE_BUDGET_MODULE_PER_NODE=14
# GRAPH_V22_MIN_CROSS_MODULE_RATIO_FOR_OVERVIEW=0.08
# GRAPH_V22_MIN_CROSS_MODULE_EDGES_FOR_OVERVIEW=18
# GRAPH_V22_MODULE_FILTER_ORPHANS=false
# Frontend Graph V2.1 gate
# NEXT_PUBLIC_GRAPH_DENSE_MODE_V21=true
# Set to false for strict file-first fallback during rollback:
# NEXT_PUBLIC_GRAPH_DENSE_MODE_V21=false
# -----------------------
# Chat Hardening (Quality + Scalability)
# -----------------------
# CHAT_INTENT_ROUTING_ENABLED=true
# CHAT_CONTENT_RERANK_ENABLED=true
# CHAT_DOCS_FIRST_OVERVIEW_ENABLED=true
# CHAT_INTENT_LLM_TIEBREAK_ENABLED=true
# CHAT_EMIT_META_EVENT=true
# CHAT_HISTORY_MAX_MESSAGES=20
# CHAT_HISTORY_MAX_TOKENS=1800
# CHAT_CONTEXT_MAX_CHARS=18000
# CHAT_RETRIEVAL_CANDIDATE_LIMIT=24
# CHAT_RERANK_CANDIDATE_LIMIT=18
# CHAT_REQUEST_TIMEOUT_SECONDS=90
# CHAT_CONCURRENCY_WAIT_SECONDS=2.0
# CHAT_MAX_CONCURRENT_PER_REPO=4
# CHAT_REDIS_CACHE_ENABLED=false
# CHAT_RETRIEVAL_CACHE_TTL_SECONDS=600
# CHAT_ANSWER_CACHE_TTL_SECONDS=1800
# CHAT_EMBED_CACHE_TTL_SECONDS=3600
# Demo rate-limit backend
# RATE_LIMIT_REDIS_ENABLED=true