Skip to content

Latest commit

 

History

History
95 lines (63 loc) · 3.13 KB

File metadata and controls

95 lines (63 loc) · 3.13 KB

Contributing to time-lm

Thank you for your interest in contributing! This document explains how to get started and what to keep in mind.


Project philosophy

time-lm is intentionally a single HTML file with no build step. Before adding a dependency or splitting into multiple files, ask: does this meaningfully improve the user experience or the developer experience, or does it add complexity without benefit?


Getting started

git clone https://github.com/your-username/time-lm.git
cd time-lm

# Option A — open directly
open index.html

# Option B — local server (recommended to avoid CORS)
python -m http.server 8080
# then open http://localhost:8080

No npm install. No build command. Edit index.html, reload the browser.


How to contribute

1. Bug reports

Open an issue and include:

  • Browser name and version
  • Steps to reproduce
  • What you expected vs. what happened
  • Console errors (F12 → Console tab)
  • If data-related: a minimal anonymised CSV that reproduces the issue

2. Feature requests

Open an issue describing the use case before writing code. For larger changes, discussing the approach first avoids wasted effort.

3. Pull requests

  1. Fork the repo and create a branch: git checkout -b feat/my-feature
  2. Make your changes in index.html (or add new files if genuinely needed)
  3. Test in at least Chrome and Firefox
  4. Open a PR with a clear description of what changed and why

Adding a new model

The most impactful contribution is adding a new foundation model. Requirements:

  • The model must be available as an ONNX file loadable by onnxruntime-web (WASM EP) or loadable via Transformers.js.
  • The model file must be publicly accessible (Hugging Face Hub is preferred).
  • Add an entry to MODEL_CATALOG with id, label, color, sizeHint, engine, author, year, desc.
  • Implement a forecast<ModelName>(history, horizon) function that returns { p50, p10?, p90?, status, meta }.
  • Register the forecaster in FORECASTERS and the core function in RMSE_CORES.
  • Test with all three demo datasets.

Code style

  • No TypeScript, no bundler — plain ES2022+ JavaScript inside a <script type="module">.
  • Follow the existing naming convention (camelCase for functions and variables).
  • Do not add comments that restate what the code does. Comments should explain why, not what.
  • Keep CSS inside the <style> block; use Tailwind utilities for layout.
  • Prefer async/await over .then() chains.
  • Always call await yieldToMain() inside long inference loops to keep the UI thread responsive.

Commit message convention

This project follows Conventional Commits:

feat: add Lag-Llama model support
fix: correct Chronos-2 quantile index mapping
perf: reduce TimesFM context padding overhead
docs: update browser compatibility table
refactor: extract normalizeSeries into shared utility

License

By contributing, you agree that your contributions will be licensed under the MIT License.