Spaces:
Running
Running
Commit History
-
fix: restore llama.cpp with source build, use fine-tuned GGUF model
7e810ce -
refactor: remove llama-cpp entirely, use deterministic mock-only mode
a7789ad -
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
-
Phase 2/3: Gradio Server backend, CRT frontend, engine, agents, mentor, tests, CI/CD
1d0b04b