rohitsar567 commited on
Commit
00a1aed
Β·
verified Β·
1 Parent(s): 13779e8

Deploy: Stack A (NIM brain + Maverick judge + Sarvam voice). D-019.

Browse files
Files changed (2) hide show
  1. .env.example +26 -8
  2. backend/main.py +5 -4
.env.example CHANGED
@@ -1,15 +1,33 @@
1
  # Copy this to .env and fill in. Do NOT commit .env.
2
 
3
- # Primary provider β€” Sarvam (STT, TTS, LLM)
4
  SARVAM_API_KEY=sk_your_sarvam_api_key_here
5
 
6
- # Embeddings β€” Voyage AI (Anthropic's recommended partner)
 
7
  VOYAGE_API_KEY=pa-your_voyage_key_here
8
 
9
- # Grader / self-critique β€” Groq (Llama-3.3-70B, free tier, OpenAI-compatible API)
10
- # Used for eval harness AND as a fallback brain (router escalates here for complex queries).
11
- GROQ_API_KEY=gsk_your_groq_api_key_here
 
 
12
 
13
- # Fallback brain β€” OpenRouter (DeepSeek-V3 671B, currently SOTA open-source)
14
- # Used by router for complex multi-policy reasoning queries.
15
- OPENROUTER_API_KEY=sk-or-v1-your_openrouter_key_here
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  # Copy this to .env and fill in. Do NOT commit .env.
2
 
3
+ # Voice + Indic translation β€” Sarvam AI (STT, TTS, Indic translation)
4
  SARVAM_API_KEY=sk_your_sarvam_api_key_here
5
 
6
+ # (legacy β€” embeddings now run locally via BGE-small; this is kept only for back-compat
7
+ # with old extracted/ artifacts.)
8
  VOYAGE_API_KEY=pa-your_voyage_key_here
9
 
10
+ # NVIDIA NIM β€” single provider for the entire reasoning stack:
11
+ # Brain = qwen/qwen3-next-80b-a3b-instruct (Qwen 80B, primary)
12
+ # Judge = mistralai/mistral-large-3-675b-instruct-2512 (Mistral Large 3, different family from brain)
13
+ # Free tier: 40 req/min, no daily cap, no card. Get a key at https://build.nvidia.com.
14
+ NVIDIA_NIM_API_KEY=nvapi-your_nim_key_here
15
 
16
+ # Hugging Face β€” used by tools/upload_*.py for Space + dataset sync
17
+ HF_TOKEN=hf_your_token_here
18
+
19
+ # ---------------------------------------------------------------------------
20
+ # Admin control panel (LLM control UI)
21
+ # ---------------------------------------------------------------------------
22
+ # The /admin/llm-control.html page + /api/admin/* endpoints are HIDDEN from
23
+ # non-allowlisted callers. BOTH gates must pass:
24
+ # 1. Client IP must match one of the IPs in ADMIN_IP_ALLOWLIST (comma-sep)
25
+ # 2. Request must include header X-Admin-Password matching ADMIN_PASSWORD
26
+ # Unauthorized requests get 404 (not 401) so the existence of /api/admin/* is
27
+ # concealed. Set BOTH or admin endpoints are disabled by default.
28
+
29
+ # Find your public IP at https://api.ipify.org (run from where you'll use admin)
30
+ ADMIN_IP_ALLOWLIST=your.public.ip.here
31
+
32
+ # A strong unique passphrase. Min 16 chars recommended. Keep out of git.
33
+ ADMIN_PASSWORD=replace_with_a_strong_random_passphrase
backend/main.py CHANGED
@@ -194,11 +194,12 @@ async def _startup_llm_health_probe():
194
  @app.get("/api/health", response_model=HealthResponse)
195
  async def health():
196
  missing = settings.validate()
 
 
 
197
  providers_ok = {
198
- "sarvam": bool(settings.SARVAM_API_KEY),
199
- "voyage": bool(settings.VOYAGE_API_KEY),
200
- "groq": bool(settings.GROQ_API_KEY),
201
- "openrouter": bool(settings.OPENROUTER_API_KEY),
202
  }
203
  return HealthResponse(
204
  status="ok" if not missing else "degraded",
 
194
  @app.get("/api/health", response_model=HealthResponse)
195
  async def health():
196
  missing = settings.validate()
197
+ # Post-D-019 the stack is Sarvam (voice + Indic) + NVIDIA NIM (brain +
198
+ # judge). GROQ + OpenRouter were retired; don't reference them here or
199
+ # this endpoint AttributeError's on every call.
200
  providers_ok = {
201
+ "sarvam": bool(settings.SARVAM_API_KEY),
202
+ "nvidia_nim": bool(settings.NVIDIA_NIM_API_KEY),
 
 
203
  }
204
  return HealthResponse(
205
  status="ok" if not missing else "degraded",