TimeSeriesAI is a demo repository showcasing time series forecasting and the utilization of LLMs for generating statistical analyses and summaries of forecasted values. Although forecasts are currently generated in batches, integration with a REST API is feasible if needed. The underlying LLM utilized in this demonstration is DBRX, an open-source LLM developed by Databricks. DBRX is hosted using Databricks Foundation Model APIs. The model is not fine-tuned, but can be done so using various blogs or academic papers providing analysis or research in time series data. For example, the FB Prophet Paper could be a great fine-tuning data point. Please note that I am not sure if there would be legal/copyright restrictions around using certain content.
TimeSeriesAI_Video.mp4
In Databricks you will need to run run_forecast.py notebook to generate the forecasts which requires access to Databricks System Billing Tables. Please use DBR 13.3LTS ML or higher to produce forecasts.
Next you will need to have the following .env
file to connect to Databricks from your local desktop.
DATABRICKS_TOKEN=<PAT TOKEN>
DATABRICKS_WORKSPACE=<Databricks Workspace URL> #adb-<workspaceid>.<##>.azuredatabricks.net
WAREHOUSE_HTTP_PATH=<SQL Warehouse Path> # /sql/1.0/warehouses/<ID>
DATABRICKS_CATALOG=<catalog with forecast data>
DATABRICKS_SCHEMA=<schema with forecast data>
To run the application locally please execute the following commands. Please note that you will need to comment out the first two lines of the init.py file as it is coupled with the Databricks job that requires PySpark and I do not install
# Create environment
conda create -n timeseriesai python=3.10
conda activate timeseriesai
# install requirements
pip install -r requirements.txt
# change working directory and run application
cd timeseries_ai
python run_app.py
Please note that running "Analyze Forecasts" for "All Skus" is current'y not supported.