wsp-toolkit 0.3.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.
- wsp_toolkit-0.3.0/LICENSE +202 -0
- wsp_toolkit-0.3.0/PKG-INFO +238 -0
- wsp_toolkit-0.3.0/README.md +185 -0
- wsp_toolkit-0.3.0/pyproject.toml +83 -0
- wsp_toolkit-0.3.0/setup.cfg +4 -0
- wsp_toolkit-0.3.0/tests/test_arena.py +144 -0
- wsp_toolkit-0.3.0/tests/test_challenges.py +192 -0
- wsp_toolkit-0.3.0/tests/test_hf_adapter.py +77 -0
- wsp_toolkit-0.3.0/tests/test_leaderboard.py +61 -0
- wsp_toolkit-0.3.0/tests/test_m0_foundations.py +51 -0
- wsp_toolkit-0.3.0/tests/test_m1_access.py +150 -0
- wsp_toolkit-0.3.0/tests/test_m2_patches.py +123 -0
- wsp_toolkit-0.3.0/tests/test_m3_harness.py +104 -0
- wsp_toolkit-0.3.0/tests/test_m4_safety.py +178 -0
- wsp_toolkit-0.3.0/tests/test_m5_zoo.py +72 -0
- wsp_toolkit-0.3.0/tests/test_m6_features.py +63 -0
- wsp_toolkit-0.3.0/tests/test_m7_audit.py +59 -0
- wsp_toolkit-0.3.0/tests/test_qwen35_arch.py +55 -0
- wsp_toolkit-0.3.0/wsp_toolkit/__init__.py +1 -0
- wsp_toolkit-0.3.0/wsp_toolkit/agents/__init__.py +0 -0
- wsp_toolkit-0.3.0/wsp_toolkit/agents/api_runner.py +283 -0
- wsp_toolkit-0.3.0/wsp_toolkit/agents/arena_cli.py +146 -0
- wsp_toolkit-0.3.0/wsp_toolkit/agents/bugfix_agent.py +77 -0
- wsp_toolkit-0.3.0/wsp_toolkit/agents/challenge_baseline.py +129 -0
- wsp_toolkit-0.3.0/wsp_toolkit/agents/challenge_cli.py +64 -0
- wsp_toolkit-0.3.0/wsp_toolkit/agents/clients.py +93 -0
- wsp_toolkit-0.3.0/wsp_toolkit/agents/demos.py +30 -0
- wsp_toolkit-0.3.0/wsp_toolkit/agents/induction_finder.py +62 -0
- wsp_toolkit-0.3.0/wsp_toolkit/agents/leaderboard_cli.py +51 -0
- wsp_toolkit-0.3.0/wsp_toolkit/agents/zoo_baseline.py +188 -0
- wsp_toolkit-0.3.0/wsp_toolkit/api/__init__.py +0 -0
- wsp_toolkit-0.3.0/wsp_toolkit/api/app.py +277 -0
- wsp_toolkit-0.3.0/wsp_toolkit/api/views.py +215 -0
- wsp_toolkit-0.3.0/wsp_toolkit/challenge_defs.py +136 -0
- wsp_toolkit-0.3.0/wsp_toolkit/cli.py +103 -0
- wsp_toolkit-0.3.0/wsp_toolkit/config.py +77 -0
- wsp_toolkit-0.3.0/wsp_toolkit/core/__init__.py +0 -0
- wsp_toolkit-0.3.0/wsp_toolkit/core/arena.py +327 -0
- wsp_toolkit-0.3.0/wsp_toolkit/core/challenges.py +538 -0
- wsp_toolkit-0.3.0/wsp_toolkit/core/db.py +288 -0
- wsp_toolkit-0.3.0/wsp_toolkit/core/diff/__init__.py +0 -0
- wsp_toolkit-0.3.0/wsp_toolkit/core/diff/diff.py +316 -0
- wsp_toolkit-0.3.0/wsp_toolkit/core/diff/report.py +108 -0
- wsp_toolkit-0.3.0/wsp_toolkit/core/diff/service.py +84 -0
- wsp_toolkit-0.3.0/wsp_toolkit/core/diff/validate.py +86 -0
- wsp_toolkit-0.3.0/wsp_toolkit/core/directions.py +138 -0
- wsp_toolkit-0.3.0/wsp_toolkit/core/edit/__init__.py +0 -0
- wsp_toolkit-0.3.0/wsp_toolkit/core/edit/ops.py +137 -0
- wsp_toolkit-0.3.0/wsp_toolkit/core/evals/__init__.py +0 -0
- wsp_toolkit-0.3.0/wsp_toolkit/core/evals/benchmarks.py +66 -0
- wsp_toolkit-0.3.0/wsp_toolkit/core/evals/harness.py +208 -0
- wsp_toolkit-0.3.0/wsp_toolkit/core/evals/scorers.py +210 -0
- wsp_toolkit-0.3.0/wsp_toolkit/core/evals/worker.py +48 -0
- wsp_toolkit-0.3.0/wsp_toolkit/core/extras.py +104 -0
- wsp_toolkit-0.3.0/wsp_toolkit/core/features/__init__.py +0 -0
- wsp_toolkit-0.3.0/wsp_toolkit/core/features/cli.py +24 -0
- wsp_toolkit-0.3.0/wsp_toolkit/core/features/index.py +444 -0
- wsp_toolkit-0.3.0/wsp_toolkit/core/features/sae.py +99 -0
- wsp_toolkit-0.3.0/wsp_toolkit/core/features/service.py +78 -0
- wsp_toolkit-0.3.0/wsp_toolkit/core/inspect/__init__.py +0 -0
- wsp_toolkit-0.3.0/wsp_toolkit/core/inspect/tensors.py +221 -0
- wsp_toolkit-0.3.0/wsp_toolkit/core/leaderboard.py +174 -0
- wsp_toolkit-0.3.0/wsp_toolkit/core/patch/__init__.py +0 -0
- wsp_toolkit-0.3.0/wsp_toolkit/core/patch/patches.py +312 -0
- wsp_toolkit-0.3.0/wsp_toolkit/core/probe/__init__.py +0 -0
- wsp_toolkit-0.3.0/wsp_toolkit/core/probe/probe.py +177 -0
- wsp_toolkit-0.3.0/wsp_toolkit/core/safety/__init__.py +0 -0
- wsp_toolkit-0.3.0/wsp_toolkit/core/safety/netguard.py +86 -0
- wsp_toolkit-0.3.0/wsp_toolkit/core/safety/policy.py +124 -0
- wsp_toolkit-0.3.0/wsp_toolkit/core/service.py +723 -0
- wsp_toolkit-0.3.0/wsp_toolkit/core/util.py +180 -0
- wsp_toolkit-0.3.0/wsp_toolkit/core/workspace/__init__.py +0 -0
- wsp_toolkit-0.3.0/wsp_toolkit/core/workspace/adapters.py +606 -0
- wsp_toolkit-0.3.0/wsp_toolkit/core/workspace/archs.py +157 -0
- wsp_toolkit-0.3.0/wsp_toolkit/core/workspace/workspace.py +302 -0
- wsp_toolkit-0.3.0/wsp_toolkit/core/zoo/__init__.py +0 -0
- wsp_toolkit-0.3.0/wsp_toolkit/core/zoo/cli.py +30 -0
- wsp_toolkit-0.3.0/wsp_toolkit/core/zoo/generators.py +520 -0
- wsp_toolkit-0.3.0/wsp_toolkit/core/zoo/zoo.py +174 -0
- wsp_toolkit-0.3.0/wsp_toolkit/data/suites/lm_builtin.json +156 -0
- wsp_toolkit-0.3.0/wsp_toolkit/default_config.toml +69 -0
- wsp_toolkit-0.3.0/wsp_toolkit/fixtures/__init__.py +0 -0
- wsp_toolkit-0.3.0/wsp_toolkit/fixtures/finetunes.py +131 -0
- wsp_toolkit-0.3.0/wsp_toolkit/fixtures/train.py +285 -0
- wsp_toolkit-0.3.0/wsp_toolkit/mcp_server/__init__.py +0 -0
- wsp_toolkit-0.3.0/wsp_toolkit/mcp_server/__main__.py +3 -0
- wsp_toolkit-0.3.0/wsp_toolkit/mcp_server/server.py +101 -0
- wsp_toolkit-0.3.0/wsp_toolkit/site/__init__.py +0 -0
- wsp_toolkit-0.3.0/wsp_toolkit/site/build.py +91 -0
- wsp_toolkit-0.3.0/wsp_toolkit/site/templates/_board.html +13 -0
- wsp_toolkit-0.3.0/wsp_toolkit/site/templates/_layout.html +28 -0
- wsp_toolkit-0.3.0/wsp_toolkit/site/templates/arena.html +82 -0
- wsp_toolkit-0.3.0/wsp_toolkit/site/templates/index.html +63 -0
- wsp_toolkit-0.3.0/wsp_toolkit/site/templates/leaderboard.html +22 -0
- wsp_toolkit-0.3.0/wsp_toolkit/site/templates/site.css +200 -0
- wsp_toolkit-0.3.0/wsp_toolkit/site/templates/submit.html +21 -0
- wsp_toolkit-0.3.0/wsp_toolkit/ui/static/arena.js +1500 -0
- wsp_toolkit-0.3.0/wsp_toolkit/ui/static/fonts/OFL-JetBrainsMono.txt +93 -0
- wsp_toolkit-0.3.0/wsp_toolkit/ui/static/fonts/OFL-Orbitron.txt +93 -0
- wsp_toolkit-0.3.0/wsp_toolkit/ui/static/fonts/jetbrains-mono-latin-400-normal.woff2 +0 -0
- wsp_toolkit-0.3.0/wsp_toolkit/ui/static/fonts/jetbrains-mono-latin-700-normal.woff2 +0 -0
- wsp_toolkit-0.3.0/wsp_toolkit/ui/static/fonts/orbitron-latin-600-normal.woff2 +0 -0
- wsp_toolkit-0.3.0/wsp_toolkit/ui/static/fonts/orbitron-latin-800-normal.woff2 +0 -0
- wsp_toolkit-0.3.0/wsp_toolkit/ui/static/htmx.min.js +1 -0
- wsp_toolkit-0.3.0/wsp_toolkit/ui/static/style.css +123 -0
- wsp_toolkit-0.3.0/wsp_toolkit/ui/templates/_budget.html +1 -0
- wsp_toolkit-0.3.0/wsp_toolkit/ui/templates/_events.html +3 -0
- wsp_toolkit-0.3.0/wsp_toolkit/ui/templates/_heatmap.html +2 -0
- wsp_toolkit-0.3.0/wsp_toolkit/ui/templates/_rows.html +1 -0
- wsp_toolkit-0.3.0/wsp_toolkit/ui/templates/arena.html +112 -0
- wsp_toolkit-0.3.0/wsp_toolkit/ui/templates/audit.html +2 -0
- wsp_toolkit-0.3.0/wsp_toolkit/ui/templates/audits.html +1 -0
- wsp_toolkit-0.3.0/wsp_toolkit/ui/templates/base.html +12 -0
- wsp_toolkit-0.3.0/wsp_toolkit/ui/templates/challenges.html +17 -0
- wsp_toolkit-0.3.0/wsp_toolkit/ui/templates/feature.html +3 -0
- wsp_toolkit-0.3.0/wsp_toolkit/ui/templates/features.html +4 -0
- wsp_toolkit-0.3.0/wsp_toolkit/ui/templates/home.html +21 -0
- wsp_toolkit-0.3.0/wsp_toolkit/ui/templates/leaderboard.html +2 -0
- wsp_toolkit-0.3.0/wsp_toolkit/ui/templates/model.html +11 -0
- wsp_toolkit-0.3.0/wsp_toolkit/ui/templates/models.html +2 -0
- wsp_toolkit-0.3.0/wsp_toolkit/ui/templates/patch.html +17 -0
- wsp_toolkit-0.3.0/wsp_toolkit/ui/templates/patches.html +3 -0
- wsp_toolkit-0.3.0/wsp_toolkit/ui/templates/registry.html +4 -0
- wsp_toolkit-0.3.0/wsp_toolkit/ui/templates/results.html +3 -0
- wsp_toolkit-0.3.0/wsp_toolkit/ui/templates/session.html +8 -0
- wsp_toolkit-0.3.0/wsp_toolkit/ui/templates/sessions.html +3 -0
- wsp_toolkit-0.3.0/wsp_toolkit/ui/templates/zoo.html +3 -0
- wsp_toolkit-0.3.0/wsp_toolkit/ui/templates/zoo_net.html +4 -0
- wsp_toolkit-0.3.0/wsp_toolkit.egg-info/PKG-INFO +238 -0
- wsp_toolkit-0.3.0/wsp_toolkit.egg-info/SOURCES.txt +132 -0
- wsp_toolkit-0.3.0/wsp_toolkit.egg-info/dependency_links.txt +1 -0
- wsp_toolkit-0.3.0/wsp_toolkit.egg-info/entry_points.txt +3 -0
- wsp_toolkit-0.3.0/wsp_toolkit.egg-info/requires.txt +32 -0
- wsp_toolkit-0.3.0/wsp_toolkit.egg-info/top_level.txt +1 -0
|
@@ -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,238 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: wsp-toolkit
|
|
3
|
+
Version: 0.3.0
|
|
4
|
+
Summary: WSP Bench: let AI agents read, debug and edit neural-network weights directly. MCP server, web UI, auto-scored challenges, public leaderboard and animated replays.
|
|
5
|
+
Author: encore488
|
|
6
|
+
License-Expression: Apache-2.0
|
|
7
|
+
Project-URL: Homepage, https://encore488.github.io/weight-space-manipulator/
|
|
8
|
+
Project-URL: Leaderboard, https://encore488.github.io/weight-space-manipulator/leaderboard.html
|
|
9
|
+
Project-URL: Arena, https://encore488.github.io/weight-space-manipulator/arena.html
|
|
10
|
+
Project-URL: Repository, https://github.com/encore488/weight-space-manipulator
|
|
11
|
+
Project-URL: Issues, https://github.com/encore488/weight-space-manipulator/issues
|
|
12
|
+
Project-URL: Changelog, https://github.com/encore488/weight-space-manipulator/blob/main/CHANGELOG.md
|
|
13
|
+
Keywords: weight-space programming,interpretability,mechanistic interpretability,benchmark,AI agents,MCP,model editing,neural networks,Claude,LLM evaluation
|
|
14
|
+
Classifier: Development Status :: 3 - Alpha
|
|
15
|
+
Classifier: Intended Audience :: Science/Research
|
|
16
|
+
Classifier: Intended Audience :: Developers
|
|
17
|
+
Classifier: Operating System :: OS Independent
|
|
18
|
+
Classifier: Programming Language :: Python :: 3
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
22
|
+
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
23
|
+
Requires-Python: >=3.11
|
|
24
|
+
Description-Content-Type: text/markdown
|
|
25
|
+
License-File: LICENSE
|
|
26
|
+
Requires-Dist: numpy>=1.26
|
|
27
|
+
Requires-Dist: torch>=2.2
|
|
28
|
+
Requires-Dist: safetensors>=0.4
|
|
29
|
+
Requires-Dist: mcp<3,>=2.0
|
|
30
|
+
Requires-Dist: fastapi>=0.110
|
|
31
|
+
Requires-Dist: uvicorn>=0.27
|
|
32
|
+
Requires-Dist: jinja2>=3.1
|
|
33
|
+
Requires-Dist: python-multipart>=0.0.9
|
|
34
|
+
Provides-Extra: hf
|
|
35
|
+
Requires-Dist: transformers>=4.45; extra == "hf"
|
|
36
|
+
Requires-Dist: tokenizers>=0.15; extra == "hf"
|
|
37
|
+
Requires-Dist: huggingface-hub>=0.23; extra == "hf"
|
|
38
|
+
Provides-Extra: bench
|
|
39
|
+
Requires-Dist: pyarrow>=14; extra == "bench"
|
|
40
|
+
Requires-Dist: huggingface-hub>=0.23; extra == "bench"
|
|
41
|
+
Provides-Extra: pdf
|
|
42
|
+
Requires-Dist: reportlab>=4.0; extra == "pdf"
|
|
43
|
+
Provides-Extra: agent
|
|
44
|
+
Requires-Dist: anthropic>=2.7; extra == "agent"
|
|
45
|
+
Provides-Extra: video
|
|
46
|
+
Requires-Dist: playwright>=1.40; extra == "video"
|
|
47
|
+
Requires-Dist: imageio-ffmpeg>=0.5; extra == "video"
|
|
48
|
+
Provides-Extra: dev
|
|
49
|
+
Requires-Dist: pytest>=8; extra == "dev"
|
|
50
|
+
Requires-Dist: ruff>=0.5; extra == "dev"
|
|
51
|
+
Requires-Dist: httpx>=0.27; extra == "dev"
|
|
52
|
+
Dynamic: license-file
|
|
53
|
+
|
|
54
|
+
# WSP Toolkit
|
|
55
|
+
|
|
56
|
+
**Let an AI agent read, debug and edit neural-network weights directly, and watch it do it.**
|
|
57
|
+
|
|
58
|
+
Weight-space programming (WSP) means changing what a network does by reasoning about its weights, without gradient
|
|
59
|
+
descent. MIT CSAIL's [*Sparks of Weight-Space Programming*](https://rikiyat.github.io/blog/weight-space-programming/)
|
|
60
|
+
showed a frontier-model agent doing this in a sandbox: it found and removed the looping behaviour in a 0.8B model
|
|
61
|
+
by editing 0.016% of its weights. This toolkit turns that sandbox into something you can run on a laptop:
|
|
62
|
+
|
|
63
|
+
- **An MCP server** (`wsp mcp`) with ~50 tools for Claude Code or any MCP client: inspect tensors, SVDs and vocabulary
|
|
64
|
+
readouts; probe activations and attention under a **forward-pass budget**; make **reversible, bit-exact patches**;
|
|
65
|
+
evaluate on practice data while **held-out data stays hidden**.
|
|
66
|
+
- **A web UI** (`wsp ui`) to watch sessions live, browse weights as heatmaps, and **approve or reject** every patch.
|
|
67
|
+
Nothing can be exported without a human approval.
|
|
68
|
+
- **WSP Bench**: nine auto-scored challenges with random seeded instances (read, diagnose, repair and *write*
|
|
69
|
+
tasks), an **API runner** (`wsp bench run`) for comparing models such as Claude Fable 5.2 under the same budgets,
|
|
70
|
+
and a **public leaderboard** anyone can submit to: **https://encore488.github.io/weight-space-manipulator/**
|
|
71
|
+
- **The Arena**: an animated, sci-fi replay of every run (live while the agent works), exportable as an MP4 for
|
|
72
|
+
social posts: [`docs/arena.md`](https://github.com/encore488/weight-space-manipulator/blob/main/docs/arena.md).
|
|
73
|
+
- Plus a 392-network **zoo** with planted flaws, a **feature index** (sparse autoencoders) and **fine-tune audits**.
|
|
74
|
+
|
|
75
|
+
Everything runs locally on CPU in seconds; a GPU is only needed for large models.
|
|
76
|
+
|
|
77
|
+

|
|
78
|
+
|
|
79
|
+
## Try it in five minutes
|
|
80
|
+
|
|
81
|
+
**1. Install** (Python ≥ 3.11; [uv](https://docs.astral.sh/uv/) picks a suitable Python for you). If you don't
|
|
82
|
+
have uv yet, install it, then open a new terminal (or run `source $HOME/.local/bin/env`) so the shell can find it:
|
|
83
|
+
|
|
84
|
+
```bash
|
|
85
|
+
curl -LsSf https://astral.sh/uv/install.sh | sh
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
```bash
|
|
89
|
+
uv tool install "wsp-toolkit[agent] @ git+https://github.com/encore488/weight-space-manipulator"
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
or, with pip in a virtual environment:
|
|
93
|
+
|
|
94
|
+
```bash
|
|
95
|
+
pip install "wsp-toolkit[agent] @ git+https://github.com/encore488/weight-space-manipulator"
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
On Linux without a GPU, install the CPU build of PyTorch first to avoid a multi-GB download:
|
|
99
|
+
`pip install torch --index-url https://download.pytorch.org/whl/cpu`.
|
|
100
|
+
|
|
101
|
+
**2. Build the small models once** (~1–2 minutes on CPU):
|
|
102
|
+
|
|
103
|
+
```bash
|
|
104
|
+
wsp challenge prepare
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
**3. Pick one of two ways to run a challenge.**
|
|
108
|
+
|
|
109
|
+
*With Claude Code* (or any MCP client). The server locks itself to the challenge's models:
|
|
110
|
+
|
|
111
|
+
```bash
|
|
112
|
+
claude mcp add wsp -- wsp mcp --challenge fix-the-copier
|
|
113
|
+
```
|
|
114
|
+
```bash
|
|
115
|
+
wsp challenge prompt fix-the-copier --model claude-fable-5-2
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
Paste the printed prompt into Claude Code, then watch it work:
|
|
119
|
+
|
|
120
|
+
```bash
|
|
121
|
+
wsp ui # http://127.0.0.1:8765
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
*Through the Anthropic API* (the model gets nothing but the toolkit's tools, which makes these the comparable numbers):
|
|
125
|
+
|
|
126
|
+
```bash
|
|
127
|
+
export ANTHROPIC_API_KEY=... # or: ant auth login
|
|
128
|
+
wsp agent run fix-the-copier --model claude-fable-5-2
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
The runner streams, caches prompts, stops at `--max-cost` (default $20, estimated) and saves a transcript. Use any
|
|
132
|
+
Claude model ID with `--model`.
|
|
133
|
+
|
|
134
|
+
## The Arena
|
|
135
|
+
|
|
136
|
+

|
|
137
|
+
|
|
138
|
+
Every challenge run can be watched as it happens (`wsp ui` → **Arena**), replayed, or rendered as a video:
|
|
139
|
+
|
|
140
|
+
```bash
|
|
141
|
+
pip install "wsp-toolkit[video]" && playwright install chromium
|
|
142
|
+
wsp arena record latest --size portrait # 1080x1350 MP4; also landscape, square, vertical
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
Damaged heads glow red, and patched ones turn green once an edit fixes them. That ground truth is visible to viewers only, never to the
|
|
146
|
+
agent. Replays of the baseline on all nine challenges are on the
|
|
147
|
+
[website](https://encore488.github.io/weight-space-manipulator/arena.html). Details: [`docs/arena.md`](https://github.com/encore488/weight-space-manipulator/blob/main/docs/arena.md).
|
|
148
|
+
|
|
149
|
+
## Challenges and the public leaderboard
|
|
150
|
+
|
|
151
|
+

|
|
152
|
+
|
|
153
|
+
| Challenge | Kind | Access | Budget | Scripted baseline |
|
|
154
|
+
|---|---|---|---|---|
|
|
155
|
+
| `induction-hunt`: find the induction & previous-token heads | read | weights + activations | 10 passes | 1.00 |
|
|
156
|
+
| `token-ban`: make the model never predict one token | write | full | 30 | 1.00 |
|
|
157
|
+
| `fix-the-copier`: repair damaged heads without breaking counting | repair | full | 50 | 0.89 |
|
|
158
|
+
| `zoo-sprint`: find the planted flaw in 8 hidden-split networks | diagnose | weights + activations | 6 per net | 0.63 |
|
|
159
|
+
| `name-that-function`: name 8 MLPs' boolean functions from their weights | read | weights only | 0 | 0.21 |
|
|
160
|
+
| `blind-surgeon`: the repair with **zero** forward passes | repair | weights only | 0 | 0.66 |
|
|
161
|
+
| `backdoor-removal`: remove a trained-in trigger | repair | full | 20 | 0.00 |
|
|
162
|
+
| `install-a-rule`: program "after A, predict B" by editing weights | write | full | 50 | 0.69 |
|
|
163
|
+
| `mystery-finetune`: find the backdoor a fine-tune planted | audit | full | 30 per model | 0.00 |
|
|
164
|
+
|
|
165
|
+
Scores run 0–1, and every run gets a random seeded instance, so answers can't be memorised. The scripted baseline is
|
|
166
|
+
deterministic code using the same tools (WSP-Bench 0.564). Run all nine with `wsp bench run --model <id>`, then
|
|
167
|
+
submit:
|
|
168
|
+
|
|
169
|
+
```bash
|
|
170
|
+
wsp leaderboard export --model claude-fable-5-2 --by your-handle
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
Paste the file into the [submission form](https://github.com/encore488/weight-space-manipulator/issues/new?template=leaderboard-submission.yml).
|
|
174
|
+
A bot re-scores every run from its seed, answer and edits before it goes on the
|
|
175
|
+
[leaderboard](https://encore488.github.io/weight-space-manipulator/leaderboard.html). Details:
|
|
176
|
+
[`docs/challenges.md`](https://github.com/encore488/weight-space-manipulator/blob/main/docs/challenges.md), [`docs/leaderboard.md`](https://github.com/encore488/weight-space-manipulator/blob/main/docs/leaderboard.md).
|
|
177
|
+
|
|
178
|
+
## Using it on your own models
|
|
179
|
+
|
|
180
|
+
```bash
|
|
181
|
+
wsp mcp --budget 50 --access weights+activations+outputs
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
Then ask your agent to `workspace_open` a local safetensors model, a Hugging Face ID (`hf:Qwen/Qwen3.5-0.8B`, with the
|
|
185
|
+
`hf` extra) or a built-in fixture (`fixture:induction_tf`). The human sets the access level and budget ceiling; agents
|
|
186
|
+
can only ask for less. Every tool call is logged append-only and visible in the UI.
|
|
187
|
+
|
|
188
|
+
## How it keeps you in control
|
|
189
|
+
|
|
190
|
+
- **Originals are never modified.** Edits go to an in-memory working copy rebuilt from a hash-verified base plus a
|
|
191
|
+
stack of patches. Revert is bit-exact.
|
|
192
|
+
- **Budgets and access levels are enforced in code:** `weights_only`, `weights+activations`,
|
|
193
|
+
`weights+activations+outputs`. Below `outputs`, agents get no behavioural signal at all (no evaluation scores either).
|
|
194
|
+
- **Held-out data never reaches the agent**: aggregate scores only, rate-limited, run with network access blocked.
|
|
195
|
+
- **Human approval gates export.** Patches touching registered sensitive components need explicit acknowledgement.
|
|
196
|
+
- **Hard rule:** the toolkit refuses to open the calling agent's own weights.
|
|
197
|
+
|
|
198
|
+
## Status, honestly
|
|
199
|
+
|
|
200
|
+
This is v0.3 of a personal research project. Expect rough edges:
|
|
201
|
+
|
|
202
|
+
- The challenges and zoo use **small networks** (up to ~40K parameters), so you can see everything on CPU. The big-model
|
|
203
|
+
path (Hugging Face, e.g. Qwen3.5-0.8B) works: a first 5-problem MATH-500 run on Kaggle T4s compared the paper's
|
|
204
|
+
edited Qwen3.5-0.8B with the base model. The edited model hit the 32k-token limit on 0/5 problems (base: 3/5) and
|
|
205
|
+
solved 3/5 (base: 1/5). That's the same direction as the paper, but far too few problems to confirm it:
|
|
206
|
+
[`docs/reports/m3_qwen_demo.md`](https://github.com/encore488/weight-space-manipulator/blob/main/docs/reports/m3_qwen_demo.md).
|
|
207
|
+
- Feature labels come from a simple rule-based labeler with measured fidelity, not an LLM.
|
|
208
|
+
- Runs from MCP clients with shell access are *self-reported*: such an agent could read answer files on disk. Use
|
|
209
|
+
`wsp agent run` for comparable numbers.
|
|
210
|
+
- Design decisions and their rationale: [`DECISIONS.md`](https://github.com/encore488/weight-space-manipulator/blob/main/DECISIONS.md). Acceptance results:
|
|
211
|
+
[`docs/reports/milestones.md`](https://github.com/encore488/weight-space-manipulator/blob/main/docs/reports/milestones.md).
|
|
212
|
+
|
|
213
|
+
## Docs
|
|
214
|
+
|
|
215
|
+
- [`docs/agents.md`](https://github.com/encore488/weight-space-manipulator/blob/main/docs/agents.md): connecting Claude Code, Claude Desktop, other MCP clients, the API runner
|
|
216
|
+
- [`docs/challenges.md`](https://github.com/encore488/weight-space-manipulator/blob/main/docs/challenges.md): the challenges, scoring and fair play
|
|
217
|
+
- [`docs/arena.md`](https://github.com/encore488/weight-space-manipulator/blob/main/docs/arena.md): live view, replays and video export
|
|
218
|
+
- [`docs/leaderboard.md`](https://github.com/encore488/weight-space-manipulator/blob/main/docs/leaderboard.md): submitting results, verification
|
|
219
|
+
- [`docs/tools/`](https://github.com/encore488/weight-space-manipulator/blob/main/docs/tools/README.md): every tool, with a real example call and output
|
|
220
|
+
- [`docs/configuration.md`](https://github.com/encore488/weight-space-manipulator/blob/main/docs/configuration.md), [`docs/design/patch_semantics.md`](https://github.com/encore488/weight-space-manipulator/blob/main/docs/design/patch_semantics.md)
|
|
221
|
+
|
|
222
|
+
## Contributing
|
|
223
|
+
|
|
224
|
+
WSP Bench is meant to be built by its community: new challenges, leaderboard runs from more models, and
|
|
225
|
+
improvements to the Arena and the toolkit.
|
|
226
|
+
|
|
227
|
+
- Start here: [CONTRIBUTING.md](https://github.com/encore488/weight-space-manipulator/blob/main/CONTRIBUTING.md) and the
|
|
228
|
+
[good first issues](https://github.com/encore488/weight-space-manipulator/labels/good%20first%20issue).
|
|
229
|
+
- What's coming: [ROADMAP.md](https://github.com/encore488/weight-space-manipulator/blob/main/ROADMAP.md). What shipped:
|
|
230
|
+
[CHANGELOG.md](https://github.com/encore488/weight-space-manipulator/blob/main/CHANGELOG.md).
|
|
231
|
+
|
|
232
|
+
```bash
|
|
233
|
+
git clone https://github.com/encore488/weight-space-manipulator && cd weight-space-manipulator
|
|
234
|
+
pip install -e '.[dev,hf,pdf,agent]'
|
|
235
|
+
pytest # 92 tests, CPU only, no network, ~4 min
|
|
236
|
+
```
|
|
237
|
+
|
|
238
|
+
Apache-2.0. Built with Claude Code.
|
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
# WSP Toolkit
|
|
2
|
+
|
|
3
|
+
**Let an AI agent read, debug and edit neural-network weights directly, and watch it do it.**
|
|
4
|
+
|
|
5
|
+
Weight-space programming (WSP) means changing what a network does by reasoning about its weights, without gradient
|
|
6
|
+
descent. MIT CSAIL's [*Sparks of Weight-Space Programming*](https://rikiyat.github.io/blog/weight-space-programming/)
|
|
7
|
+
showed a frontier-model agent doing this in a sandbox: it found and removed the looping behaviour in a 0.8B model
|
|
8
|
+
by editing 0.016% of its weights. This toolkit turns that sandbox into something you can run on a laptop:
|
|
9
|
+
|
|
10
|
+
- **An MCP server** (`wsp mcp`) with ~50 tools for Claude Code or any MCP client: inspect tensors, SVDs and vocabulary
|
|
11
|
+
readouts; probe activations and attention under a **forward-pass budget**; make **reversible, bit-exact patches**;
|
|
12
|
+
evaluate on practice data while **held-out data stays hidden**.
|
|
13
|
+
- **A web UI** (`wsp ui`) to watch sessions live, browse weights as heatmaps, and **approve or reject** every patch.
|
|
14
|
+
Nothing can be exported without a human approval.
|
|
15
|
+
- **WSP Bench**: nine auto-scored challenges with random seeded instances (read, diagnose, repair and *write*
|
|
16
|
+
tasks), an **API runner** (`wsp bench run`) for comparing models such as Claude Fable 5.2 under the same budgets,
|
|
17
|
+
and a **public leaderboard** anyone can submit to: **https://encore488.github.io/weight-space-manipulator/**
|
|
18
|
+
- **The Arena**: an animated, sci-fi replay of every run (live while the agent works), exportable as an MP4 for
|
|
19
|
+
social posts: [`docs/arena.md`](https://github.com/encore488/weight-space-manipulator/blob/main/docs/arena.md).
|
|
20
|
+
- Plus a 392-network **zoo** with planted flaws, a **feature index** (sparse autoencoders) and **fine-tune audits**.
|
|
21
|
+
|
|
22
|
+
Everything runs locally on CPU in seconds; a GPU is only needed for large models.
|
|
23
|
+
|
|
24
|
+

|
|
25
|
+
|
|
26
|
+
## Try it in five minutes
|
|
27
|
+
|
|
28
|
+
**1. Install** (Python ≥ 3.11; [uv](https://docs.astral.sh/uv/) picks a suitable Python for you). If you don't
|
|
29
|
+
have uv yet, install it, then open a new terminal (or run `source $HOME/.local/bin/env`) so the shell can find it:
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
curl -LsSf https://astral.sh/uv/install.sh | sh
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
uv tool install "wsp-toolkit[agent] @ git+https://github.com/encore488/weight-space-manipulator"
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
or, with pip in a virtual environment:
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
pip install "wsp-toolkit[agent] @ git+https://github.com/encore488/weight-space-manipulator"
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
On Linux without a GPU, install the CPU build of PyTorch first to avoid a multi-GB download:
|
|
46
|
+
`pip install torch --index-url https://download.pytorch.org/whl/cpu`.
|
|
47
|
+
|
|
48
|
+
**2. Build the small models once** (~1–2 minutes on CPU):
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
wsp challenge prepare
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
**3. Pick one of two ways to run a challenge.**
|
|
55
|
+
|
|
56
|
+
*With Claude Code* (or any MCP client). The server locks itself to the challenge's models:
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
claude mcp add wsp -- wsp mcp --challenge fix-the-copier
|
|
60
|
+
```
|
|
61
|
+
```bash
|
|
62
|
+
wsp challenge prompt fix-the-copier --model claude-fable-5-2
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
Paste the printed prompt into Claude Code, then watch it work:
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
wsp ui # http://127.0.0.1:8765
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
*Through the Anthropic API* (the model gets nothing but the toolkit's tools, which makes these the comparable numbers):
|
|
72
|
+
|
|
73
|
+
```bash
|
|
74
|
+
export ANTHROPIC_API_KEY=... # or: ant auth login
|
|
75
|
+
wsp agent run fix-the-copier --model claude-fable-5-2
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
The runner streams, caches prompts, stops at `--max-cost` (default $20, estimated) and saves a transcript. Use any
|
|
79
|
+
Claude model ID with `--model`.
|
|
80
|
+
|
|
81
|
+
## The Arena
|
|
82
|
+
|
|
83
|
+

|
|
84
|
+
|
|
85
|
+
Every challenge run can be watched as it happens (`wsp ui` → **Arena**), replayed, or rendered as a video:
|
|
86
|
+
|
|
87
|
+
```bash
|
|
88
|
+
pip install "wsp-toolkit[video]" && playwright install chromium
|
|
89
|
+
wsp arena record latest --size portrait # 1080x1350 MP4; also landscape, square, vertical
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
Damaged heads glow red, and patched ones turn green once an edit fixes them. That ground truth is visible to viewers only, never to the
|
|
93
|
+
agent. Replays of the baseline on all nine challenges are on the
|
|
94
|
+
[website](https://encore488.github.io/weight-space-manipulator/arena.html). Details: [`docs/arena.md`](https://github.com/encore488/weight-space-manipulator/blob/main/docs/arena.md).
|
|
95
|
+
|
|
96
|
+
## Challenges and the public leaderboard
|
|
97
|
+
|
|
98
|
+

|
|
99
|
+
|
|
100
|
+
| Challenge | Kind | Access | Budget | Scripted baseline |
|
|
101
|
+
|---|---|---|---|---|
|
|
102
|
+
| `induction-hunt`: find the induction & previous-token heads | read | weights + activations | 10 passes | 1.00 |
|
|
103
|
+
| `token-ban`: make the model never predict one token | write | full | 30 | 1.00 |
|
|
104
|
+
| `fix-the-copier`: repair damaged heads without breaking counting | repair | full | 50 | 0.89 |
|
|
105
|
+
| `zoo-sprint`: find the planted flaw in 8 hidden-split networks | diagnose | weights + activations | 6 per net | 0.63 |
|
|
106
|
+
| `name-that-function`: name 8 MLPs' boolean functions from their weights | read | weights only | 0 | 0.21 |
|
|
107
|
+
| `blind-surgeon`: the repair with **zero** forward passes | repair | weights only | 0 | 0.66 |
|
|
108
|
+
| `backdoor-removal`: remove a trained-in trigger | repair | full | 20 | 0.00 |
|
|
109
|
+
| `install-a-rule`: program "after A, predict B" by editing weights | write | full | 50 | 0.69 |
|
|
110
|
+
| `mystery-finetune`: find the backdoor a fine-tune planted | audit | full | 30 per model | 0.00 |
|
|
111
|
+
|
|
112
|
+
Scores run 0–1, and every run gets a random seeded instance, so answers can't be memorised. The scripted baseline is
|
|
113
|
+
deterministic code using the same tools (WSP-Bench 0.564). Run all nine with `wsp bench run --model <id>`, then
|
|
114
|
+
submit:
|
|
115
|
+
|
|
116
|
+
```bash
|
|
117
|
+
wsp leaderboard export --model claude-fable-5-2 --by your-handle
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
Paste the file into the [submission form](https://github.com/encore488/weight-space-manipulator/issues/new?template=leaderboard-submission.yml).
|
|
121
|
+
A bot re-scores every run from its seed, answer and edits before it goes on the
|
|
122
|
+
[leaderboard](https://encore488.github.io/weight-space-manipulator/leaderboard.html). Details:
|
|
123
|
+
[`docs/challenges.md`](https://github.com/encore488/weight-space-manipulator/blob/main/docs/challenges.md), [`docs/leaderboard.md`](https://github.com/encore488/weight-space-manipulator/blob/main/docs/leaderboard.md).
|
|
124
|
+
|
|
125
|
+
## Using it on your own models
|
|
126
|
+
|
|
127
|
+
```bash
|
|
128
|
+
wsp mcp --budget 50 --access weights+activations+outputs
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
Then ask your agent to `workspace_open` a local safetensors model, a Hugging Face ID (`hf:Qwen/Qwen3.5-0.8B`, with the
|
|
132
|
+
`hf` extra) or a built-in fixture (`fixture:induction_tf`). The human sets the access level and budget ceiling; agents
|
|
133
|
+
can only ask for less. Every tool call is logged append-only and visible in the UI.
|
|
134
|
+
|
|
135
|
+
## How it keeps you in control
|
|
136
|
+
|
|
137
|
+
- **Originals are never modified.** Edits go to an in-memory working copy rebuilt from a hash-verified base plus a
|
|
138
|
+
stack of patches. Revert is bit-exact.
|
|
139
|
+
- **Budgets and access levels are enforced in code:** `weights_only`, `weights+activations`,
|
|
140
|
+
`weights+activations+outputs`. Below `outputs`, agents get no behavioural signal at all (no evaluation scores either).
|
|
141
|
+
- **Held-out data never reaches the agent**: aggregate scores only, rate-limited, run with network access blocked.
|
|
142
|
+
- **Human approval gates export.** Patches touching registered sensitive components need explicit acknowledgement.
|
|
143
|
+
- **Hard rule:** the toolkit refuses to open the calling agent's own weights.
|
|
144
|
+
|
|
145
|
+
## Status, honestly
|
|
146
|
+
|
|
147
|
+
This is v0.3 of a personal research project. Expect rough edges:
|
|
148
|
+
|
|
149
|
+
- The challenges and zoo use **small networks** (up to ~40K parameters), so you can see everything on CPU. The big-model
|
|
150
|
+
path (Hugging Face, e.g. Qwen3.5-0.8B) works: a first 5-problem MATH-500 run on Kaggle T4s compared the paper's
|
|
151
|
+
edited Qwen3.5-0.8B with the base model. The edited model hit the 32k-token limit on 0/5 problems (base: 3/5) and
|
|
152
|
+
solved 3/5 (base: 1/5). That's the same direction as the paper, but far too few problems to confirm it:
|
|
153
|
+
[`docs/reports/m3_qwen_demo.md`](https://github.com/encore488/weight-space-manipulator/blob/main/docs/reports/m3_qwen_demo.md).
|
|
154
|
+
- Feature labels come from a simple rule-based labeler with measured fidelity, not an LLM.
|
|
155
|
+
- Runs from MCP clients with shell access are *self-reported*: such an agent could read answer files on disk. Use
|
|
156
|
+
`wsp agent run` for comparable numbers.
|
|
157
|
+
- Design decisions and their rationale: [`DECISIONS.md`](https://github.com/encore488/weight-space-manipulator/blob/main/DECISIONS.md). Acceptance results:
|
|
158
|
+
[`docs/reports/milestones.md`](https://github.com/encore488/weight-space-manipulator/blob/main/docs/reports/milestones.md).
|
|
159
|
+
|
|
160
|
+
## Docs
|
|
161
|
+
|
|
162
|
+
- [`docs/agents.md`](https://github.com/encore488/weight-space-manipulator/blob/main/docs/agents.md): connecting Claude Code, Claude Desktop, other MCP clients, the API runner
|
|
163
|
+
- [`docs/challenges.md`](https://github.com/encore488/weight-space-manipulator/blob/main/docs/challenges.md): the challenges, scoring and fair play
|
|
164
|
+
- [`docs/arena.md`](https://github.com/encore488/weight-space-manipulator/blob/main/docs/arena.md): live view, replays and video export
|
|
165
|
+
- [`docs/leaderboard.md`](https://github.com/encore488/weight-space-manipulator/blob/main/docs/leaderboard.md): submitting results, verification
|
|
166
|
+
- [`docs/tools/`](https://github.com/encore488/weight-space-manipulator/blob/main/docs/tools/README.md): every tool, with a real example call and output
|
|
167
|
+
- [`docs/configuration.md`](https://github.com/encore488/weight-space-manipulator/blob/main/docs/configuration.md), [`docs/design/patch_semantics.md`](https://github.com/encore488/weight-space-manipulator/blob/main/docs/design/patch_semantics.md)
|
|
168
|
+
|
|
169
|
+
## Contributing
|
|
170
|
+
|
|
171
|
+
WSP Bench is meant to be built by its community: new challenges, leaderboard runs from more models, and
|
|
172
|
+
improvements to the Arena and the toolkit.
|
|
173
|
+
|
|
174
|
+
- Start here: [CONTRIBUTING.md](https://github.com/encore488/weight-space-manipulator/blob/main/CONTRIBUTING.md) and the
|
|
175
|
+
[good first issues](https://github.com/encore488/weight-space-manipulator/labels/good%20first%20issue).
|
|
176
|
+
- What's coming: [ROADMAP.md](https://github.com/encore488/weight-space-manipulator/blob/main/ROADMAP.md). What shipped:
|
|
177
|
+
[CHANGELOG.md](https://github.com/encore488/weight-space-manipulator/blob/main/CHANGELOG.md).
|
|
178
|
+
|
|
179
|
+
```bash
|
|
180
|
+
git clone https://github.com/encore488/weight-space-manipulator && cd weight-space-manipulator
|
|
181
|
+
pip install -e '.[dev,hf,pdf,agent]'
|
|
182
|
+
pytest # 92 tests, CPU only, no network, ~4 min
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
Apache-2.0. Built with Claude Code.
|