{"id":23130886,"url":"https://github.com/maxmekiska/thunder","last_synced_at":"2026-04-16T03:31:06.886Z","repository":{"id":268477811,"uuid":"904484316","full_name":"maxmekiska/thunder","owner":"maxmekiska","description":"pytorch lightning based time series forecasting deep learning pipeline","archived":false,"fork":false,"pushed_at":"2024-12-19T02:11:11.000Z","size":34,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-09T18:31:45.465Z","etag":null,"topics":["deep-learning-pipelines","docker","fastapi","nginx","pytorch-lightning","time-series"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/maxmekiska.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-12-17T01:33:54.000Z","updated_at":"2024-12-30T01:10:06.000Z","dependencies_parsed_at":"2024-12-18T06:06:44.321Z","dependency_job_id":null,"html_url":"https://github.com/maxmekiska/thunder","commit_stats":null,"previous_names":["maxmekiska/thunder"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maxmekiska%2Fthunder","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maxmekiska%2Fthunder/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maxmekiska%2Fthunder/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maxmekiska%2Fthunder/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/maxmekiska","download_url":"https://codeload.github.com/maxmekiska/thunder/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247136410,"owners_count":20889646,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["deep-learning-pipelines","docker","fastapi","nginx","pytorch-lightning","time-series"],"created_at":"2024-12-17T11:11:00.018Z","updated_at":"2026-04-16T03:31:06.868Z","avatar_url":"https://github.com/maxmekiska.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# `thunder`\n\nthunder is a time series prediction deep learning pipeline built on the following stack:\n\n1. pytorch-lightning\n2. scikit-learn\n3. FastAPI\n4. Nginx\n5. click\n\nAt its core, thunder is a barebones python library with a click-based command-line interface, enabling users to train an xLSTM model on time series data. It supports two main modes of operation:\n\n1. training mode via the command `python -m thunder chunk`. Model and training configurations can be easily modified in the config.json file. As the name implies, training is performed via chunking, which enables processing large datasets efficiently.\n\n2. inference mode via `python -m thunder serve`. thunder exposes a FastAPI endpoint `/predict` that accepts incoming data and returns predictions.\n\nAdditionally, thunder provides a near production ready framework for its inference functionality. This allows thunder to be deployed within a Docker compose setup, leveraging Nginx as a reverse proxy in front of the FastAPI application.\n\n## `python -m thunder serve`  \n\n### `/`\n\n```\ncurl -X GET  http://127.0.0.1:8000/\n```\n\n### `/predict`\n\n```\ncurl -X POST http://127.0.0.1:8000/predict -H \"Content-Type: application/json\" \\-d @data.json\n```\n\n## `python -m thunder chunk`\n\n```\npython -m thunder chunk --input climate-data.csv --size 500\n```\n\n## `configuration file`\n\n```python\n{\n  \"training_config\": {\n    \"epochs\": 10\n  },\n  \"preprocessor_path\": \"preprocessor/preprocessor-12-16-2024.pkl\",\n  \"model_path\": \"model/model-12-16-2024.pth\",\n  \"model_config\": {\n    \"num_features\": 1,\n    \"hidden_size\": 64,\n    \"num_layers\": 2,\n    \"future_steps\": 12,\n    \"learning_rate\": 0.001,\n    \"dropout\": 0.2,\n    \"num_attention_heads\": 4\n  },\n  \"preprocessing_config\": {\n    \"numerical_features\": [],\n    \"target_variables\": [\"meantemp\"],\n    \"use_target_as_feature\": true,\n    \"split_config\": {\n      \"past_steps\": 24,\n      \"future_steps\": 12,\n      \"train_ratio\": 0.7,\n      \"val_ratio\": 0.15,\n      \"batch_size\": 32\n    }\n}\n}\n```\n\n## `compose`\n\n`docker-compose up --build`\n\n```mermaid\ngraph TD\n    subgraph DockerCompose[Docker Compose]\n        subgraph NGINX[nginx reverse proxy]\n            NGINXProxy[Handles HTTP Requests]\n        end\n\n        subgraph FastAPIContainer[Docker Container]\n            FastAPILib[thunder]\n            ConfigFile[config.json]\n            SavedModel[model.pth - PyTorch]\n            Preprocessor[preprocessor.pkl]\n\n                subgraph FastAPIApp[FastAPI app]\n                    subgraph uvicorn\n                        inferenceendpoint[inference endpoint]\n                    end\n\n                end\n        end\n\n  \n\n        NGINXProxy --\u003e |sends request| inferenceendpoint\n    end\n\n    subgraph Client\n    \n    end\n\n    Client --\u003e|sends request| NGINXProxy\n    FastAPILib --\u003e|launches| FastAPIApp\n    FastAPILib --\u003e|loads| SavedModel\n    FastAPILib --\u003e|loads| Preprocessor\n    FastAPILib --\u003e|reads| ConfigFile\n    inferenceendpoint --\u003e|sends prediction| NGINXProxy\n    NGINXProxy --\u003e|returns prediction| Client\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaxmekiska%2Fthunder","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmaxmekiska%2Fthunder","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaxmekiska%2Fthunder/lists"}