Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds support for Amazon’s Chronos2 as a new “foundation model” in finnts, integrating it as a custom parsnip model that calls an Azure-hosted online endpoint for inference.
Changes:
- Added a Chronos2 parsnip model spec + controller to format payloads, call the Azure endpoint, and parse responses.
- Updated training pipeline logic to treat “foundation models” (Chronos2 + TimeGPT) differently for feature selection and stationarity handling.
- Added documentation (vignettes, NEWS) and CI/test scaffolding for Chronos2.
Reviewed changes
Copilot reviewed 17 out of 17 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
R/chronos2_model.R |
Adds Chronos2 parsnip model, predict/fit bridge, and padding helper. |
R/chronos_controller.R |
Implements request payload building, env var handling, and response parsing for Chronos API calls. |
R/models.R |
Registers chronos2 in model lists and adds list_foundation_models(). |
R/train_models.R |
Adjusts feature selection + differencing logic to account for foundation models. |
R/utility.R |
Registers make_chronos2_model() on package load. |
tests/testthat/test-chronos.R |
Adds unit + integration tests for Chronos2 and the controller. |
vignettes/forecasting-genai.Rmd |
Expands GenAI vignette to include Chronos2 usage and setup. |
vignettes/models-used-in-finnts.Rmd |
Adds Chronos2 to the models listing vignette. |
NEWS.md |
Adds release notes for Chronos2 integration. |
DESCRIPTION |
Adds httr/jsonlite to Imports. |
NAMESPACE |
Exports Chronos2 functions and registers S3 methods. |
.github/workflows/R-CMD-check.yaml |
Adds Chronos endpoint secrets to CI environment. |
man/*.Rd |
Adds roxygen-generated docs for Chronos2 functions/methods. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request add Chronos2 by Amazon. It relies on azure self-deployed ML online endpoint
Key Notes for Reviewers
chronos2_model.Randchronos_controller.R:The core Chronos2 model configuration lives in
chronos2_model.R. It leverageschronos_controller.Rto send POST requests to the Azure-deployed endpoint. The controller converts the input data frame into the required JSON schema and transforms the API response back into a data frame, where thepredictionscolumn contains the forecast values.The controller is designed to be reusable for
chronos-bolt-baseandchronos-bolt-tinyas well, since they share the same interface and differ mainly viamodel_type.API Configuration :
FinnTS users can configure Chronos2 via:
CHRONOS_API_URL
CHRONOS_API_TOKEN
packages added - jsonlite and httr
train_models.Randmodels.R:For Chronos2, differencing is skipped. A new “foundational model” list is introduced so additional models can be added cleanly; Chronos2 and TimeGPT are included in this list.
NEWS.MD,DESCRIPTION.MDandvignettes/forecasting-genai.RmdDocumentation is updated to include Chronos2 in the “forecasting with genai” vignette, along with release notes in
NEWS.MD.Future Iterations
Add into agent flow.