Skip to content

About

Google TimesFM 3.0: This Tiny 330M AI Can Predicts Stocks Locally! (CPU Setup) - Predict stock market prices and market trends using Google's TimesFM 3.0 foundation model locally on CPU.

Topics

Resources

Stars

13 stars

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

📈 TimesFM 3.0 AI Stock Forecaster

Python 3.10+ License: Apache 2.0 Model: Google TimesFM 3.0

Predict stock market prices and market trends using Google's TimesFM 3.0 foundation model with multivariate volume covariates and probabilistic quantile risk bounds.


🔄 How It Works

Step 1: Market Input 📊 Step 2: TimesFM 3.0 AI Action 🧠 Step 3: Quantile Forecast Result 🎯
Historical stock prices and trading volume covariates. TimesFM 3.0 transformer processes patches and past/future variables. Target price prediction with 9 probabilistic quantile risk bands.

⚡ Quick Setup & Installation

1. Install Dependencies

Install the core Python forecasting package with PyTorch acceleration:

pip install timesfm[torch] numpy pandas

2. Hugging Face Authorization

Authenticate locally in your terminal using your Hugging Face access token to grant permission for loading google/timesfm-3.0-pytorch:

hf auth login

3. Model Weights Download (~1 GB)

  • Automatic Download (Default): Running python main.py automatically downloads and caches the model weights (google/timesfm-3.0-pytorch, ~1 GB) to ~/.cache/huggingface/ on first execution.
  • Explicit Pre-Download (Optional): To pre-download the weights in advance before execution, run:
    hf download google/timesfm-3.0-pytorch

🚀 Execution Guide

Run the market forecasting script to analyze historical stock data and export predictions to outputs/outputs.md:

python main.py

🛠️ File Explanations & Project Structure

.
├── main.py
└── README.md
  • main.py: The primary execution entry point. Loads stock price data, configures the TimesFM 3.0 forecaster with volume covariates, calculates 9 quantile confidence bands, and saves output reports.
  • README.md: Project documentation, setup instructions, and execution guides.

🎯 5 Real-World Use Cases

  1. Intraday Market Volatility Forecasting: Predict 24-hour stock price movements using trading volume as past covariates.
  2. Portfolio Value-at-Risk (VaR) Analysis: Use the 0.1 and 0.9 quantile outputs to quantify downside financial risk.
  3. Multi-Stock Co-Movement Tracking: Forecast tech sector stocks simultaneously to detect sector-wide momentum shifts.
  4. Earnings Season Trend Simulation: Incorporate scheduled earnings calendar dates as future covariates for price targets.
  5. Algorithmic Trading Signal Generation: Trigger buy and sell alerts when target predictions cross quantile confidence limits.

🔮 5 Future Enhancements

  1. Live Interactive Streamlit Dashboard: Add real-time stock ticker charts with interactive slider controls.
  2. Automated Yahoo Finance API Fetcher: Fetch live stock market prices automatically on script execution.
  3. BigQuery ML SQL Pipeline Sync: Export generated forecast tables directly into cloud database tables.
  4. LoRA Fine-Tuning Module: Include lightweight PEFT scripts for custom cryptocurrency model adapters.
  5. Automated Trading Bot Webhook: Dispatch automated webhook notifications to trading platforms.

🏷️ Keywords & Tags

Google TimesFM 3.0 TimesFM Stock Market Prediction Time Series Forecasting PyTorch AI Financial Analysis Quantile Forecasting Financial Machine Learning Local AI CPU Inference Python AI Google AI

About

Google TimesFM 3.0: This Tiny 330M AI Can Predicts Stocks Locally! (CPU Setup) - Predict stock market prices and market trends using Google's TimesFM 3.0 foundation model locally on CPU.

Topics

Resources

Stars

13 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages