# What Is TimesFM? Google's Time-Series Foundation Model Explained, and How to Run It in Your Browser

> Source: <https://dev.to/vishalmysore/what-is-timesfm-googles-time-series-foundation-model-explained-and-how-to-run-it-in-your-browser-1f4e>
> Published: 2026-10-17 22:59:35+00:00

*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.*

**Try it now:** [https://vishalmysore.github.io/webTimesFM/](https://vishalmysore.github.io/webTimesFM/)

**Code:** [https://github.com/vishalmysore/webTimesFM](https://github.com/vishalmysore/webTimesFM)

**Model files (ONNX):** [https://huggingface.co/VishalMysore/timesfm-2.5-200m-onnx-web](https://huggingface.co/VishalMysore/timesfm-2.5-200m-onnx-web)

**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.

What 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**.

It 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.

**In one sentence:** TimesFM is like ChatGPT, but instead of reading and writing words, it reads and writes numbers.

A **foundation model** is a large AI model that is:

GPT, 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.

|  | Traditional model (ARIMA, Prophet, ETS) | Foundation model (TimesFM) | 
|---|---|---|
| Training | Fitted separately for **each** series | Trained **once** , used for everything | 
| Setup | Needs a data scientist to choose and tune | Paste your numbers, get a forecast | 
| Knowledge | Knows only that one series | Has "seen" millions of patterns | 
| Uncertainty | Often a single line, or a fitted interval | Built-in quantiles (10%…90%) for every step | 
| Best when | You have one important series and time to tune | You have many series, little time, or little history | 

TimesFM 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":

|  | Language model (GPT-style) | TimesFM | 
|---|---|---|
| Input token | a word or piece of a word | a **patch of 32 consecutive numbers** | 
| Task | predict the next word | predict the **next 128 numbers** | 
| Trained on | text from the internet | **~100 billion real time points** | 
| Output | probabilities over a vocabulary | actual values plus **quantiles** (a range) | 

Feeding 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.

These values come from the model's published configuration:

```
Your numbers ──► split into patches of 32 ──► normalise each patch (mean and spread)
                                                │
                                                ▼
          Input block: a small residual neural network turns each patch into a 1,280-number token
                                                │
                                                ▼
          20 transformer layers × 16 attention heads
            • each patch attends only to earlier patches (decoder-only, causal)
            • rotary position embeddings (knows the order)
            • RMS normalisation and QK-norm (stable training)
                                                │
                                                ▼
          Output block ──► next 128 steps × [mean, 10th, 20th … 90th percentile]
```

| Setting | TimesFM 2.5 | 
|---|---|
| Parameters | about 200 million | 
| Transformer layers | 20 | 
| Model width | 1,280, with 16 attention heads | 
| Input patch | 32 time steps | 
| Output per pass | 128 time steps | 
| Longest history (context) | **16,384** points | 
| Uncertainty | 9 quantiles per step, plus an optional quantile head for horizons up to 1,024 | 

For 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.

According to the original paper, the pre-training mix includes:

That variety is why one model can forecast carbon dioxide, sunspots, shop sales and oil prices.

`safetensors` file (925 MB for 2.5).
| Version | Released | Size | Max history | What changed | Weights licence | 
|---|---|---|---|---|---|
| TimesFM 1.0 | 2024 | 200M | 512 | The original, from the ICML paper | Apache-2.0 | 
| TimesFM 2.0 | 2024–25 | 500M | 2,048 | Bigger model, more data | Apache-2.0 | 
| **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** | 
| 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 | 

**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.

**[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.

```
Google's PyTorch weights (safetensors, 925 MB)
   └─► converted to ONNX            (portable model format)
         └─► quantised to 8-bit (261 MB) or 4-bit (146 MB)
               └─► ONNX Runtime Web (runs AI models in the browser)
                     └─► WebGPU (your graphics card) or WASM (your CPU)
                           └─► timesfm.js + index.html on GitHub Pages
```

Every 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"**.

**CO₂ at Mauna Loa:** a steady rise plus a yearly cycle. TimesFM forecast five years ahead almost exactly, **95% better than "no change"**.

**Sunspots:** the ~11-year solar cycle. Reading 85 years of history, TimesFM predicted the next cycle's rise and peak a decade ahead.

**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.

**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.

The **Current affairs** tab points TimesFM at this week's news, with data refreshed automatically every day by a GitHub Action.

**World Series odds** combine three steps:

On 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.

**Oil and Bitcoin** get 30-day forecasts with uncertainty bands, and the page explains why prices are so hard to forecast.

TimesFM 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.

**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:

Replaying 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**.

Copy [`timesfm.js`](https://github.com/vishalmysore/webTimesFM/blob/main/timesfm.js) next to your page, then:

```
<script type="module">
import * as ort from "https://cdn.jsdelivr.net/npm/onnxruntime-web@1.29.0/dist/ort.webgpu.min.mjs";
import { TimesFM } from "./timesfm.js";
ort.env.wasm.wasmPaths = "https://cdn.jsdelivr.net/npm/onnxruntime-web@1.29.0/dist/";

const model = await TimesFM.load(ort,
  "https://huggingface.co/VishalMysore/timesfm-2.5-200m-onnx-web/resolve/main/timesfm25_q8.onnx",
  navigator.gpu ? "webgpu" : "wasm");

const history = [/* your numbers, oldest first */];
const { point, quantiles } = await model.forecast(history, 128);
// point: median forecast; quantiles[t] = [mean, q10, q20, ..., q90]
</script>
```

**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.

For Python, use Google's official package and examples at [github.com/google-research/timesfm](https://github.com/google-research/timesfm).

**[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.

**Please read before using the forecasts on this site or in this article.**

This 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.
