vxkyyy commited on
Commit
8b30743
Β·
1 Parent(s): 2694ac9

fix: point Vercel frontend to HF Space backend

Browse files

- web/.env.production: VITE_API_BASE_URL=https://vxkyyy-agentIC.hf.space
- web/.gitignore: allow .env.production to be committed
- server/api.py: add LLM pre-flight check in POST /build (503 instead of silent failure)
- requirements.txt: remove unused streamlit/plotly/gdstk deps (faster Docker build)

Files changed (4) hide show
  1. requirements.txt +5 -6
  2. server/api.py +9 -0
  3. web/.env.production +2 -0
  4. web/.gitignore +1 -0
requirements.txt CHANGED
@@ -1,13 +1,12 @@
 
1
  crewai
2
  crewai-tools
3
  langchain_openai
 
 
4
  typer
5
  rich
6
  python-dotenv
7
- streamlit
8
- pandas
9
- streamlit-option-menu
10
- plotly
11
- streamlit-ace
12
- gdstk
13
  httpx
 
1
+ # ── Core AI agent framework ──────────────────────────────────────────
2
  crewai
3
  crewai-tools
4
  langchain_openai
5
+
6
+ # ── CLI & Logging ─────────────────────────────────────────────────────
7
  typer
8
  rich
9
  python-dotenv
10
+
11
+ # ── Server runtime ────────────────────────────────────────────────────
 
 
 
 
12
  httpx
server/api.py CHANGED
@@ -938,6 +938,15 @@ async def trigger_build(req: BuildRequest, profile: dict = Depends(get_current_u
938
  check_build_allowed(profile)
939
  byok_key = get_llm_key_for_user(profile)
940
 
 
 
 
 
 
 
 
 
 
941
  # Sanitize design name β€” Verilog identifiers cannot start with a digit
942
  import re as _re
943
  design_name = req.design_name.strip().lower()
 
938
  check_build_allowed(profile)
939
  byok_key = get_llm_key_for_user(profile)
940
 
941
+ # ── LLM pre-flight: fail fast with a clear message ──
942
+ try:
943
+ _get_llm(byok_api_key=byok_key)
944
+ except RuntimeError as e:
945
+ raise HTTPException(
946
+ status_code=503,
947
+ detail=str(e) + " Set NVIDIA_API_KEY in HuggingFace Space secrets.",
948
+ )
949
+
950
  # Sanitize design name β€” Verilog identifiers cannot start with a digit
951
  import re as _re
952
  design_name = req.design_name.strip().lower()
web/.env.production ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ # Production β€” HuggingFace Space backend
2
+ VITE_API_BASE_URL=https://vxkyyy-agentIC.hf.space
web/.gitignore CHANGED
@@ -14,6 +14,7 @@ dist-ssr
14
  .env
15
  .env.*
16
  !.env.example
 
17
 
18
  # Editor directories and files
19
  .vscode/*
 
14
  .env
15
  .env.*
16
  !.env.example
17
+ !.env.production
18
 
19
  # Editor directories and files
20
  .vscode/*