Hydr473 commited on
Commit
c41ab72
·
1 Parent(s): 1046c2a

Allow shipping pre-built council cache in env Space for instant UI

Browse files

- .gitignore: keep ignoring runtime cache writes but allow committing
.cache/council/<role>/base/ entries (the demo bundle for the 3 tasks).
- Dockerfile: COPY .cache/ into the env Space image so the running
container has 301 pre-warmed specialist votes for task_easy. Every UI
button click hits cache, no LLM round-trip, instant response.

Run scripts/precache_endpoint.py --tasks task_easy locally with the HF
endpoint env vars set, then 'git add -f .cache/' to bundle the votes.

Files changed (2) hide show
  1. .gitignore +7 -2
  2. Dockerfile +4 -0
.gitignore CHANGED
@@ -32,8 +32,13 @@ coverage.xml
32
  .nox/
33
 
34
  # --- Stocker runtime artifacts --------------------------------------------
35
- # council vote cache (specialist + moderator)
36
- .cache/
 
 
 
 
 
37
  # GRPO runs, eval rollouts, plots, LoRA adapters
38
  training/runs/
39
  !training/runs/.gitkeep
 
32
  .nox/
33
 
34
  # --- Stocker runtime artifacts --------------------------------------------
35
+ # Council cache: ignore everything under .cache/ EXCEPT the demo bundle
36
+ # (specialists/base for the 3 stable tasks). Allows shipping a warm cache
37
+ # in the env Space so judges' UI clicks hit instant responses.
38
+ .cache/*
39
+ !.cache/council/
40
+ .cache/council/*/lora_*/
41
+ .cache/moderator/
42
  # GRPO runs, eval rollouts, plots, LoRA adapters
43
  training/runs/
44
  !training/runs/.gitkeep
Dockerfile CHANGED
@@ -24,6 +24,10 @@ COPY server/ /app/server/
24
  COPY data/ /app/data/
25
  COPY inference.py client.py README.md /app/
26
 
 
 
 
 
27
  # Pull in the built frontend so FastAPI mounts the React SPA at /web
28
  COPY --from=frontend-builder /frontend/dist /app/frontend/dist
29
 
 
24
  COPY data/ /app/data/
25
  COPY inference.py client.py README.md /app/
26
 
27
+ # Pre-built council cache — gives judges instant UI responses for the 3
28
+ # stable tasks. Optional: COPY only fires if .cache/ exists in build context.
29
+ COPY .cache/ /app/.cache/
30
+
31
  # Pull in the built frontend so FastAPI mounts the React SPA at /web
32
  COPY --from=frontend-builder /frontend/dist /app/frontend/dist
33