User upgraded the HF Space to nvidia-t4-small (HF Pro). Production
image variant from the spine HEAD:
- Base: nvidia/cuda:12.4.1-cudnn-runtime-ubuntu22.04
- Ollama installer auto-detects GPU, dispatches CUDA build
- Granite 4.1:8b pulled at *runtime* (HF build sandbox can't fit
8B + EO toolchain alongside torch); ~2 min cold start, then
OLLAMA_KEEP_ALIVE=24h holds it resident
- 3b alias remapped to 8b via RIPRAP_OLLAMA_3B_TAG so the planner
+ reconciler both run on 8b (full quality, single warm model)
- Flash attention + KV cache q8_0 for ~2x throughput on T4
- Pre-warm 8b into VRAM in entrypoint so the first reconcile
doesn't pay the ~30s model-load tax
EO toolchain (Phase 1 Prithvi live + Phase 4 TerraMind synthesis)
runtime-installs into $HOME/.eo-pkgs (build-sandbox couldn't fit
it). If the install fails, the lazy-import in those specialists
returns 'skipped' cleanly and the other 14 specialists run normally.
Inference drops from ~60-180s on cpu-basic…
Dockerfile: CPU-tuned env for HF Spaces cpu-basic
cpu-basic doesn't have disk for both 3b + 8b alongside torch + EO
deps. Alias the 8b reconciler calls to 3b via RIPRAP_OLLAMA_8B_TAG so
the polished planner/Mellea/intents pipeline runs end-to-end.
RIPRAP_LLM_PRIMARY=ollama — explicit (default)
RIPRAP_OLLAMA_8B_TAG=granite4.1:3b — 8b alias remap
RIPRAP_MELLEA_MAX_ATTEMPTS=2 — fewer rerolls on slow CPU
OLLAMA_NUM_PARALLEL=1 — don't load a 2nd 3b copy
Reconciler quality drops vs 8b; the AMD MI300X vLLM path
(RIPRAP_LLM_PRIMARY=vllm) is the speed/quality lever for the demo.
`pkill -f "ollama serve"` was matching the parent shell's command
line (since the RUN step itself contains the substring), killing the
build with SIGTERM and exit 143. Switch to capturing the daemon PID
explicitly and `kill $PID`. Also wait the daemon out properly
instead of the optimistic sleep.
Dockerfile: add zstd for Ollama installer + procps for entrypoint pkill
Ollama's install.sh extracts a .tar.zst archive on amd64 — base
python:3.12-slim doesn't have zstd, install fails silently. procps
provides pkill, which the entrypoint uses if it needs to restart
the daemon.
Caught on the first HF Spaces build attempt.
The first deployable image: Python 3.12 base, full pip deps,
Ollama + granite4.1:3b baked in (~10 GB total), entrypoint starts
Ollama daemon in the background then uvicorn on port 7860.
helios_nyc.py is a small CLI probe for sanity-checking the
container locally — it walks the FSM end-to-end against a single
hard-coded address before any web traffic. Will get scrubbed once
agent.py covers the same role.