feat: add timesfm-3 model - #12
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
The TimesFM public docstring currently implies a kwargs dict parameter, but the factory API actually forwards extra keywords via **kwargs, which is likely to mislead users and cause misconfiguration.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
This PR updates the FoundationForecast TimesFM integration to support the new TimesFM 3.0 PyTorch checkpoint, including dependency bumps, implementation routing, tests, and documentation updates around model availability and licensing.
Changes:
- Bump
timecopilot-timesfmdependency to>=0.4.0(and refresh lockfiles). - Add a new
_TimesFMV3implementation and routegoogle/timesfm-3.0-pytorchthroughTimesFM(...). - Extend tests and experiment configs/docs to include TimesFM 3.0 and note its non-commercial weights license.
File summaries
| File | Description |
|---|---|
| uv.lock | Updates lockfile entries for timecopilot-timesfm 0.4.0 artifacts. |
| pyproject.toml | Bumps timecopilot-timesfm minimum version to >=0.4.0. |
| foundationforecast/models/timesfm.py | Implements _TimesFMV3 and routes repo_id containing 3.0 to it; updates TimesFM docstring. |
| tests/models/test_timesfm.py | Adds routing test for google/timesfm-3.0-pytorch and includes _TimesFMV3 in parametrized checks. |
| tests/models/conftest.py | Adds a TimesFM 3.0 instance to the model test matrix. |
| README.md | Documents TimesFM 3.0 availability and clarifies its non-commercial license. |
| docs/model-hub.md | Updates model hub to state TimesFM supports 1.0/2.0/2.5/3.0 and notes 3.0 licensing. |
| experiments/gift-eval/uv.lock | Updates experiment lockfile for timecopilot-timesfm 0.4.0 artifacts. |
| experiments/gift-eval/configs/models.yaml | Adds a GIFT-Eval model entry for TimesFM 3.0. |
| experiments/gift-eval/configs/ci_subset.yaml | Adds TimesFM 3.0 to the CI subset job list. |
Review details
- Files reviewed: 8/10 changed files
- Comments generated: 1
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
There was a problem hiding this comment.
🟡 Changes recommended
The new TimesFM 3.0 backend adds substantial new forecast logic but lacks a lightweight unit test exercising the _TimesFMV3.forecast path, and there’s also a small maintainability cleanup needed.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Review details
Suppressed comments (1)
Previously missed (1) — in code that hasn't changed since the last review.
foundationforecast/models/timesfm.py:257
- _TimesFMV3._get_predictor takes prediction_length but never uses it, which is confusing given the other TimesFM backends do use it to configure max horizon. If it is intentionally unused for TimesFM3, explicitly mark it as such to avoid future maintainers thinking it was accidentally omitted.
- Files reviewed: 8/11 changed files
- Comments generated: 1
- Review effort level: Lite
| def test_timesfm_routes_3_0_repo(): | ||
| model = TimesFM(repo_id="google/timesfm-3.0-pytorch") | ||
| assert isinstance(model, _TimesFMV3) | ||
| assert model.repo_id == "google/timesfm-3.0-pytorch" | ||
|
|
||
|
|
this pr adds the new timesfm version to the model hub