{"slug": "what-is-timesfm-google-s-time-series-foundation-model-explained-and-how-to-run", "title": "What Is TimesFM? Google's Time-Series Foundation Model Explained, and How to Run It in Your Browser", "summary": "A developer built webTimesFM, a browser-based demo that runs Google Research's open TimesFM time-series foundation model entirely client-side, using ONNX-converted weights of the 200M-parameter TimesFM 2.5 model. TimesFM, a decoder-only transformer trained on roughly 100 billion real-world time points, forecasts unseen series zero-shot by tokenizing numbers into patches of 32 and predicting the next 128 steps with quantile ranges, without per-series training. The demo is published on GitHub with model files hosted on Hugging Face under the Apache-2.0 license.", "body_md": "*A plain-English guide to Google's TimesFM: what it is, how it's built, why it's called a \"foundation model\", and what you can do with it, from forecasting CO₂ and oil prices to World Series odds, running free in a web browser.*\n\n**Try it now:** [https://vishalmysore.github.io/webTimesFM/](https://vishalmysore.github.io/webTimesFM/)\n\n**Code:** [https://github.com/vishalmysore/webTimesFM](https://github.com/vishalmysore/webTimesFM)\n\n**Model files (ONNX):** [https://huggingface.co/VishalMysore/timesfm-2.5-200m-onnx-web](https://huggingface.co/VishalMysore/timesfm-2.5-200m-onnx-web)\n\n**TimesFM** (short for **Time Series Foundation Model**) is an open AI model from **Google Research** that forecasts numbers over time. Give it any list of numbers in time order, such as daily sales, monthly rainfall, hourly electricity use or a stock price, and it predicts what comes next, together with a range of likely outcomes.\n\nWhat makes it special is that **you don't have to train it**. TimesFM has already learned what trends, seasons and cycles look like from about **100 billion real-world data points**. It can forecast a series it has never seen before, straight away. This is called **zero-shot forecasting**.\n\nIt was introduced in the research paper *\"A decoder-only foundation model for time-series forecasting\"* by Abhimanyu Das, Weihao Kong, Rajat Sen and Yichen Zhou (ICML 2024). The code and the model weights up to version 2.5 are open source under the **Apache-2.0** licence.\n\n**In one sentence:** TimesFM is like ChatGPT, but instead of reading and writing words, it reads and writes numbers.\n\nA **foundation model** is a large AI model that is:\n\nGPT, Gemini and Claude are foundation models for **text**. TimesFM is a foundation model for **time series**, along with others such as Amazon's Chronos, Salesforce's Moirai, Lag-Llama and Nixtla's TimeGPT.\n\n|  | Traditional model (ARIMA, Prophet, ETS) | Foundation model (TimesFM) | \n|---|---|---|\n| Training | Fitted separately for **each** series | Trained **once** , used for everything | \n| Setup | Needs a data scientist to choose and tune | Paste your numbers, get a forecast | \n| Knowledge | Knows only that one series | Has \"seen\" millions of patterns | \n| Uncertainty | Often a single line, or a fitted interval | Built-in quantiles (10%…90%) for every step | \n| Best when | You have one important series and time to tune | You have many series, little time, or little history | \n\nTimesFM is a **decoder-only transformer**, the same family of neural network as GPT, Gemini and Llama, from Google's 2017 paper *\"Attention Is All You Need\"*. Google's key change is what counts as a \"token\":\n\n|  | Language model (GPT-style) | TimesFM | \n|---|---|---|\n| Input token | a word or piece of a word | a **patch of 32 consecutive numbers** | \n| Task | predict the next word | predict the **next 128 numbers** | \n| Trained on | text from the internet | **~100 billion real time points** | \n| Output | probabilities over a vocabulary | actual values plus **quantiles** (a range) | \n\nFeeding the model **patches** instead of single values (an idea also used by PatchTST) makes long histories cheap to read. Predicting a long **output patch** of 128 steps at once makes forecasts fast and stable.\n\nThese values come from the model's published configuration:\n\n```\nYour numbers ──► split into patches of 32 ──► normalise each patch (mean and spread)\n                                                │\n                                                ▼\n          Input block: a small residual neural network turns each patch into a 1,280-number token\n                                                │\n                                                ▼\n          20 transformer layers × 16 attention heads\n            • each patch attends only to earlier patches (decoder-only, causal)\n            • rotary position embeddings (knows the order)\n            • RMS normalisation and QK-norm (stable training)\n                                                │\n                                                ▼\n          Output block ──► next 128 steps × [mean, 10th, 20th … 90th percentile]\n```\n\n| Setting | TimesFM 2.5 | \n|---|---|\n| Parameters | about 200 million | \n| Transformer layers | 20 | \n| Model width | 1,280, with 16 attention heads | \n| Input patch | 32 time steps | \n| Output per pass | 128 time steps | \n| Longest history (context) | **16,384** points | \n| Uncertainty | 9 quantiles per step, plus an optional quantile head for horizons up to 1,024 | \n\nFor horizons longer than 128 steps, the model feeds its own forecast back in and goes again, the way a chatbot writes one word after another.\n\nAccording to the original paper, the pre-training mix includes:\n\nThat variety is why one model can forecast carbon dioxide, sunspots, shop sales and oil prices.\n\n`safetensors` file (925 MB for 2.5).\n| Version | Released | Size | Max history | What changed | Weights licence | \n|---|---|---|---|---|---|\n| TimesFM 1.0 | 2024 | 200M | 512 | The original, from the ICML paper | Apache-2.0 | \n| TimesFM 2.0 | 2024–25 | 500M | 2,048 | Bigger model, more data | Apache-2.0 | \n| **TimesFM 2.5** | **Sept 2025** | **200M** | **16,384** | Smaller but longer memory; continuous quantile head; no frequency setting; covariates via XReg (Oct 2025) | **Apache-2.0** | \n| TimesFM 3.0 | Aug 2026 | larger | long | Native multivariate forecasting and covariates; tops fev-bench, the TIME benchmark and GIFT-Eval (per Google) | Non-commercial for downloaded weights; commercial use through Google Cloud BigQuery ML | \n\n**Why this project uses TimesFM 2.5:** it's small enough to download into a browser, it can read up to 16k points of history, and its Apache-2.0 weights can be used freely, including commercially.\n\n**[webTimesFM](https://vishalmysore.github.io/webTimesFM/)** runs Google's TimesFM 2.5 **entirely inside a web page**. There's no server, no Python and no sign-up, and your data never leaves your computer.\n\n```\nGoogle's PyTorch weights (safetensors, 925 MB)\n   └─► converted to ONNX            (portable model format)\n         └─► quantised to 8-bit (261 MB) or 4-bit (146 MB)\n               └─► ONNX Runtime Web (runs AI models in the browser)\n                     └─► WebGPU (your graphics card) or WASM (your CPU)\n                           └─► timesfm.js + index.html on GitHub Pages\n```\n\nEvery example on the site has a **Hold back** option. It hides the most recent data, forecasts it, and scores the result against the simplest possible guess, **\"no change\"**.\n\n**CO₂ at Mauna Loa:** a steady rise plus a yearly cycle. TimesFM forecast five years ahead almost exactly, **95% better than \"no change\"**.\n\n**Sunspots:** the ~11-year solar cycle. Reading 85 years of history, TimesFM predicted the next cycle's rise and peak a decade ahead.\n\n**World extreme poverty:** TimesFM saw the steady decline up to 2018 and expected it to continue. It couldn't know COVID-19 would stall progress in 2020.\n\n**The rule of thumb:** TimesFM is excellent at **patterns** (trends, seasons, cycles), but it can't see **events** (pandemics, wars, policy changes) until they show up in the numbers. For prices, \"no change\" is very hard to beat; the **uncertainty band** is the most useful output.\n\nThe **Current affairs** tab points TimesFM at this week's news, with data refreshed automatically every day by a GitHub Action.\n\n**World Series odds** combine three steps:\n\nOn 17 October 2026, after the Brewers swept the Dodgers, the model gives **Milwaukee about a 71% chance** of winning the World Series. TimesFM's band moves the odds only slightly. The series score and the season's results do most of the work, and the page says so.\n\n**Oil and Bitcoin** get 30-day forecasts with uncertainty bands, and the page explains why prices are so hard to forecast.\n\nTimesFM reads only numbers, so a second, much smaller model reads the headlines. Every day, up to 100 Google News headlines per topic (oil, Bitcoin, each playoff team) are scored with **VADER**, a lightweight sentiment model. They're averaged into a daily **news tone** from −10 to +10.\n\n**Tone isn't direction.** \"War escalates\" sounds negative but pushes oil prices *up*. So the news never moves the forecast. It works as a **warning light** instead:\n\nReplaying August to October 2026 with no hindsight, **three of five oil-news alerts came just before big Brent moves** (+7%, +10%, +18%), and one big jump was missed. Even the stormy band was too narrow for the war spike. News can tell you **when** to worry, not always **how much**.\n\nCopy [`timesfm.js`](https://github.com/vishalmysore/webTimesFM/blob/main/timesfm.js) next to your page, then:\n\n```\n<script type=\"module\">\nimport * as ort from \"https://cdn.jsdelivr.net/npm/onnxruntime-web@1.29.0/dist/ort.webgpu.min.mjs\";\nimport { TimesFM } from \"./timesfm.js\";\nort.env.wasm.wasmPaths = \"https://cdn.jsdelivr.net/npm/onnxruntime-web@1.29.0/dist/\";\n\nconst model = await TimesFM.load(ort,\n  \"https://huggingface.co/VishalMysore/timesfm-2.5-200m-onnx-web/resolve/main/timesfm25_q8.onnx\",\n  navigator.gpu ? \"webgpu\" : \"wasm\");\n\nconst history = [/* your numbers, oldest first */];\nconst { point, quantiles } = await model.forecast(history, 128);\n// point: median forecast; quantiles[t] = [mean, q10, q20, ..., q90]\n</script>\n```\n\n**No code?** Open the site's **Tutorial** tab. It shows how to paste a column from Excel or Google Sheets, upload a CSV, choose context and horizon, and check accuracy with Hold back.\n\nFor Python, use Google's official package and examples at [github.com/google-research/timesfm](https://github.com/google-research/timesfm).\n\n**[https://vishalmysore.github.io/webTimesFM/](https://vishalmysore.github.io/webTimesFM/)**: open it, click **Load model** (a one-time 261 MB download), pick an example, and press **Forecast**. Everything runs on your own machine.\n\n**Please read before using the forecasts on this site or in this article.**\n\nThis is a free, open-source demonstration for learning and research. It's provided **as is**, with no warranty of any kind. The author isn't liable for any loss or damage arising from its use. Always verify important numbers with the original sources.", "url": "https://wpnews.pro/news/what-is-timesfm-google-s-time-series-foundation-model-explained-and-how-to-run", "canonical_source": "https://dev.to/vishalmysore/what-is-timesfm-googles-time-series-foundation-model-explained-and-how-to-run-it-in-your-browser-1f4e", "published_at": "2026-10-17 22:59:35+00:00", "updated_at": "2026-10-17 23:07:20.938824+00:00", "lang": "en", "topics": ["machine-learning", "artificial-intelligence", "ai-research", "ai-tools", "neural-networks"], "entities": ["Google Research", "TimesFM", "webTimesFM", "Hugging Face", "GitHub", "Abhimanyu Das", "ONNX", "PatchTST"], "also_reported_by": [], "alternates": {"html": "https://wpnews.pro/news/what-is-timesfm-google-s-time-series-foundation-model-explained-and-how-to-run", "markdown": "https://wpnews.pro/news/what-is-timesfm-google-s-time-series-foundation-model-explained-and-how-to-run.md", "text": "https://wpnews.pro/news/what-is-timesfm-google-s-time-series-foundation-model-explained-and-how-to-run.txt", "jsonld": "https://wpnews.pro/news/what-is-timesfm-google-s-time-series-foundation-model-explained-and-how-to-run.jsonld"}}