Interfaze

logo

Beta

pricing

help

docs

blog

sign in

Get Started

Introduction

Examples

Vision

Concepts

Resources

Projects

Integrations

API Reference

Time Series Forecasting

copy markdown

Forecast and predict any time series data by for sales, demand, traffic, financial numbers and more in any granularity by day, week, month, year, etc.

Forecast time series data from CSV file

date,departure_total_delay_mins
2008-01-01,378031
2008-01-02,470367
2008-01-03,353459
2008-01-04,313734
2008-01-05,333774
2008-01-06,348636
2008-01-07,278903
2008-01-08,243514
2008-01-09,143159
2008-01-10,198799
2008-01-11,238677
2008-01-12,78760
2008-01-13,147519
2008-01-14,150793
2008-01-15,133179
2008-01-16,119011
2008-01-17,374516
2008-01-18,252565
2008-01-19,187702
2008-01-20,161163
2008-01-21,400649
2008-01-22,335202
2008-01-23,235637
2008-01-24,200697
2008-01-25,266815
2008-01-26,132591
2008-01-27,399585
2008-01-28,265513
2008-01-29,237232
2008-01-30,178419
2008-01-31,433207
2008-02-01,489413
2008-02-02,156459
2008-02-03,304508
2008-02-04,372892
2008-02-05,313833
2008-02-06,301864
2008-02-07,212722
2008-02-08,246705
2008-02-09,108724
2008-02-10,271627
2008-02-11,265600
2008-02-12,421826
2008-02-13,442894
2008-02-14,264026
2008-02-15,269081
2008-02-16,200773
2008-02-17,375396
2008-02-18,428998
2008-02-19,247290
2008-02-20,228184
2008-02-21,323296
2008-02-22,499211
2008-02-23,242628
2008-02-24,261066
2008-02-25,264930
2008-02-26,407492
2008-02-27,171874
2008-02-28,156890
2008-02-29,276637
2008-03-01,140787
2008-03-02,215823
2008-03-03,292259
2008-03-04,328213
2008-03-05,248360
2008-03-06,213157
2008-03-07,432107
2008-03-08,478176
2008-03-09,338351
2008-03-10,258571
2008-03-11,161713
2008-03-12,199416
2008-03-13,166095
2008-03-14,233746
2008-03-15,337340
2008-03-16,255591
2008-03-17,213921
2008-03-18,380973
2008-03-19,507369
2008-03-20,321732
2008-03-21,350436
2008-03-22,210375
2008-03-23,166403
2008-03-24,155878
2008-03-25,250814
2008-03-26,158874
2008-03-27,277218
2008-03-28,299229
2008-03-29,166835
2008-03-30,342080
2008-03-31,511312
2008-04-01,337714
2008-04-02,156010
2008-04-03,224781
2008-04-04,568989
2008-04-05,206036
2008-04-06,283556
2008-04-07,179239
2008-04-08,159650
2008-04-09,199709
2008-04-10,404082
2008-04-11,361777
2008-04-12,175466
2008-04-13,174294
2008-04-14,136333
2008-04-15,102687
2008-04-16,125967
2008-04-17,137069
2008-04-18,166045
2008-04-19,124697
2008-04-20,212308
2008-04-21,148696
2008-04-22,101000
2008-04-23,142749
2008-04-24,151886
2008-04-25,299561
2008-04-26,159055
2008-04-27,160645
2008-04-28,342358
2008-04-29,136357
2008-04-30,110746
2008-05-01,155989
2008-05-02,495912
2008-05-03,144236
2008-05-04,148163
2008-05-05,159218
2008-05-06,126368
2008-05-07,199714
2008-05-08,158437
2008-05-09,249442
2008-05-10,101453
2008-05-11,224555
2008-05-12,266230
2008-05-13,127270
2008-05-14,199165
2008-05-15,177012
2008-05-16,298814
2008-05-17,96043
2008-05-18,180781
2008-05-19,179031
2008-05-20,233559
2008-05-21,153795
2008-05-22,293605
2008-05-23,232245
2008-05-24,116993
2008-05-25,68483
2008-05-26,125223
2008-05-27,337000
2008-05-28,136781
2008-05-29,122349
2008-05-30,235455
2008-05-31,232851
2008-06-01,184239
2008-06-02,121768
2008-06-03,250370
2008-06-04,407585
2008-06-05,346043
2008-06-06,358238
2008-06-07,213048
2008-06-08,403606
2008-06-09,371661
2008-06-10,335216
2008-06-11,240100
2008-06-12,245332
2008-06-13,363923
2008-06-14,253204
2008-06-15,369018
2008-06-16,430616
2008-06-17,255261
2008-06-18,234037
2008-06-19,344259
2008-06-20,242161
2008-06-21,221915
2008-06-22,416855
2008-06-23,386194
2008-06-24,235205
2008-06-25,260548
2008-06-26,428710
2008-06-27,379415
2008-06-28,264821
2008-06-29,426092
2008-06-30,217630
2008-07-01,148793
2008-07-02,256315
2008-07-03,180284
2008-07-04,83389
2008-07-05,137595
2008-07-06,404884
2008-07-07,380554
2008-07-08,386291
2008-07-09,299926
2008-07-10,397706
2008-07-11,226386
2008-07-12,222516
2008-07-13,545275
2008-07-14,268835
2008-07-15,192476
2008-07-16,158981
2008-07-17,190439
2008-07-18,240358
2008-07-19,191445
2008-07-20,303036
2008-07-21,243838
2008-07-22,272521
2008-07-23,404564
2008-07-24,410409
2008-07-25,249054
2008-07-26,174479
2008-07-27,458206
2008-07-28,248612
2008-07-29,208409
2008-07-30,220033
2008-07-31,430584
2008-08-01,280923
2008-08-02,334578
2008-08-03,240397
2008-08-04,397401
2008-08-05,293294
2008-08-06,217608
2008-08-07,352340
2008-08-08,283283
2008-08-09,180016
2008-08-10,375855
2008-08-11,400237
2008-08-12,194923
2008-08-13,164443
2008-08-14,304761
2008-08-15,426221
2008-08-16,234661
2008-08-17,181185
2008-08-18,183183
2008-08-19,121396
2008-08-20,208222
2008-08-21,229580
2008-08-22,185158
2008-08-23,121466
2008-08-24,143654
2008-08-25,227878
2008-08-26,225106
2008-08-27,116682
2008-08-28,145522
2008-08-29,195197
2008-08-30,87612
2008-08-31,59485
2008-09-01,84689
2008-09-02,88586
2008-09-03,67733
2008-09-04,146161
2008-09-05,85778
2008-09-06,99116
2008-09-07,104772
2008-09-08,188049
2008-09-09,227704
2008-09-10,78895
2008-09-11,117252
2008-09-12,252262
2008-09-13,126807
2008-09-14,224688
2008-09-15,174558
2008-09-16,88702
2008-09-17,84179
2008-09-18,86266
2008-09-19,100524
2008-09-20,53809
2008-09-21,135987
2008-09-22,98448
2008-09-23,62921
2008-09-24,89997
2008-09-25,137140
2008-09-26,233070
2008-09-27,76256
2008-09-28,145365
2008-09-29,114590
2008-09-30,78756
2008-10-01,68908
2008-10-02,103370
2008-10-03,116519
2008-10-04,66030
2008-10-05,120255
2008-10-06,80214
2008-10-07,101998
2008-10-08,157110
2008-10-09,124526
2008-10-10,118820
2008-10-11,75723
2008-10-12,108076
2008-10-13,98516
2008-10-14,67277
2008-10-15,161586
2008-10-16,159578
2008-10-17,127578
2008-10-18,56201
2008-10-19,103429
2008-10-20,94412
2008-10-21,77083
2008-10-22,142942
2008-10-23,104811
2008-10-24,271700
2008-10-25,116679
2008-10-26,162593
2008-10-27,171405
2008-10-28,171534
2008-10-29,88151
2008-10-30,97112
2008-10-31,95650
2008-11-01,86255
2008-11-02,159172
2008-11-03,108418
2008-11-04,72899
2008-11-05,84189
2008-11-06,207920
2008-11-07,184794
2008-11-08,88502
2008-11-09,166324
2008-11-10,106959
2008-11-11,127670
2008-11-12,137153
2008-11-13,214117
2008-11-14,339143
2008-11-15,105959
2008-11-16,130412
2008-11-17,86408
2008-11-18,70364
2008-11-19,94538
2008-11-20,126414
2008-11-21,160187
2008-11-22,113759
2008-11-23,75872
2008-11-24,90505
2008-11-25,107865
2008-11-26,98192
2008-11-27,45308
2008-11-28,49519
2008-11-29,147211
2008-11-30,642023
2008-12-01,603887
2008-12-02,150219
2008-12-03,118069
2008-12-04,144526
2008-12-05,111734
2008-12-06,80489
2008-12-07,156822
2008-12-08,109980
2008-12-09,170950
2008-12-10,283659
2008-12-11,261031
2008-12-12,185618
2008-12-13,99350
2008-12-14,205691
2008-12-15,358041
2008-12-16,347680
2008-12-17,406280
2008-12-18,463303
2008-12-19,661987
2008-12-20,537477
2008-12-21,629758
2008-12-22,563393
2008-12-23,641760
2008-12-24,491936
2008-12-25,197503
2008-12-26,543688
2008-12-27,561940
2008-12-28,297326
2008-12-29,168919
2008-12-30,227074
2008-12-31,215284

