Spaces:
Runtime error
Runtime error
Commit History
-
Fix AI insight leaking thinking content + make insights on-demand instead of auto-generated
9cbb438 -
Fix CSS: serve self-contained HTML via ASGI wrapper to bypass Gradio
1984ea6 -
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 -
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: 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: resolve asset name mismatch, add E2E tests, 10-year game loop
23040f5 -
fix: serve static files, switch to FastAPI, add CRT terminal styling
2df7867
-
Phase 2/3: Gradio Server backend, CRT frontend, engine, agents, mentor, tests, CI/CD
1d0b04b