Who it is forA developer or analyst monitoring a watchlist of instruments who needs forecasts for all of them with the same lookback and horizon.
The problemRunning single forecasts one by one is slow and makes it harder to compare many assets in the same window.
The outcomeA list of forecast DataFrames, one per input series, returned in the same order as the inputs.
What you need first
- Python 3.10 or newer
- pip, and access to install requirements.txt
- Internet access to load models from the Hugging Face Hub
- Historical candlestick data in a pandas DataFrame with open, high, low, close columns
- For fine-tuning only: a local Qlib data directory, a GPU setup that works with torchrun, and optionally a Comet.ml account
Steps
- Run
pip install -r requirements.txtin the Kronos folder. - Build a Python list of DataFrames
df_list, plus matchingx_timestamp_listandy_timestamp_list, making sure every series has the same lookback length and the same pred_len. - Create the predictor with
KronosPredictor(model, tokenizer, max_context=512)after loading the model and tokenizer from the Hugging Face Hub. - Call
predictor.predict_batchwithdf_list,x_timestamp_list,y_timestamp_list,pred_len,T=1.0,top_p=0.9,sample_count=1, andverbose=True. - Loop over the returned
pred_df_listin order and printpred_df.head()for each series.
Prompt for your agent
In the Kronos repo, prepare equal-length candlestick DataFrames for <list of instrument CSV paths>, call predict_batch with pred_len=<number of steps>, and write one forecast CSV per instrument. Verify that the number of returned DataFrames equals the number of input series and that each series has the same lookback length.
Caveat. The README says predict_batch leverages GPU parallelism, so a CPU-only machine may run it much more slowly.
Get 5 new use cases every morning. Free, one short email, unsubscribe anytime.
Get them freeShare: X LinkedIn Hacker News Email Copy link
Disclaimer
Deduped lists open-source repositories that belong to other people. We do not own, maintain, audit, or vouch for any of them, and a repo appearing here is not an endorsement or a safety check. The use cases, steps, and prompts are written by AI and may be incomplete, outdated, or just wrong. Where a use case is marked "Seen in the wild", we link to public posts where someone described something similar, but we have not verified those posts and the use case itself is still our AI's own write-up. Use all of this at your own risk. Only run code, commands, or agents on systems and accounts you are authorized to use, and read the code and every command before you run it, especially anything that touches credentials, files, or the network. Nothing here is professional, security, legal, or financial advice. All trademarks and project names belong to their respective owners, and their use here does not imply affiliation. Content is provided as is, without warranties of any kind. Found a mistake, a safety problem, or something you want removed? Email [email protected] and we will look at it promptly. Full disclaimer page