OpenAI SDK

Vercel AI SDK

LangChain SDK

import { z } from "zod";
import { zodResponseFormat } from "openai/helpers/zod";

const ForecastSchema = z.object({
	prediction: z.array(
		z.object({
			date: z.string(),
			departure_total_delay_mins: z.string(),
		})
	),
});

const response = await interfaze.chat.completions.create({
	model: "interfaze-beta",
	messages: [
		{
			role: "user",
			content:
				"Forecast the next 10 days of this: https://r2public.jigsawstack.com/interfaze/examples/prediction-example.csv",
		},
	],
	response_format: zodResponseFormat(ForecastSchema, "forecast_schema"),
});

console.log(response.choices[0].message.content);

//@ts-expect-error precontext is not typed
const precontext = response.precontext;
console.log("Forecast Results:", precontext?.[0]?.result);

JSON output

{
  "object": {
    "prediction": [
      { "date": "2009-01-01 00:00:00", "departure_total_delay_mins": "229913" },
      { "date": "2009-01-02 00:00:00", "departure_total_delay_mins": "243934" },
      { "date": "2009-01-03 00:00:00", "departure_total_delay_mins": "209254" },
      { "date": "2009-01-04 00:00:00", "departure_total_delay_mins": "227642" },
      { "date": "2009-01-05 00:00:00", "departure_total_delay_mins": "224595" },
      { "date": "2009-01-06 00:00:00", "departure_total_delay_mins": "210210" },
      { "date": "2009-01-07 00:00:00", "departure_total_delay_mins": "205004" },
      { "date": "2009-01-08 00:00:00", "departure_total_delay_mins": "223907" },
      { "date": "2009-01-09 00:00:00", "departure_total_delay_mins": "236490" },
      { "date": "2009-01-10 00:00:00", "departure_total_delay_mins": "200850" }
    ]
  },
  "response": {
    "id": "req-5b4f9b83-5157-47b5-b3e7-abd5e2117952",
    "modelId": "interfaze-beta",
    "body": {
      "id": "req-5b4f9b83-5157-47b5-b3e7-abd5e2117952",
      "object": "chat.completion",
      "model": "interfaze-beta",
      "usage": {
        "prompt_tokens": 20769,
        "completion_tokens": 4676,
        "total_tokens": 25445
      },
      "precontext": [
        {
          "name": "forecast",
          "result": {
            "predictions": [
              { "date": "2009-01-01 00:00:00", "value": 229913 },
              { "date": "2009-01-02 00:00:00", "value": 243934 },
              { "date": "2009-01-03 00:00:00", "value": 209254 },
              { "date": "2009-01-04 00:00:00", "value": 227642 },
              { "date": "2009-01-05 00:00:00", "value": 224595 },
              { "date": "2009-01-06 00:00:00", "value": 210210 },
              { "date": "2009-01-07 00:00:00", "value": 205004 },
              { "date": "2009-01-08 00:00:00", "value": 223907 },
              { "date": "2009-01-09 00:00:00", "value": 236490 },
              { "date": "2009-01-10 00:00:00", "value": 200850 }
            ]
          }
        }
      ]
    }
  },
  "finishReason": "stop",
  "usage": {
    "inputTokens": 20769,
    "outputTokens": 4676,
    "totalTokens": 25445
  }
}

precontext contains the forecast computation used by the model to produce the final structured response.

Previous

Code Sandboxing

Next

Translation

Interfaze

logo

Product

Playground

OCR

Models

Leaderboards

Pricing