mjolnir-cli 0.2.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 (81) hide show
  1. mjolnir_cli-0.2.0/.gitignore +28 -0
  2. mjolnir_cli-0.2.0/LICENSE +202 -0
  3. mjolnir_cli-0.2.0/NOTICE +64 -0
  4. mjolnir_cli-0.2.0/PKG-INFO +87 -0
  5. mjolnir_cli-0.2.0/README.md +52 -0
  6. mjolnir_cli-0.2.0/hatch_build.py +31 -0
  7. mjolnir_cli-0.2.0/mjolnir_cli/__init__.py +8 -0
  8. mjolnir_cli-0.2.0/mjolnir_cli/__main__.py +4 -0
  9. mjolnir_cli-0.2.0/mjolnir_cli/accuracy.py +333 -0
  10. mjolnir_cli-0.2.0/mjolnir_cli/autoresearch.py +539 -0
  11. mjolnir_cli-0.2.0/mjolnir_cli/benchy.py +475 -0
  12. mjolnir_cli-0.2.0/mjolnir_cli/bundled/configs/Qwen/Qwen3.8-27B/NVFP4/config.yaml +78 -0
  13. mjolnir_cli-0.2.0/mjolnir_cli/bundled/configs/Qwen/Qwen3.8-27B/NVFP4_DFLASH2/config.yaml +103 -0
  14. mjolnir_cli-0.2.0/mjolnir_cli/bundled/configs/Qwen/Qwen3.8-27B/NVFP4_DSPARK/config.yaml +102 -0
  15. mjolnir_cli-0.2.0/mjolnir_cli/bundled/configs/Qwen/Qwen3.8-27B/NVFP4_FA2/config.yaml +84 -0
  16. mjolnir_cli-0.2.0/mjolnir_cli/bundled/configs/Qwen/Qwen3.8-27B/NVFP4_FA4hd256/config.yaml +104 -0
  17. mjolnir_cli-0.2.0/mjolnir_cli/bundled/configs/Qwen/Qwen3.8-27B/NVFP4_MJOLNIR/config.yaml +86 -0
  18. mjolnir_cli-0.2.0/mjolnir_cli/bundled/configs/Qwen/Qwen3.8-27B/NVFP4_MJOLNIR_E2M3/config.yaml +93 -0
  19. mjolnir_cli-0.2.0/mjolnir_cli/bundled/configs/Qwen/Qwen3.8-27B/NVFP4_MJOLNIR_E2M3_DFLASH2/config.yaml +123 -0
  20. mjolnir_cli-0.2.0/mjolnir_cli/bundled/configs/Qwen/Qwen3.8-27B/NVFP4_MJOLNIR_E2M3_DSPARK/config.yaml +124 -0
  21. mjolnir_cli-0.2.0/mjolnir_cli/bundled/configs/Qwen/Qwen3.8-27B/NVFP4_MJOLNIR_E2M3_LMH8/.env +2 -0
  22. mjolnir_cli-0.2.0/mjolnir_cli/bundled/configs/Qwen/Qwen3.8-27B/NVFP4_MJOLNIR_E2M3_LMH8/config.yaml +98 -0
  23. mjolnir_cli-0.2.0/mjolnir_cli/bundled/configs/Qwen/Qwen3.8-27B/NVFP4_MJOLNIR_E2M3_LMH8_VT32K/.env +4 -0
  24. mjolnir_cli-0.2.0/mjolnir_cli/bundled/configs/Qwen/Qwen3.8-27B/NVFP4_MJOLNIR_E2M3_LMH8_VT32K/config.yaml +98 -0
  25. mjolnir_cli-0.2.0/mjolnir_cli/bundled/configs/Qwen/Qwen3.8-27B/NVFP4_MJOLNIR_E2M3_LMH8_VT64K/.env +4 -0
  26. mjolnir_cli-0.2.0/mjolnir_cli/bundled/configs/Qwen/Qwen3.8-27B/NVFP4_MJOLNIR_E2M3_LMH8_VT64K/config.yaml +102 -0
  27. mjolnir_cli-0.2.0/mjolnir_cli/bundled/configs/Qwen/Qwen3.8-27B/NVFP4_MJOLNIR_E2M3_VT32K/.env +3 -0
  28. mjolnir_cli-0.2.0/mjolnir_cli/bundled/configs/Qwen/Qwen3.8-27B/NVFP4_MJOLNIR_E2M3_VT32K/config.yaml +98 -0
  29. mjolnir_cli-0.2.0/mjolnir_cli/bundled/configs/Qwen/Qwen3.8-27B/draft_vocab.json +1 -0
  30. mjolnir_cli-0.2.0/mjolnir_cli/bundled/configs/Qwen/Qwen3.8-27B/kv_scales.json +35197 -0
  31. mjolnir_cli-0.2.0/mjolnir_cli/bundled/configs/Qwen/Qwen3.8_chat_template.jinja +456 -0
  32. mjolnir_cli-0.2.0/mjolnir_cli/bundled/docker/litellm/docker-compose.yaml +113 -0
  33. mjolnir_cli-0.2.0/mjolnir_cli/bundled/docker/litellm/litellm.env.example +51 -0
  34. mjolnir_cli-0.2.0/mjolnir_cli/bundled/docker/litellm/litellm_config.template.example.yaml +192 -0
  35. mjolnir_cli-0.2.0/mjolnir_cli/bundled/docker/perses/README.md +89 -0
  36. mjolnir_cli-0.2.0/mjolnir_cli/bundled/docker/perses/dashboards/global-datasource.yaml +17 -0
  37. mjolnir_cli-0.2.0/mjolnir_cli/bundled/docker/perses/dashboards/performance_statistics.yaml +771 -0
  38. mjolnir_cli-0.2.0/mjolnir_cli/bundled/docker/perses/dashboards/project.yaml +13 -0
  39. mjolnir_cli-0.2.0/mjolnir_cli/bundled/docker/perses/dashboards/query_statistics.yaml +399 -0
  40. mjolnir_cli-0.2.0/mjolnir_cli/bundled/docker/perses/docker-compose.yaml +51 -0
  41. mjolnir_cli-0.2.0/mjolnir_cli/bundled/docker/perses/perses.yml +16 -0
  42. mjolnir_cli-0.2.0/mjolnir_cli/bundled/docker/perses/prometheus.template.yaml +20 -0
  43. mjolnir_cli-0.2.0/mjolnir_cli/bundled/scripts/hw/setup-thor.sh +1287 -0
  44. mjolnir_cli-0.2.0/mjolnir_cli/cachectl.py +146 -0
  45. mjolnir_cli-0.2.0/mjolnir_cli/charts.py +1687 -0
  46. mjolnir_cli-0.2.0/mjolnir_cli/cli.py +1480 -0
  47. mjolnir_cli-0.2.0/mjolnir_cli/clidoc.py +170 -0
  48. mjolnir_cli-0.2.0/mjolnir_cli/config.py +346 -0
  49. mjolnir_cli-0.2.0/mjolnir_cli/dockerctl.py +533 -0
  50. mjolnir_cli-0.2.0/mjolnir_cli/drivers/fa2_driver.py +89 -0
  51. mjolnir_cli-0.2.0/mjolnir_cli/drivers/fi_driver.py +134 -0
  52. mjolnir_cli-0.2.0/mjolnir_cli/e2e.py +302 -0
  53. mjolnir_cli-0.2.0/mjolnir_cli/fonts/InterDisplay-Bold.ttf +0 -0
  54. mjolnir_cli-0.2.0/mjolnir_cli/fonts/InterDisplay-Medium.ttf +0 -0
  55. mjolnir_cli-0.2.0/mjolnir_cli/fonts/InterDisplay-Regular.ttf +0 -0
  56. mjolnir_cli-0.2.0/mjolnir_cli/fonts/InterDisplay-SemiBold.ttf +0 -0
  57. mjolnir_cli-0.2.0/mjolnir_cli/fonts/OFL.txt +92 -0
  58. mjolnir_cli-0.2.0/mjolnir_cli/gate.py +233 -0
  59. mjolnir_cli-0.2.0/mjolnir_cli/history.py +159 -0
  60. mjolnir_cli-0.2.0/mjolnir_cli/interactive.py +383 -0
  61. mjolnir_cli-0.2.0/mjolnir_cli/legs.py +109 -0
  62. mjolnir_cli-0.2.0/mjolnir_cli/litellm.py +254 -0
  63. mjolnir_cli-0.2.0/mjolnir_cli/perses.py +214 -0
  64. mjolnir_cli-0.2.0/mjolnir_cli/picker.py +70 -0
  65. mjolnir_cli-0.2.0/mjolnir_cli/readme.py +1020 -0
  66. mjolnir_cli-0.2.0/mjolnir_cli/stack.py +340 -0
  67. mjolnir_cli-0.2.0/mjolnir_cli/tasks.py +122 -0
  68. mjolnir_cli-0.2.0/mjolnir_cli/theme.py +281 -0
  69. mjolnir_cli-0.2.0/mjolnir_cli/thor.py +108 -0
  70. mjolnir_cli-0.2.0/mjolnir_cli/verify/__init__.py +2 -0
  71. mjolnir_cli-0.2.0/mjolnir_cli/verify/cli.py +816 -0
  72. mjolnir_cli-0.2.0/mjolnir_cli/verify/docker.py +334 -0
  73. mjolnir_cli-0.2.0/mjolnir_cli/verify/kvcache.py +180 -0
  74. mjolnir_cli-0.2.0/mjolnir_cli/verify/legs.py +134 -0
  75. mjolnir_cli-0.2.0/mjolnir_cli/verify/ncu.py +141 -0
  76. mjolnir_cli-0.2.0/mjolnir_cli/verify/profile.py +312 -0
  77. mjolnir_cli-0.2.0/mjolnir_cli/verify/report.py +177 -0
  78. mjolnir_cli-0.2.0/mjolnir_cli/verify/results.py +157 -0
  79. mjolnir_cli-0.2.0/mjolnir_cli/verify/spec.py +279 -0
  80. mjolnir_cli-0.2.0/mjolnir_cli/verify/stages.py +817 -0
  81. mjolnir_cli-0.2.0/pyproject.toml +64 -0
@@ -0,0 +1,28 @@
1
+ __pycache__/
2
+ *.py[cod]
3
+ .venv/
4
+ .pytest_cache/
5
+ .ruff_cache/
6
+ dist/
7
+ build/
8
+ *.egg-info/
9
+ .mjolnir-state.json
10
+ data/
11
+ runs/
12
+ # benchmark data: the structured verify results are committed (charts,
13
+ # README and docs are rendered from them); logs and e2e raw dirs are not
14
+ benchmarks/raw/*
15
+ !benchmarks/raw/verify/
16
+ # accuracy: accuracy.json per run is committed; each leg's tool-eval-bench
17
+ # workdir (SQLite, trace reports, server log) is not
18
+ !benchmarks/raw/accuracy/
19
+ benchmarks/raw/accuracy/*/*/
20
+ benchmarks/logs/
21
+ task/
22
+
23
+ # autoresearch: the live ledger is untracked (discards are `git reset --hard`);
24
+ # `mjolnir autoresearch export` snapshots it into research/runs/<tag>/
25
+ research/ledger.jsonl
26
+ research/ledger.tsv
27
+ # …and the exported runs ARE committed (the generic runs/ rule above would hide them)
28
+ !research/runs/
@@ -0,0 +1,202 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright [yyyy] [name of copyright owner]
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
@@ -0,0 +1,64 @@
1
+ Mjolnir
2
+ Copyright 2026 Mieszko Syty (ms1design)
3
+
4
+ This product is licensed under the Apache License, Version 2.0 (see LICENSE),
5
+ except where a file states otherwise. It includes or modifies the third-party
6
+ works listed below; each keeps its own license and copyright notice.
7
+
8
+ -------------------------------------------------------------------------------
9
+ 1. NVIDIA CUTLASS — CuTe DSL examples BSD-3-Clause
10
+ -------------------------------------------------------------------------------
11
+ src/mjolnir/mjolnir/t5_decode.py (the Mjolnir decode-attention kernel) is
12
+ derived from
13
+
14
+ examples/python/CuTeDSL/cute/blackwell/kernel/attention/mixed_input_fmha/
15
+ mixed_input_fmha_decode.py
16
+ https://github.com/NVIDIA/cutlass
17
+ Copyright (c) 2025 - 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
18
+
19
+ The file is distributed under the BSD-3-Clause license, as a whole, with the
20
+ original NVIDIA notice and license text retained at its top; the Mjolnir
21
+ modifications to it are Copyright (c) 2026 Mieszko Syty and are licensed under
22
+ the same BSD-3-Clause terms.
23
+
24
+ -------------------------------------------------------------------------------
25
+ 2. vLLM Apache-2.0
26
+ -------------------------------------------------------------------------------
27
+ https://github.com/vllm-project/vllm — Copyright the vLLM project contributors.
28
+
29
+ - docker/vllm-thor/patches/*.patch (except thor-gdn-prefill-fi-sm110.patch)
30
+ modify vLLM source files; the narandill/mjolnir-vllm image applies them to
31
+ the vLLM package of the official vllm/vllm-openai image, and marks every file
32
+ it changes (see docker/vllm-thor/apply_patches.py). Patches 49652, 50885,
33
+ 54165 and 55519 are adapted from the corresponding (unmerged) vLLM pull
34
+ requests.
35
+ - docker/perses/dashboards/performance_statistics.yaml and
36
+ query_statistics.yaml are adapted from
37
+ examples/observability/dashboards/perses/ (changes listed in their headers).
38
+
39
+ -------------------------------------------------------------------------------
40
+ 3. FlashAttention (FA4, CuTe DSL; vendored in vLLM as vllm_flash_attn) BSD-3-Clause
41
+ -------------------------------------------------------------------------------
42
+ https://github.com/Dao-AILab/flash-attention — Copyright (c) Tri Dao and
43
+ contributors. thor-fa4-fp8kv-sm110.patch, thor-fa4-hd256-fp8-sm110.patch and
44
+ thor-fa4-hd256-1cta-decode-sm110.patch modify files of vllm/vllm_flash_attn/
45
+ cute/ (the FlashAttention 4 kernels as vendored by vLLM). The Mjolnir kernel
46
+ itself contains no FlashAttention code; it follows the published
47
+ FlashAttention / FlashDecoding algorithms (online softmax, split-KV + LSE merge).
48
+
49
+ -------------------------------------------------------------------------------
50
+ 4. FlashInfer Apache-2.0
51
+ -------------------------------------------------------------------------------
52
+ https://github.com/flashinfer-ai/flashinfer — Copyright the FlashInfer
53
+ contributors. thor-gdn-prefill-fi-sm110.patch modifies flashinfer/gdn_prefill.py
54
+ in the image's FlashInfer package.
55
+
56
+ -------------------------------------------------------------------------------
57
+ The narandill/mjolnir-vllm container image
58
+ -------------------------------------------------------------------------------
59
+ The image is built FROM the official vllm/vllm-openai image and redistributes
60
+ everything in it (vLLM, PyTorch, FlashInfer, NVIDIA CUDA libraries, the
61
+ NVIDIA CUTLASS DSL, Ubuntu packages, ...) under those components' own licenses
62
+ — see the license files inside the image and the upstream projects. It adds
63
+ the mjolnir-kernel package and the patches above; their LICENSE and this
64
+ NOTICE are installed at /usr/share/doc/mjolnir/.
@@ -0,0 +1,87 @@
1
+ Metadata-Version: 2.5
2
+ Name: mjolnir-cli
3
+ Version: 0.2.0
4
+ Summary: Serve, benchmark and document LLMs on NVIDIA Jetson AGX Thor: YAML model configs, the Mjolnir vLLM image, KV-cache calibration, kernel / serving / accuracy benchmarks and auto-rendered reports.
5
+ Project-URL: Homepage, https://github.com/thor-arena/mjolnir
6
+ Project-URL: Documentation, https://github.com/thor-arena/mjolnir/tree/main/docs
7
+ Project-URL: Repository, https://github.com/thor-arena/mjolnir.git
8
+ Project-URL: Issues, https://github.com/thor-arena/mjolnir/issues
9
+ Project-URL: Changelog, https://github.com/thor-arena/mjolnir/releases
10
+ Project-URL: CLI reference, https://github.com/thor-arena/mjolnir/blob/main/docs/cli.md
11
+ Author-email: Mieszko Syty <mieszko@ms1design.pl>
12
+ License-Expression: Apache-2.0
13
+ License-File: LICENSE
14
+ License-File: NOTICE
15
+ Keywords: benchmark,cli,docker,jetson,llm,ncu,serving,sm110,thor,vllm
16
+ Classifier: Development Status :: 4 - Beta
17
+ Classifier: Environment :: Console
18
+ Classifier: Intended Audience :: Developers
19
+ Classifier: Operating System :: POSIX :: Linux
20
+ Classifier: Programming Language :: Python :: 3
21
+ Classifier: Programming Language :: Python :: 3.10
22
+ Classifier: Programming Language :: Python :: 3.11
23
+ Classifier: Programming Language :: Python :: 3.12
24
+ Classifier: Programming Language :: Python :: 3.13
25
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
26
+ Classifier: Topic :: System :: Benchmark
27
+ Requires-Python: >=3.10
28
+ Requires-Dist: jinja2>=3.1.6
29
+ Requires-Dist: pyyaml>=6.0.3
30
+ Requires-Dist: rich>=15.0.0
31
+ Requires-Dist: typer>=0.12
32
+ Provides-Extra: plot
33
+ Requires-Dist: matplotlib>=3.10.9; extra == 'plot'
34
+ Description-Content-Type: text/markdown
35
+
36
+ # mjolnir-cli
37
+
38
+ **Serve, benchmark and document LLMs on the NVIDIA Jetson AGX Thor** with
39
+ [Mjolnir](https://github.com/thor-arena/mjolnir) — a decode-attention kernel
40
+ built for Thor (`sm_110`), a 6-bit KV-cache format for vLLM and a patched vLLM
41
+ image that runs them. This package is the `mjolnir` command that drives all of
42
+ it; the kernel itself ships separately as
43
+ [`mjolnir-kernel`](https://pypi.org/project/mjolnir-kernel/).
44
+
45
+ ```bash
46
+ uv tool install mjolnir-cli # or: pipx install mjolnir-cli
47
+ mjolnir hw setup # one-time Thor host setup (clocks, power mode, fans, swap)
48
+ mjolnir serve up # serve the default model on the Mjolnir image, port 6001
49
+ ```
50
+
51
+ ## What it does
52
+
53
+ - **Models as config dirs** — every served model config is a `config.yaml` of
54
+ `vllm serve` flags (plus an optional `.env` of switches inside its dir; the
55
+ model's calibration files sit next to the config dirs). The default
56
+ configs ship inside this package; add your own under
57
+ `~/.local/share/mjolnir/configs/`. `mjolnir model` picks the active one.
58
+ - **Serve** — `mjolnir serve up|down|status|logs` runs the
59
+ [`narandill/mjolnir-vllm`](https://hub.docker.com/r/narandill/mjolnir-vllm)
60
+ container with the active config, clears the page cache around it, and never
61
+ touches a server it did not start.
62
+ - **Calibrate** — `mjolnir calibrate` measures per-channel KV-cache scales (for
63
+ the 6-bit `e2m3` cache) and, with `--draft-vocab`, the drafter's vocabulary.
64
+ - **Benchmark** — `mjolnir verify <stage>` (kernel correctness and Nsight
65
+ Compute benchmarks), `mjolnir bench e2e|ab|perf` (end-to-end serving with
66
+ llama-benchy), `mjolnir bench accuracy` (tool-calling, GSM8K, MMLU, IFEval via
67
+ tool-eval-bench). Every run waits for a clean GPU window and saves raw JSON.
68
+ - **Document** — `mjolnir plot --readme` renders every chart, table and the
69
+ README from those raw results; `--site` builds the interactive page.
70
+ - **Research** — `mjolnir autoresearch` runs an agent loop that proposes,
71
+ tests and logs kernel experiments.
72
+
73
+ Every command, with options and defaults:
74
+ **[the CLI reference](https://github.com/thor-arena/mjolnir/blob/main/docs/cli.md)**
75
+ (generated from the commands; `mjolnir <command> --help` prints the same).
76
+
77
+ ## Requirements
78
+
79
+ A Jetson AGX Thor (JetPack 7.x) with Docker and the NVIDIA Container Toolkit
80
+ for anything that touches the GPU; Python ≥ 3.10. Charts need the `plot` extra
81
+ (`uv tool install 'mjolnir-cli[plot]'`).
82
+
83
+ ## Versions
84
+
85
+ `mjolnir-cli` and `mjolnir-kernel` version independently; the Docker image is
86
+ tagged after the upstream vLLM it is built on (`v0.31.0`). Release notes:
87
+ [GitHub Releases](https://github.com/thor-arena/mjolnir/releases).
@@ -0,0 +1,52 @@
1
+ # mjolnir-cli
2
+
3
+ **Serve, benchmark and document LLMs on the NVIDIA Jetson AGX Thor** with
4
+ [Mjolnir](https://github.com/thor-arena/mjolnir) — a decode-attention kernel
5
+ built for Thor (`sm_110`), a 6-bit KV-cache format for vLLM and a patched vLLM
6
+ image that runs them. This package is the `mjolnir` command that drives all of
7
+ it; the kernel itself ships separately as
8
+ [`mjolnir-kernel`](https://pypi.org/project/mjolnir-kernel/).
9
+
10
+ ```bash
11
+ uv tool install mjolnir-cli # or: pipx install mjolnir-cli
12
+ mjolnir hw setup # one-time Thor host setup (clocks, power mode, fans, swap)
13
+ mjolnir serve up # serve the default model on the Mjolnir image, port 6001
14
+ ```
15
+
16
+ ## What it does
17
+
18
+ - **Models as config dirs** — every served model config is a `config.yaml` of
19
+ `vllm serve` flags (plus an optional `.env` of switches inside its dir; the
20
+ model's calibration files sit next to the config dirs). The default
21
+ configs ship inside this package; add your own under
22
+ `~/.local/share/mjolnir/configs/`. `mjolnir model` picks the active one.
23
+ - **Serve** — `mjolnir serve up|down|status|logs` runs the
24
+ [`narandill/mjolnir-vllm`](https://hub.docker.com/r/narandill/mjolnir-vllm)
25
+ container with the active config, clears the page cache around it, and never
26
+ touches a server it did not start.
27
+ - **Calibrate** — `mjolnir calibrate` measures per-channel KV-cache scales (for
28
+ the 6-bit `e2m3` cache) and, with `--draft-vocab`, the drafter's vocabulary.
29
+ - **Benchmark** — `mjolnir verify <stage>` (kernel correctness and Nsight
30
+ Compute benchmarks), `mjolnir bench e2e|ab|perf` (end-to-end serving with
31
+ llama-benchy), `mjolnir bench accuracy` (tool-calling, GSM8K, MMLU, IFEval via
32
+ tool-eval-bench). Every run waits for a clean GPU window and saves raw JSON.
33
+ - **Document** — `mjolnir plot --readme` renders every chart, table and the
34
+ README from those raw results; `--site` builds the interactive page.
35
+ - **Research** — `mjolnir autoresearch` runs an agent loop that proposes,
36
+ tests and logs kernel experiments.
37
+
38
+ Every command, with options and defaults:
39
+ **[the CLI reference](https://github.com/thor-arena/mjolnir/blob/main/docs/cli.md)**
40
+ (generated from the commands; `mjolnir <command> --help` prints the same).
41
+
42
+ ## Requirements
43
+
44
+ A Jetson AGX Thor (JetPack 7.x) with Docker and the NVIDIA Container Toolkit
45
+ for anything that touches the GPU; Python ≥ 3.10. Charts need the `plot` extra
46
+ (`uv tool install 'mjolnir-cli[plot]'`).
47
+
48
+ ## Versions
49
+
50
+ `mjolnir-cli` and `mjolnir-kernel` version independently; the Docker image is
51
+ tagged after the upstream vLLM it is built on (`v0.31.0`). Release notes:
52
+ [GitHub Releases](https://github.com/thor-arena/mjolnir/releases).
@@ -0,0 +1,31 @@
1
+ """Bundle the repo resources the CLI needs into the mjolnir-cli wheel/sdist.
2
+
3
+ Builds from a checkout copy them from the repo root to ``mjolnir_cli/bundled/``
4
+ (model configs, the LiteLLM / Perses compose stacks, the Thor HW setup
5
+ script); builds from an sdist already carry them there, so the hook is a
6
+ no-op. At runtime ``mjolnir_cli.config.resource_path`` prefers a checkout's
7
+ copy and falls back to the bundled one.
8
+ """
9
+
10
+ from __future__ import annotations
11
+
12
+ from pathlib import Path
13
+
14
+ from hatchling.builders.hooks.plugin.interface import BuildHookInterface
15
+
16
+ # repo-relative path -> path inside the package
17
+ BUNDLED = {
18
+ "configs": "mjolnir_cli/bundled/configs",
19
+ "docker/litellm": "mjolnir_cli/bundled/docker/litellm",
20
+ "docker/perses": "mjolnir_cli/bundled/docker/perses",
21
+ "scripts/hw": "mjolnir_cli/bundled/scripts/hw",
22
+ }
23
+
24
+
25
+ class CustomBuildHook(BuildHookInterface):
26
+ def initialize(self, version, build_data):
27
+ repo = (Path(self.root) / ".." / "..").resolve()
28
+ for rel, dest in BUNDLED.items():
29
+ src = repo / rel
30
+ if src.is_dir():
31
+ build_data["force_include"][str(src)] = dest
@@ -0,0 +1,8 @@
1
+ """mjolnir-cli — the ``mjolnir`` command for Jetson AGX Thor (sm_110).
2
+
3
+ Serve the Mjolnir vLLM image, verify and benchmark the Mjolnir decode
4
+ kernel against FlashInfer and FlashAttention 2, and render the
5
+ data-driven README charts — one command surface.
6
+ """
7
+
8
+ __version__ = "0.2.0"
@@ -0,0 +1,4 @@
1
+ from mjolnir_cli.cli import app
2
+
3
+ if __name__ == "__main__":
4
+ app()