Spaces:
Runtime error
Runtime error
Commit History
-
Add links to blog, video, social post, and HF spaces to README
5bdb0c0 -
Update README link to build-small-hackathon org
8c32ccb -
Update LICENSE
Verified signature5afb890 -
Add MIT license
dfb673f -
Clean repo, update README, improve .gitignore for hackathon
3ffe872 -
Fix AI insight leaking thinking content + make insights on-demand instead of auto-generated
9cbb438 -
Fix: detect and strip Nemotron reasoning narration (model talking to itself) from AI output
63016d2 -
Fix AI output: aggressively strip thinking tags, markdown, field prefixes from all LLM responses
2e1ad6a -
Fix CSS: serve self-contained HTML via ASGI wrapper to bypass Gradio
1984ea6 -
Fix: use sdk docker for Python 3.11 compatibility, relax gradio version
c60aec7 -
UX overhaul + Gradio migration + remove llama.cpp
e6970ed
-
fix: show CLOUD GPU status instead of offline, strip orphan </think> tags, increase Modal timeout to 180s
4976ef6 -
cache bust to force clean HF rebuild
efe44de -
Remove llama-cpp-python and lighten Dockerfile; Modal handles inference
e4749c9 -
Add Modal GPU inference support for faster LLM responses
ad0ab13 -
fix: restore llama.cpp with source build, use fine-tuned GGUF model
7e810ce -
fix: switch to microsoft/Phi-3-mini-4k-instruct (Gemma 2B down, LoRA not on serverless API)
1c45b4e -
feat: add HF Inference API with LoRA model, deterministic fallback
724f227 -
refactor: remove llama-cpp entirely, use deterministic mock-only mode
a7789ad -
fix: force llama-cpp-python source build to fix musl/glibc mismatch on HF Spaces
84753ae -
fix: cache bust Docker layer to force libgomp1/libgfortran5 install
bae9351 -
fix: install libgomp1 + libgfortran5 so the prebuilt llama-cpp wheel can load
The Space was failing at runtime with: RuntimeError: Failed to load shared library '/usr/local/lib/python3.11/site-packages/llama_cpp/lib/llama.so' The prebuilt llama-cpp-python CPU wheel ships libllama.so, which dynamically links against: - libgomp.so.1 (OpenMP runtime) - libgfortran.so.5 (Fortran runtime) Neither of these is present in the python:3.11-slim base image, so dlopen() fails the moment we construct the Llama() object. The previous error-surfacing work surfaced this exact failure to the status line (no more generic 'model not loaded'), which made the root cause obvious. Fix: apt-get install libgomp1 libgfortran5 in the Dockerfile. Also keep cmake + build-essential as a safety net so pip can fall back to a source build if the prebuilt wheel is ever unavailable for the exact Python version. --prefer-binary is kept so we still use the fast prebuilt wheel by default. Tests (host Python, not Docker): 12 unit + 42 E2E + 12 verify_llm_status all pass. The Docker fix w…a55c7de -
fix: load LLM in background thread so Space stays healthy during 2.84 GB cold start
Previously, app.py synchronously called agents.get_llm() at import time. For HF Spaces, this meant uvicorn did not open its port until the 2.84 GB download + model load completed. If the download took longer than the Space's startup health-check window, the container was marked unhealthy and restarted, looping forever. generate() was also blocking on first use — the first chat/mentor request would stall while the model loaded. Refactor: - agents.py: split into _do_load() (background) + start_background_load() + non-blocking generate(). Status transitions: uninitialized -> loading -> loaded | error | mock generate() returns '' while status != loaded, so per-feature deterministic fallbacks (chat_reply, generate_insight, parse_mentor_response) handle every request immediately, and upgrade to real LLM output the moment the background load finishes. - app.py: drop the synchronous eager get_llm(); instead register a FastAPI startup event that calls agents.start_background_l…e5d102f -
fix: eagerly load LLM at startup so /api/health surfaces the real error
Root cause of persistent generic 'model not loaded' on the Space: agents.get_llm() was lazy. The first /api/health call (before any chat/insight/mentor hit) returned llm_status='uninitialized' and an empty llm_error. The frontend fallback '(h.llm_error || model not loaded)' showed the generic message. No real error reason ever reached the UI. Fixes: - app.py: eagerly call agents.get_llm() at startup after the download. The Space's first health check now reflects the TRUE status ('loaded' or 'error' with the exception type+message). The model load (~10-60s) happens during container startup, not on first user request. If the download failed, get_llm() raises FileNotFoundError immediately and the real reason is captured. - download_model.py: retry each download mode (with-token, anonymous) up to 3 times with exponential backoff to survive transient network failures on cold starts. - tests/e2e_test.py: inject a fake download_model so the test process never tries to downloa…cec66cb -
fix: correct LLM model path default, fix chat 'error: format only' leak, surface load errors
Root causes of LLM: OFFLINE + chat 'error: format only' on the Space: 1. agents.py defaulted MODEL_PATH to the old filename 'models/retro-alpha-nemotron-q4_k_m.gguf'. The actual GGUF file is 'NVIDIA-Nemotron-3-Nano-4B.Q4_K_M.gguf'. When the model download failed on the Space (slow network, token scope, or timeout), MODEL_PATH stayed as the wrong default and get_llm() raised FileNotFoundError -> _llm_status='error' -> UI OFFLINE. 2. mock_generate() returned the literal 'error: format only' for any prompt that didn't match its keyword checks. The chat prompt matched none, so the sentinel leaked to the UI (chat_reply's 'if not text' fallback never fired because the string was truthy). Fixes: - agents.py: correct MODEL_PATH default to the actual filename; capture _llm_error with the exception type+message; print the resolved model path and size on load - mock_generate(): return '' for unknown prompts so per-feature deterministic fallbacks (chat_reply, gener…1c2dd4b -
feat: browser-local engine, Zerodha dashboard, historical events, chatbot, per-user isolation
- Port engine to JS (static/engine.js) and events to JS (static/events.js) so the game runs 100% in the browser; every tab has its own state - Reduce server to static + LLM endpoints only (/api/chat, /api/mentor, /api/insight, /api/health) - no more shared server game state - Deterministic local NPC agents (whale/retail/permabull) react to the historical event regime - no LLM needed for game state - Historical events timeline (events.py + events.js): 1994 RBI rate hike, 1995 peso crisis, 1997 Asian crisis, 1998 Pokhran sanctions, 1999 Kargil, 2000 dot-com crash, 2001 9/11 + Enron, 2002 IT boom, 2003 Iraq war, 2004 election - each with realistic per-asset impacts - Zerodha-style dashboard: top index bar, left market watch, center chart with Y/X axis labels, right order pad + chatbot, bottom positions table with cost basis, current value, P&L, P&L% - Chart with asset selector chips (Net Worth / Nifty 50 / Nifty IT / Gold / Crypto / Real Estate), proper axis labels and g…f316f5a -
fix: mentor returns real roast from numeric summary when LLM output is empty/malformed
d3fb801 -
fix: harden LLM calls, cast numpy to native floats, pin llama-cpp-python wheel
11853b1 -
fix: accept percent value (0-100) for trades, add MOCK_LLM flag, full Playwright E2E
55da5c9 -
fix: resolve asset name mismatch, add E2E tests, 10-year game loop
23040f5 -
fix: serve static files, switch to FastAPI, add CRT terminal styling
2df7867 -
Space: prebuilt llama-cpp-python wheel, minimal Dockerfile
7247224 -
Use uvicorn for Space deployment; pin model filename
6143850 -
Point model download at fine-tuned GGUF repo
46f25fd -
Fix Modal training: use SFTConfig to avoid pickling error
bf88014 -
Add Unsloth Modal training pipeline for Nemotron 3 Nano 4B; dataset uploaded
94d68b4
-
Add model download, split requirements, prepare for Modal training
a2d1173 -
Phase 2/3: Gradio Server backend, CRT frontend, engine, agents, mentor, tests, CI/CD
1d0b04b -
Phase 1: project setup, MiniMax-M3 synthetic dataset generation, 1446-row clean dataset
122cc3c -
Initial commit
SankalpUnverified signature2ae9271