Skip to content

Add forecast_dashboard: an honest multi-instrument forecasting UI#339

Open
demandnexustech wants to merge 1 commit into
shiyu-coder:masterfrom
demandnexustech:add-forecast-dashboard
Open

Add forecast_dashboard: an honest multi-instrument forecasting UI#339
demandnexustech wants to merge 1 commit into
shiyu-coder:masterfrom
demandnexustech:add-forecast-dashboard

Conversation

@demandnexustech

Copy link
Copy Markdown

What this adds

A self-contained dashboard under forecast_dashboard/ that wraps the Kronos pretrained model and forecasts four instruments out of the box: Silver, Gold, WTI crude, GBP/JPY.

It is built around being honest about uncertainty, which is the main thing it adds over a single-symbol demo:

  • The forecast is shown as a distribution of sample paths (a p10–p90 band), never a lone point prediction, and there is no fabricated confidence score anywhere.
  • Every forecast is logged to SQLite and later reconciled against the realized close, so calibration (band hit-rate vs nominal, median error, directional accuracy) is shown as actual numbers, not a vibe.
  • News headlines are surfaced explicitly as "things the model did NOT see" (it reads past price candles only); they never feed the forecast.

Architecture (one engine, several thin clients)

No duplicated model/data logic — everything imports forecast_engine.py:

file role
forecast_engine.py core — all model + data logic (single source of truth)
server.py + web/ primary UI — FastAPI JSON API + a hand-built, dependency-light frontend (ECharts vendored offline, so it runs on a locked-down/offline box)
app.py legacy Streamlit UI (fallback)
mcp_server.py exposes the engine as MCP tools
storage.py forecast logging + accuracy tracking
instruments.py, news_context.py, news_sentiment.py instruments + the optional, clearly-labelled news context layer

Ships inside the repo

forecast_engine.py auto-discovers the model package from the parent Kronos directory (honouring $KRONOS_DIR, with a sibling ./Kronos fallback so the folder also works standalone). Verified locally:

  • from model import Kronos, KronosTokenizer resolves from forecast_dashboard/
  • the storage accuracy smoke test (python storage.py) passes from this location

Optional ops extras (not required to run the UI)

A Dockerfile (for Cloud Run) and a deploy/ kit for an on-demand GCP VM. These use placeholder project values and document their own cost guardrails. The UI itself needs none of this.

No API keys required

The optional news layer uses ANTHROPIC_API_KEY / TAVILY_API_KEY, but the dashboard works fully without any keys (the news panel just shows a notice).

How to run

git clone https://github.com/shiyu-coder/Kronos.git
cd Kronos/forecast_dashboard
pip install -r requirements.txt
python server.py            # then open http://localhost:8000

Happy to adjust scope (e.g. drop the deploy/ kit, or rename the directory) if you'd prefer a leaner PR. Thanks for Kronos!

A self-contained dashboard (under forecast_dashboard/) that wraps the Kronos
pretrained model and forecasts four instruments out of the box: Silver, Gold,
WTI crude, and GBP/JPY. It is designed around being HONEST about uncertainty,
which is the main thing it adds over a single-symbol demo:

- Forecast is shown as a DISTRIBUTION of sample paths (a p10-p90 band), never a
  lone point prediction, and never a fabricated confidence score.
- Every forecast is logged to SQLite and later reconciled against the realized
  close, so calibration (band hit-rate, errors, directional accuracy) is shown
  as actual numbers, not a vibe.
- News headlines are surfaced explicitly as "things the model did NOT see"
  (it reads past price candles only); they never feed the forecast.

One engine, several thin clients (no duplicated model/data logic):
- forecast_engine.py - all model + data logic (single source of truth)
- server.py + web/   - primary UI: FastAPI JSON API + a hand-built, dependency
  -light frontend (ECharts vendored offline, so it runs on a locked-down box)
- app.py             - legacy Streamlit UI (fallback)
- mcp_server.py      - exposes the engine as MCP tools
- storage.py         - forecast logging + accuracy tracking
- instruments.py / news_context.py / news_sentiment.py - instruments + the
  optional, clearly-labelled news context layer

Ships inside the repo: forecast_engine.py auto-discovers the model package from
the parent Kronos directory (honouring $KRONOS_DIR, with a sibling ./Kronos
fallback so the folder also works standalone). Verified `from model import
Kronos, KronosTokenizer` resolves and the storage accuracy smoke test passes
from this location.

Optional ops extras (not required to run the UI): a Dockerfile for Cloud Run
and a deploy/ kit for an on-demand GCP VM. They use placeholder project values
and document their own cost guardrails.

The news layer (ANTHROPIC_API_KEY / TAVILY_API_KEY) is optional; the dashboard
works fully without any API keys.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant