tycheon 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (138) hide show
  1. tycheon-0.1.0/.gitignore +72 -0
  2. tycheon-0.1.0/LICENSE +202 -0
  3. tycheon-0.1.0/PKG-INFO +319 -0
  4. tycheon-0.1.0/README.md +254 -0
  5. tycheon-0.1.0/benchmarks/README.md +37 -0
  6. tycheon-0.1.0/benchmarks/__init__.py +1 -0
  7. tycheon-0.1.0/benchmarks/configs/full.yaml +42 -0
  8. tycheon-0.1.0/benchmarks/configs/models/arima.yaml +4 -0
  9. tycheon-0.1.0/benchmarks/configs/models/chronos-2.yaml +6 -0
  10. tycheon-0.1.0/benchmarks/configs/models/drift.yaml +4 -0
  11. tycheon-0.1.0/benchmarks/configs/models/garch.yaml +4 -0
  12. tycheon-0.1.0/benchmarks/configs/models/kronos-base.yaml +6 -0
  13. tycheon-0.1.0/benchmarks/configs/models/kronos-mini.yaml +7 -0
  14. tycheon-0.1.0/benchmarks/configs/models/kronos-small.yaml +6 -0
  15. tycheon-0.1.0/benchmarks/configs/models/random-walk.yaml +4 -0
  16. tycheon-0.1.0/benchmarks/configs/models/seasonal-naive.yaml +4 -0
  17. tycheon-0.1.0/benchmarks/configs/models/timesfm-2.5-200m.yaml +6 -0
  18. tycheon-0.1.0/benchmarks/configs/models/tycheon-calibrated.yaml +8 -0
  19. tycheon-0.1.0/benchmarks/configs/models/tycheon-ensemble.yaml +9 -0
  20. tycheon-0.1.0/benchmarks/configs/small.yaml +47 -0
  21. tycheon-0.1.0/benchmarks/datasets/manifest.yaml +37 -0
  22. tycheon-0.1.0/benchmarks/datasets.py +84 -0
  23. tycheon-0.1.0/benchmarks/execute.py +295 -0
  24. tycheon-0.1.0/benchmarks/models.py +139 -0
  25. tycheon-0.1.0/benchmarks/render.py +306 -0
  26. tycheon-0.1.0/benchmarks/results/small/0.1.0.json +1587 -0
  27. tycheon-0.1.0/benchmarks/run.py +211 -0
  28. tycheon-0.1.0/deploy/README.md +11 -0
  29. tycheon-0.1.0/ee/LICENSE +26 -0
  30. tycheon-0.1.0/ee/README.md +26 -0
  31. tycheon-0.1.0/examples/README.md +21 -0
  32. tycheon-0.1.0/pyproject.toml +305 -0
  33. tycheon-0.1.0/src/tycheon/__init__.py +32 -0
  34. tycheon-0.1.0/src/tycheon/_svg.py +55 -0
  35. tycheon-0.1.0/src/tycheon/agents/README.md +33 -0
  36. tycheon-0.1.0/src/tycheon/agents/__init__.py +7 -0
  37. tycheon-0.1.0/src/tycheon/backtest/__init__.py +57 -0
  38. tycheon-0.1.0/src/tycheon/backtest/costs.py +121 -0
  39. tycheon-0.1.0/src/tycheon/backtest/factories.py +145 -0
  40. tycheon-0.1.0/src/tycheon/backtest/guards.py +142 -0
  41. tycheon-0.1.0/src/tycheon/backtest/metrics.py +381 -0
  42. tycheon-0.1.0/src/tycheon/backtest/walk_forward.py +246 -0
  43. tycheon-0.1.0/src/tycheon/calibration/__init__.py +33 -0
  44. tycheon-0.1.0/src/tycheon/calibration/conformal.py +411 -0
  45. tycheon-0.1.0/src/tycheon/calibration/diagnostics.py +227 -0
  46. tycheon-0.1.0/src/tycheon/calibration/forecaster.py +110 -0
  47. tycheon-0.1.0/src/tycheon/calibration/metrics.py +125 -0
  48. tycheon-0.1.0/src/tycheon/calibration/plots.py +87 -0
  49. tycheon-0.1.0/src/tycheon/calibration/scores.py +288 -0
  50. tycheon-0.1.0/src/tycheon/covariates/__init__.py +27 -0
  51. tycheon-0.1.0/src/tycheon/covariates/features.py +149 -0
  52. tycheon-0.1.0/src/tycheon/covariates/residual.py +349 -0
  53. tycheon-0.1.0/src/tycheon/covariates/store.py +164 -0
  54. tycheon-0.1.0/src/tycheon/data/__init__.py +23 -0
  55. tycheon-0.1.0/src/tycheon/data/actions.py +140 -0
  56. tycheon-0.1.0/src/tycheon/data/asof.py +84 -0
  57. tycheon-0.1.0/src/tycheon/data/providers/__init__.py +1 -0
  58. tycheon-0.1.0/src/tycheon/data/providers/base.py +128 -0
  59. tycheon-0.1.0/src/tycheon/data/providers/file.py +86 -0
  60. tycheon-0.1.0/src/tycheon/data/providers/licensed.py +91 -0
  61. tycheon-0.1.0/src/tycheon/data/providers/yfinance.py +109 -0
  62. tycheon-0.1.0/src/tycheon/data/sample.py +194 -0
  63. tycheon-0.1.0/src/tycheon/data/schema.py +143 -0
  64. tycheon-0.1.0/src/tycheon/data/store.py +205 -0
  65. tycheon-0.1.0/src/tycheon/errors.py +45 -0
  66. tycheon-0.1.0/src/tycheon/governance/README.md +37 -0
  67. tycheon-0.1.0/src/tycheon/governance/__init__.py +9 -0
  68. tycheon-0.1.0/src/tycheon/models/__init__.py +23 -0
  69. tycheon-0.1.0/src/tycheon/models/base.py +563 -0
  70. tycheon-0.1.0/src/tycheon/models/baselines/__init__.py +20 -0
  71. tycheon-0.1.0/src/tycheon/models/baselines/_common.py +29 -0
  72. tycheon-0.1.0/src/tycheon/models/baselines/arima.py +68 -0
  73. tycheon-0.1.0/src/tycheon/models/baselines/drift.py +49 -0
  74. tycheon-0.1.0/src/tycheon/models/baselines/garch.py +80 -0
  75. tycheon-0.1.0/src/tycheon/models/baselines/random_walk.py +48 -0
  76. tycheon-0.1.0/src/tycheon/models/baselines/seasonal_naive.py +57 -0
  77. tycheon-0.1.0/src/tycheon/models/chronos/__init__.py +5 -0
  78. tycheon-0.1.0/src/tycheon/models/chronos/forecaster.py +113 -0
  79. tycheon-0.1.0/src/tycheon/models/devices.py +37 -0
  80. tycheon-0.1.0/src/tycheon/models/kronos/__init__.py +10 -0
  81. tycheon-0.1.0/src/tycheon/models/kronos/forecaster.py +306 -0
  82. tycheon-0.1.0/src/tycheon/models/kronos/sampling.py +172 -0
  83. tycheon-0.1.0/src/tycheon/models/kronos/specs.py +83 -0
  84. tycheon-0.1.0/src/tycheon/models/kronos/vendor.py +139 -0
  85. tycheon-0.1.0/src/tycheon/models/kronos/windowing.py +121 -0
  86. tycheon-0.1.0/src/tycheon/models/timesfm/__init__.py +5 -0
  87. tycheon-0.1.0/src/tycheon/models/timesfm/forecaster.py +133 -0
  88. tycheon-0.1.0/src/tycheon/py.typed +0 -0
  89. tycheon-0.1.0/src/tycheon/risk/__init__.py +68 -0
  90. tycheon-0.1.0/src/tycheon/risk/measures.py +283 -0
  91. tycheon-0.1.0/src/tycheon/risk/plots.py +112 -0
  92. tycheon-0.1.0/src/tycheon/risk/portfolio.py +362 -0
  93. tycheon-0.1.0/src/tycheon/risk/report.py +556 -0
  94. tycheon-0.1.0/src/tycheon/risk/scenarios.py +261 -0
  95. tycheon-0.1.0/src/tycheon/routing/__init__.py +25 -0
  96. tycheon-0.1.0/src/tycheon/routing/ensemble.py +396 -0
  97. tycheon-0.1.0/src/tycheon/routing/regimes.py +157 -0
  98. tycheon-0.1.0/src/tycheon/serve/__init__.py +1 -0
  99. tycheon-0.1.0/tests/conftest.py +253 -0
  100. tycheon-0.1.0/tests/test_architecture.py +171 -0
  101. tycheon-0.1.0/tests/test_backtest_metrics.py +285 -0
  102. tycheon-0.1.0/tests/test_backtest_walk_forward.py +406 -0
  103. tycheon-0.1.0/tests/test_baselines.py +215 -0
  104. tycheon-0.1.0/tests/test_benchmarks.py +362 -0
  105. tycheon-0.1.0/tests/test_calibrated_forecaster.py +118 -0
  106. tycheon-0.1.0/tests/test_calibration_diagnostics.py +126 -0
  107. tycheon-0.1.0/tests/test_calibration_metrics.py +186 -0
  108. tycheon-0.1.0/tests/test_calibration_scores.py +175 -0
  109. tycheon-0.1.0/tests/test_conformal.py +418 -0
  110. tycheon-0.1.0/tests/test_covariates.py +408 -0
  111. tycheon-0.1.0/tests/test_data_actions.py +157 -0
  112. tycheon-0.1.0/tests/test_data_asof.py +77 -0
  113. tycheon-0.1.0/tests/test_data_providers.py +328 -0
  114. tycheon-0.1.0/tests/test_data_sample.py +98 -0
  115. tycheon-0.1.0/tests/test_data_schema.py +146 -0
  116. tycheon-0.1.0/tests/test_data_store.py +174 -0
  117. tycheon-0.1.0/tests/test_forecaster_contract.py +256 -0
  118. tycheon-0.1.0/tests/test_foundation_adapters.py +226 -0
  119. tycheon-0.1.0/tests/test_foundation_slow.py +137 -0
  120. tycheon-0.1.0/tests/test_imports.py +103 -0
  121. tycheon-0.1.0/tests/test_kronos_forecaster.py +344 -0
  122. tycheon-0.1.0/tests/test_kronos_vendor.py +143 -0
  123. tycheon-0.1.0/tests/test_kronos_windowing.py +153 -0
  124. tycheon-0.1.0/tests/test_makefile.py +80 -0
  125. tycheon-0.1.0/tests/test_models_base.py +457 -0
  126. tycheon-0.1.0/tests/test_packaging.py +112 -0
  127. tycheon-0.1.0/tests/test_release_files.py +126 -0
  128. tycheon-0.1.0/tests/test_repo_layout.py +151 -0
  129. tycheon-0.1.0/tests/test_risk_measures.py +295 -0
  130. tycheon-0.1.0/tests/test_risk_portfolio.py +441 -0
  131. tycheon-0.1.0/tests/test_risk_report.py +167 -0
  132. tycheon-0.1.0/tests/test_routing.py +357 -0
  133. tycheon-0.1.0/tests/test_warning_policy.py +39 -0
  134. tycheon-0.1.0/third_party/kronos/LICENSE +21 -0
  135. tycheon-0.1.0/third_party/kronos/README.md +39 -0
  136. tycheon-0.1.0/third_party/kronos/UPSTREAM.json +12 -0
  137. tycheon-0.1.0/third_party/kronos/model/kronos.py +662 -0
  138. tycheon-0.1.0/third_party/kronos/model/module.py +570 -0
@@ -0,0 +1,72 @@
1
+ # Python
2
+ __pycache__/
3
+ *.py[cod]
4
+ *.egg-info/
5
+ .eggs/
6
+ build/
7
+ dist/
8
+ *.so
9
+
10
+ # Environments
11
+ .venv/
12
+ venv/
13
+ .python-version
14
+
15
+ # Secrets — never commit real values; see .env.example
16
+ .env
17
+ .env.*
18
+ !.env.example
19
+ *.pem
20
+ *.key
21
+ secrets/
22
+
23
+ # Tooling caches
24
+ .pytest_cache/
25
+ .mypy_cache/
26
+ .ruff_cache/
27
+ .hypothesis/
28
+ .coverage
29
+ .coverage.*
30
+ coverage.xml
31
+ htmlcov/
32
+
33
+ # Docs
34
+ site/
35
+
36
+ # Local data and model caches — market data is licensed; never commit it
37
+ /data/
38
+ *.parquet
39
+ *.csv
40
+ !benchmarks/**/*.csv
41
+ *.duckdb
42
+ *.sqlite
43
+ *.sqlite3
44
+ *.db
45
+ .tycheon/
46
+ models_cache/
47
+ hf_cache/
48
+ *.ckpt
49
+ *.safetensors
50
+
51
+ # Generated example output (the plot is rebuilt by `make example`)
52
+ examples/output/
53
+
54
+ # Benchmark output (results are published deliberately, not incidentally)
55
+ benchmarks/results/local/
56
+
57
+ # Editors / OS
58
+ .idea/
59
+ .vscode/
60
+ .DS_Store
61
+ Thumbs.db
62
+
63
+ # Terraform
64
+ .terraform/
65
+ *.tfstate
66
+ *.tfstate.*
67
+ *.tfvars
68
+ !*.tfvars.example
69
+
70
+ # Node (ee/dashboard)
71
+ node_modules/
72
+ .next/
tycheon-0.1.0/LICENSE ADDED
@@ -0,0 +1,202 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "{}"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright 2026 The Tycheon Authors
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
202
+
tycheon-0.1.0/PKG-INFO ADDED
@@ -0,0 +1,319 @@
1
+ Metadata-Version: 2.5
2
+ Name: tycheon
3
+ Version: 0.1.0
4
+ Summary: Calibrated financial forecasting and risk. Kronos forecasts the path; Tycheon tells you how much to trust it.
5
+ Project-URL: Homepage, https://github.com/anilatambharii/tycheon
6
+ Project-URL: Repository, https://github.com/anilatambharii/tycheon
7
+ Project-URL: Issues, https://github.com/anilatambharii/tycheon/issues
8
+ Project-URL: Documentation, https://github.com/anilatambharii/tycheon/tree/main/docs
9
+ Author: The Tycheon Authors
10
+ License-Expression: Apache-2.0
11
+ License-File: LICENSE
12
+ License-File: third_party/kronos/LICENSE
13
+ Keywords: backtesting,calibration,conformal-prediction,expected-shortfall,fintech,forecasting,kronos,quant,risk,time-series,value-at-risk
14
+ Classifier: Development Status :: 3 - Alpha
15
+ Classifier: Intended Audience :: Developers
16
+ Classifier: Intended Audience :: Financial and Insurance Industry
17
+ Classifier: Intended Audience :: Science/Research
18
+ Classifier: Operating System :: OS Independent
19
+ Classifier: Programming Language :: Python :: 3
20
+ Classifier: Programming Language :: Python :: 3.11
21
+ Classifier: Programming Language :: Python :: 3.12
22
+ Classifier: Topic :: Office/Business :: Financial :: Investment
23
+ Classifier: Topic :: Scientific/Engineering :: Information Analysis
24
+ Classifier: Typing :: Typed
25
+ Requires-Python: >=3.11
26
+ Requires-Dist: arch<9,>=8.0
27
+ Requires-Dist: duckdb<2,>=1.1
28
+ Requires-Dist: lightgbm<5,>=4.5
29
+ Requires-Dist: numpy<3,>=2.1
30
+ Requires-Dist: pandas<4,>=2.2
31
+ Requires-Dist: pyarrow<26,>=18
32
+ Requires-Dist: pydantic<3,>=2.11
33
+ Requires-Dist: scipy<2,>=1.14
34
+ Requires-Dist: statsmodels<1,>=0.14
35
+ Provides-Extra: agents
36
+ Requires-Dist: boto3<2,>=1.35; extra == 'agents'
37
+ Requires-Dist: fastapi<1,>=0.115; extra == 'agents'
38
+ Requires-Dist: mcp<2,>=1.2; extra == 'agents'
39
+ Requires-Dist: psycopg[binary,pool]<4,>=3.2; extra == 'agents'
40
+ Requires-Dist: redis<9,>=5.2; extra == 'agents'
41
+ Requires-Dist: uvicorn[standard]<1,>=0.32; extra == 'agents'
42
+ Provides-Extra: chronos
43
+ Requires-Dist: chronos-forecasting<3,>=2.3; extra == 'chronos'
44
+ Provides-Extra: gpu
45
+ Requires-Dist: accelerate<2,>=1.1; extra == 'gpu'
46
+ Requires-Dist: torch<3,>=2.5; extra == 'gpu'
47
+ Provides-Extra: kronos
48
+ Requires-Dist: einops<1,>=0.8; extra == 'kronos'
49
+ Requires-Dist: huggingface-hub<1,>=0.26; extra == 'kronos'
50
+ Requires-Dist: safetensors<1,>=0.4; extra == 'kronos'
51
+ Requires-Dist: torch<3,>=2.5; extra == 'kronos'
52
+ Requires-Dist: tqdm<5,>=4.66; extra == 'kronos'
53
+ Provides-Extra: report
54
+ Requires-Dist: matplotlib<4,>=3.9; extra == 'report'
55
+ Provides-Extra: serve
56
+ Requires-Dist: boto3<2,>=1.35; extra == 'serve'
57
+ Requires-Dist: fastapi<1,>=0.115; extra == 'serve'
58
+ Requires-Dist: mcp<2,>=1.2; extra == 'serve'
59
+ Requires-Dist: psycopg[binary,pool]<4,>=3.2; extra == 'serve'
60
+ Requires-Dist: redis<9,>=5.2; extra == 'serve'
61
+ Requires-Dist: uvicorn[standard]<1,>=0.32; extra == 'serve'
62
+ Provides-Extra: timesfm
63
+ Requires-Dist: timesfm[torch]<4,>=3.0.2; extra == 'timesfm'
64
+ Description-Content-Type: text/markdown
65
+
66
+ # Tycheon
67
+
68
+ **Kronos forecasts the path; Tycheon tells you how much to trust it.**
69
+
70
+ Tycheon is the open-source calibrated forecasting and risk layer for financial
71
+ time series. Foundation models for time series will happily hand you a
72
+ trajectory with no honest statement of its uncertainty, no check that its
73
+ intervals hold up out of sample, and no translation into the numbers a risk
74
+ desk actually uses. Tycheon is that missing layer.
75
+
76
+ [![License](https://img.shields.io/badge/license-Apache--2.0-blue.svg)](https://github.com/anilatambharii/tycheon/blob/main/LICENSE)
77
+ [![Python](https://img.shields.io/badge/python-3.11%20%7C%203.12-blue.svg)](https://github.com/anilatambharii/tycheon/blob/main/pyproject.toml)
78
+
79
+ > **Status: v0.1.0 (alpha).** Point-in-time data, forecasters (Kronos, TimesFM, Chronos and
80
+ > honest baselines), conformal calibration with measured holdout coverage, a regime-weighted
81
+ > ensemble that always includes the random walk, a risk layer (VaR, Expected Shortfall,
82
+ > drawdown, stress) with a JSON and HTML report, and a leakage-guarded walk-forward
83
+ > evaluation that reads every model against the random walk with Diebold-Mariano tests.
84
+ > **The evidence so far is synthetic: on the bundled series no model is distinguishable from
85
+ > the random walk, and we publish that.** See the [leaderboard](https://github.com/anilatambharii/tycheon/blob/main/docs/leaderboard/index.md).
86
+ > Multi-asset portfolio risk is always labelled **uncalibrated**: dependence is assumed.
87
+
88
+ ![Kronos-small beside the random-walk baseline on a synthetic series, from examples/forecast.py](https://raw.githubusercontent.com/anilatambharii/tycheon/main/docs/assets/forecast-example.png)
89
+
90
+ *Kronos-small and the random walk, forecasting the same synthetic series from the same
91
+ history (`make example`). On this one series Kronos-small's interval is about three times
92
+ narrower and the realised path leaves it: a single anecdote, not a result, and exactly
93
+ the over-confidence the calibration phases exist to measure.*
94
+
95
+ ## What it does
96
+
97
+ | Capability | What that means |
98
+ |---|---|
99
+ | **Calibrated uncertainty** | Conformal prediction intervals with reliability diagnostics, so 90% coverage means 90% coverage. |
100
+ | **Exogenous covariates** | News, fundamentals and macro features — not OHLCV alone. |
101
+ | **Multi-model routing** | Kronos, TimesFM, Chronos and honest baselines, weighted by detected regime. |
102
+ | **Forecast-to-risk** | VaR, Expected Shortfall, drawdown probability, stress scenarios, portfolio aggregation. |
103
+ | **Leakage-proof evaluation** | Walk-forward backtesting with embargoes, a cost model, and a public leaderboard. |
104
+ | **Production serving** | REST and MCP, plus a governed agentic research workflow. |
105
+
106
+ Tycheon is B2B risk-analytics infrastructure for developers and fintechs. It is
107
+ **not** a consumer trade-signal product and it does **not** give personalized
108
+ investment advice.
109
+
110
+ ## Architecture
111
+
112
+ ```mermaid
113
+ flowchart TB
114
+ subgraph sources["Data sources (you bring the license)"]
115
+ md["Market data provider"]
116
+ news["News / filings"]
117
+ fund["Fundamentals / macro"]
118
+ end
119
+
120
+ subgraph data["tycheon.data — point-in-time store"]
121
+ asof["as_of gate<br/>refuses anything published after as_of"]
122
+ end
123
+
124
+ subgraph models["tycheon.models"]
125
+ kronos["Kronos"]
126
+ tfm["TimesFM"]
127
+ chron["Chronos"]
128
+ base["Baselines<br/>RW · drift · seasonal naive · ARIMA · GARCH"]
129
+ end
130
+
131
+ cov["tycheon.covariates<br/>news · fundamentals · macro"]
132
+ route["tycheon.routing<br/>regime detection → ensemble weights"]
133
+ cal["tycheon.calibration<br/>conformal intervals + reliability"]
134
+ risk["tycheon.risk<br/>VaR · ES · drawdown prob · stress"]
135
+ bt["tycheon.backtest<br/>walk-forward · embargo · costs · leakage guards"]
136
+ serve["tycheon.serve<br/>REST + MCP"]
137
+
138
+ gov["tycheon.governance<br/>the only place Keelgate is imported (T4)"]
139
+ agents["tycheon.agents<br/>planner · specialists · verifier (T4)"]
140
+
141
+ md --> asof
142
+ news --> asof
143
+ fund --> asof
144
+ asof --> models
145
+ asof --> cov
146
+ cov --> route
147
+ models --> route
148
+ route --> cal
149
+ cal --> risk
150
+ cal --> bt
151
+ risk --> bt
152
+ risk --> serve
153
+ cal --> serve
154
+ bt -.->|publishes| lb["benchmarks/<br/>public leaderboard"]
155
+ agents --> gov
156
+ gov -->|governed tools| serve
157
+
158
+ classDef future stroke-dasharray: 5 5
159
+ class gov,agents future
160
+ ```
161
+
162
+ Every forecast that leaves this system carries its intervals, its calibration
163
+ status, the model mix that produced it, its `as_of`, and a model card
164
+ reference. Every evaluation reports the random-walk baseline and a
165
+ Diebold-Mariano test — including when the baseline wins.
166
+
167
+ ## Quickstart
168
+
169
+ Requires [uv](https://docs.astral.sh/uv/) and Python 3.11+.
170
+
171
+ ```bash
172
+ git clone https://github.com/anilatambharii/tycheon.git
173
+ cd tycheon
174
+ make setup # venv + dev deps + CPU torch (for Kronos) + git hooks
175
+ make check # lint, format check, mypy --strict, fast tests
176
+ uv run python -c "import tycheon; print(tycheon.__version__)"
177
+ make example # Kronos-small beside the random walk -> examples/output/forecast.png
178
+ ```
179
+
180
+ A forecast is a distribution, always, and every read is point-in-time:
181
+
182
+ ```python
183
+ from tycheon.data import load_sample
184
+ from tycheon.models.baselines import RandomWalkForecaster
185
+ from tycheon.models.kronos import KronosForecaster
186
+
187
+ bars = load_sample("SYN-GARCH") # synthetic: Tycheon ships no market data
188
+ history = bars.iloc[:900]
189
+ as_of = history["available_at"].iloc[-1] # when this history became known
190
+
191
+ for model in (RandomWalkForecaster(), KronosForecaster("small")):
192
+ forecast = model.predict(history, horizon=10, n_samples=50, as_of=as_of)
193
+ print(forecast.summary()) # quantiles, calibration status, model mix, as_of, disclaimer
194
+ ```
195
+
196
+ Passing a history that includes anything published after `as_of` raises
197
+ `LookaheadError` before the model runs. See [ADR 0003](https://github.com/anilatambharii/tycheon/blob/main/docs/adr/0003-point-in-time-data-and-forecast-contract.md).
198
+
199
+ Optional dev services (Postgres, Redis, MinIO, Jaeger):
200
+
201
+ ```bash
202
+ cp .env.example .env
203
+ make up # start and wait for health
204
+ make down # stop and delete volumes
205
+ ```
206
+
207
+ The foundation models are optional extras, so the base install stays small
208
+ (`import tycheon.models` never imports torch):
209
+
210
+ ```bash
211
+ uv sync --extra kronos # Kronos (vendored) + torch
212
+ uv sync --extra timesfm # TimesFM 2.5
213
+ uv sync --extra chronos # Chronos-2
214
+ uv sync --extra serve # FastAPI + MCP server
215
+ uv sync --all-extras # everything
216
+ ```
217
+
218
+ ## Models
219
+
220
+ Every forecaster returns a `ForecastDistribution` and ships a
221
+ [model card](https://github.com/anilatambharii/tycheon/blob/main/docs/models/index.md).
222
+
223
+ | Forecaster | What it is | Sample paths | Card |
224
+ |---|---|---|---|
225
+ | `kronos-mini` / `-small` / `-base` | Zero-shot Kronos, 2048 / 512 / 512-bar context | yes | [mini](https://github.com/anilatambharii/tycheon/blob/main/docs/models/kronos-mini.md), [small](https://github.com/anilatambharii/tycheon/blob/main/docs/models/kronos-small.md), [base](https://github.com/anilatambharii/tycheon/blob/main/docs/models/kronos-base.md) |
226
+ | `timesfm-2.5-200m` | Zero-shot TimesFM 2.5 | quantiles only | [card](https://github.com/anilatambharii/tycheon/blob/main/docs/models/timesfm.md) |
227
+ | `chronos-2` | Zero-shot Chronos-2 | quantiles only | [card](https://github.com/anilatambharii/tycheon/blob/main/docs/models/chronos-2.md) |
228
+ | `random-walk` | Driftless log-price walk: the baseline everything is read against | yes | [card](https://github.com/anilatambharii/tycheon/blob/main/docs/models/random-walk.md) |
229
+ | `drift`, `seasonal-naive`, `arima`, `garch` | The other honest baselines | yes | [drift](https://github.com/anilatambharii/tycheon/blob/main/docs/models/drift.md), [seasonal-naive](https://github.com/anilatambharii/tycheon/blob/main/docs/models/seasonal-naive.md), [arima](https://github.com/anilatambharii/tycheon/blob/main/docs/models/arima.md), [garch](https://github.com/anilatambharii/tycheon/blob/main/docs/models/garch.md) |
230
+
231
+ Kronos is vendored from upstream at a pinned commit ([ADR 0002](https://github.com/anilatambharii/tycheon/blob/main/docs/adr/0002-kronos-integration.md)),
232
+ with its sampler replaced so the sample paths are kept rather than averaged away.
233
+
234
+ Run the small benchmark (CPU, synthetic data, a few minutes) and render the leaderboard:
235
+
236
+ ```bash
237
+ make benchmark-small
238
+ ```
239
+
240
+ Tutorials: [calibrated forecasts with Kronos](https://github.com/anilatambharii/tycheon/blob/main/docs/tutorials/calibrated-kronos.md) and
241
+ [run the benchmark](https://github.com/anilatambharii/tycheon/blob/main/docs/tutorials/run-the-benchmark.md). How the leaderboard stays honest:
242
+ [benchmark methodology](https://github.com/anilatambharii/tycheon/blob/main/docs/benchmark-methodology.md).
243
+
244
+ > **No `make` on Windows?** Every target is a one-line `uv` command; open the
245
+ > [`Makefile`](https://github.com/anilatambharii/tycheon/blob/main/Makefile) and run them directly, e.g. `uv sync` then
246
+ > `uv run ruff check . && uv run mypy && uv run pytest -m "not slow"`.
247
+
248
+ ## Project layout
249
+
250
+ ```
251
+ src/tycheon/
252
+ data/ provider protocol, as-of store, synthetic sample data
253
+ models/ kronos, timesfm, chronos, baselines
254
+ calibration/ conformal intervals, diagnostics
255
+ covariates/ news, fundamentals, macro features
256
+ routing/ regime detection, ensemble weighting
257
+ risk/ VaR, ES, drawdown prob, stress, portfolio aggregation
258
+ backtest/ walk-forward, metrics, cost model, leakage guards
259
+ governance/ the only place Keelgate is imported (from T4)
260
+ agents/ planner, specialists, verifier (from T4)
261
+ serve/ FastAPI + MCP server
262
+ benchmarks/ leaderboard harness, configs, results
263
+ third_party/ vendored upstream Kronos (MIT), byte-identical, hash-checked
264
+ docs/ methodology, ADRs, model cards
265
+ ee/ proprietary Tycheon Cloud — separate license
266
+ ```
267
+
268
+ ## Safety and data rules
269
+
270
+ These are not aspirations; they are enforced in tests and CI.
271
+
272
+ - **Point-in-time everything.** Every data read takes an `as_of` and refuses
273
+ data published after it. Leakage tests are mandatory for every data path.
274
+ - **No live execution.** v1 is paper and simulation only, and only through
275
+ Keelgate-governed tools.
276
+ - **Uncertainty is not optional.** No forecast ships without intervals,
277
+ calibration status, model mix, `as_of` and a model card.
278
+ - **Honest baselines.** Random walk plus Diebold-Mariano on every evaluation,
279
+ published whichever way it goes.
280
+ - **External text is data, never instructions.** News and filings are untrusted
281
+ input; nothing in them is ever executed.
282
+ - **Your data licence stays yours.** Providers are pluggable, customers bring
283
+ their own market-data licence, and Tycheon never redistributes licensed
284
+ exchange data. `yfinance` appears in examples and local dev only, clearly
285
+ labelled, never in the cloud product.
286
+
287
+ More in [`docs/safety.md`](https://github.com/anilatambharii/tycheon/blob/main/docs/safety.md) and [`SECURITY.md`](https://github.com/anilatambharii/tycheon/blob/main/SECURITY.md).
288
+
289
+ ## Sister project
290
+
291
+ [Keelgate](https://github.com/anilatambharii/keelgate) is the safety harness —
292
+ policy gates, capabilities, approvals, audit, durable loops, telemetry and
293
+ evals. Tycheon depends on it as a library from Phase T4, and every Keelgate
294
+ import is confined to
295
+ [`src/tycheon/governance/`](https://github.com/anilatambharii/tycheon/blob/main/src/tycheon/governance/README.md).
296
+
297
+ ## Open core
298
+
299
+ Everything outside `ee/` is Apache-2.0. `ee/` is Tycheon Cloud and carries its
300
+ own proprietary licence. The boundary and the rules for it are in
301
+ [`docs/adr/0001-licensing-and-open-core.md`](https://github.com/anilatambharii/tycheon/blob/main/docs/adr/0001-licensing-and-open-core.md).
302
+
303
+ Kronos is used under its upstream MIT licence
304
+ ([shiyu-coder/Kronos](https://github.com/shiyu-coder/Kronos)). Its code is vendored in
305
+ [`third_party/kronos/`](https://github.com/anilatambharii/tycheon/blob/main/third_party/kronos/README.md) with the original licence file,
306
+ which also ships inside the wheel.
307
+
308
+ ## Contributing
309
+
310
+ See [`CONTRIBUTING.md`](https://github.com/anilatambharii/tycheon/blob/main/CONTRIBUTING.md) and
311
+ [`CODE_OF_CONDUCT.md`](https://github.com/anilatambharii/tycheon/blob/main/CODE_OF_CONDUCT.md). `make check` must pass, tests ship
312
+ with code, and no PR lands without them.
313
+
314
+ ---
315
+
316
+ **For research and risk analytics. Not investment advice.** Nothing produced by
317
+ this software is a recommendation to buy or sell any security, and no part of it
318
+ is personalized financial advice. Past calibration does not guarantee future
319
+ coverage.