thinkerwave-metis 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.
- thinkerwave_metis-0.1.0/.gitignore +5 -0
- thinkerwave_metis-0.1.0/LICENSE +202 -0
- thinkerwave_metis-0.1.0/PKG-INFO +88 -0
- thinkerwave_metis-0.1.0/README.md +66 -0
- thinkerwave_metis-0.1.0/docs/deterministic-vs-consistent.md +59 -0
- thinkerwave_metis-0.1.0/docs/endpoint-mode.md +153 -0
- thinkerwave_metis-0.1.0/docs/pricing.md +22 -0
- thinkerwave_metis-0.1.0/docs/quickstart.md +155 -0
- thinkerwave_metis-0.1.0/docs/security.md +135 -0
- thinkerwave_metis-0.1.0/examples/.gitignore +2 -0
- thinkerwave_metis-0.1.0/examples/contractnli/README.md +42 -0
- thinkerwave_metis-0.1.0/examples/contractnli/expected.json +12 -0
- thinkerwave_metis-0.1.0/examples/contractnli/fetch.py +78 -0
- thinkerwave_metis-0.1.0/examples/contractnli/metis/agent.yaml +9 -0
- thinkerwave_metis-0.1.0/examples/contractnli/metis/instruction.md +5 -0
- thinkerwave_metis-0.1.0/examples/telelogs/README.md +42 -0
- thinkerwave_metis-0.1.0/examples/telelogs/expected.json +12 -0
- thinkerwave_metis-0.1.0/examples/telelogs/fetch.py +102 -0
- thinkerwave_metis-0.1.0/examples/telelogs/metis/agent.yaml +9 -0
- thinkerwave_metis-0.1.0/examples/telelogs/metis/instruction.md +5 -0
- thinkerwave_metis-0.1.0/npm/LICENSE +202 -0
- thinkerwave_metis-0.1.0/npm/README.md +25 -0
- thinkerwave_metis-0.1.0/npm/bin/metis.js +61 -0
- thinkerwave_metis-0.1.0/npm/package.json +27 -0
- thinkerwave_metis-0.1.0/npm/test/wrapper.test.js +132 -0
- thinkerwave_metis-0.1.0/pyproject.toml +44 -0
- thinkerwave_metis-0.1.0/src/metis/__init__.py +16 -0
- thinkerwave_metis-0.1.0/src/metis/accept.py +176 -0
- thinkerwave_metis-0.1.0/src/metis/agent.py +243 -0
- thinkerwave_metis-0.1.0/src/metis/card.py +486 -0
- thinkerwave_metis-0.1.0/src/metis/cases.py +55 -0
- thinkerwave_metis-0.1.0/src/metis/check.py +260 -0
- thinkerwave_metis-0.1.0/src/metis/cli.py +501 -0
- thinkerwave_metis-0.1.0/src/metis/compare.py +275 -0
- thinkerwave_metis-0.1.0/src/metis/config.py +55 -0
- thinkerwave_metis-0.1.0/src/metis/endpoint.py +158 -0
- thinkerwave_metis-0.1.0/src/metis/errors.py +7 -0
- thinkerwave_metis-0.1.0/src/metis/hosted.py +262 -0
- thinkerwave_metis-0.1.0/src/metis/importers.py +444 -0
- thinkerwave_metis-0.1.0/src/metis/init.py +94 -0
- thinkerwave_metis-0.1.0/src/metis/junit.py +45 -0
- thinkerwave_metis-0.1.0/src/metis/labeler.py +396 -0
- thinkerwave_metis-0.1.0/src/metis/mcp_server.py +550 -0
- thinkerwave_metis-0.1.0/src/metis/optimise.py +412 -0
- thinkerwave_metis-0.1.0/src/metis/optimise_files.py +71 -0
- thinkerwave_metis-0.1.0/src/metis/prices.py +32 -0
- thinkerwave_metis-0.1.0/src/metis/projectfiles.py +95 -0
- thinkerwave_metis-0.1.0/src/metis/providers.py +201 -0
- thinkerwave_metis-0.1.0/src/metis/rowpolicy.py +57 -0
- thinkerwave_metis-0.1.0/src/metis/runner.py +167 -0
- thinkerwave_metis-0.1.0/src/metis/runs.py +133 -0
- thinkerwave_metis-0.1.0/src/metis/scoring.py +232 -0
- thinkerwave_metis-0.1.0/src/metis/stats.py +66 -0
- thinkerwave_metis-0.1.0/src/metis/templates/card.html +16 -0
- thinkerwave_metis-0.1.0/src/metis/templates/label.html +174 -0
- thinkerwave_metis-0.1.0/src/metis/training.py +210 -0
- thinkerwave_metis-0.1.0/src/metis/trust.py +180 -0
- thinkerwave_metis-0.1.0/src/metis/userconfig.py +161 -0
- thinkerwave_metis-0.1.0/src/metis/wrapper.py +50 -0
- thinkerwave_metis-0.1.0/tests/conftest.py +11 -0
- thinkerwave_metis-0.1.0/tests/test_accept.py +225 -0
- thinkerwave_metis-0.1.0/tests/test_agent.py +340 -0
- thinkerwave_metis-0.1.0/tests/test_allowed.py +66 -0
- thinkerwave_metis-0.1.0/tests/test_card.py +139 -0
- thinkerwave_metis-0.1.0/tests/test_cases.py +69 -0
- thinkerwave_metis-0.1.0/tests/test_cases_cli.py +170 -0
- thinkerwave_metis-0.1.0/tests/test_check.py +117 -0
- thinkerwave_metis-0.1.0/tests/test_compare.py +282 -0
- thinkerwave_metis-0.1.0/tests/test_config.py +55 -0
- thinkerwave_metis-0.1.0/tests/test_docs.py +232 -0
- thinkerwave_metis-0.1.0/tests/test_endpoint.py +258 -0
- thinkerwave_metis-0.1.0/tests/test_hosted.py +292 -0
- thinkerwave_metis-0.1.0/tests/test_importers.py +184 -0
- thinkerwave_metis-0.1.0/tests/test_init.py +119 -0
- thinkerwave_metis-0.1.0/tests/test_labeler.py +356 -0
- thinkerwave_metis-0.1.0/tests/test_mcp.py +458 -0
- thinkerwave_metis-0.1.0/tests/test_minors.py +135 -0
- thinkerwave_metis-0.1.0/tests/test_optimise.py +618 -0
- thinkerwave_metis-0.1.0/tests/test_projectfiles.py +112 -0
- thinkerwave_metis-0.1.0/tests/test_providers.py +208 -0
- thinkerwave_metis-0.1.0/tests/test_resume.py +91 -0
- thinkerwave_metis-0.1.0/tests/test_rowpolicy.py +179 -0
- thinkerwave_metis-0.1.0/tests/test_runner.py +179 -0
- thinkerwave_metis-0.1.0/tests/test_scoring.py +134 -0
- thinkerwave_metis-0.1.0/tests/test_stats.py +49 -0
- thinkerwave_metis-0.1.0/tests/test_trust.py +212 -0
- thinkerwave_metis-0.1.0/tests/test_wrapper.py +63 -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,88 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: thinkerwave-metis
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Metis by ThinkerWave: measure, improve and prove the instructions your AI agent runs on.
|
|
5
|
+
Project-URL: Homepage, https://thinkerwave.ai
|
|
6
|
+
Project-URL: Source, https://github.com/thinkerwave-ai/thinkerwave
|
|
7
|
+
License-Expression: Apache-2.0
|
|
8
|
+
License-File: LICENSE
|
|
9
|
+
Classifier: Programming Language :: Python :: 3
|
|
10
|
+
Requires-Python: >=3.10
|
|
11
|
+
Requires-Dist: httpx>=0.27
|
|
12
|
+
Requires-Dist: pydantic>=2.6
|
|
13
|
+
Requires-Dist: pyyaml>=6
|
|
14
|
+
Provides-Extra: bedrock
|
|
15
|
+
Requires-Dist: boto3>=1.34; extra == 'bedrock'
|
|
16
|
+
Provides-Extra: dev
|
|
17
|
+
Requires-Dist: pytest>=8; extra == 'dev'
|
|
18
|
+
Requires-Dist: ruff>=0.5; extra == 'dev'
|
|
19
|
+
Provides-Extra: mcp
|
|
20
|
+
Requires-Dist: mcp>=2.3; extra == 'mcp'
|
|
21
|
+
Description-Content-Type: text/markdown
|
|
22
|
+
|
|
23
|
+
# Metis by ThinkerWave
|
|
24
|
+
|
|
25
|
+
**Make a cheap model reliable enough to run unattended.**
|
|
26
|
+
|
|
27
|
+
Fewer confident wrong answers. Same answer on every run. Escalate, don't guess.
|
|
28
|
+
|
|
29
|
+
Metis measures how reliable your AI agent is on your own labelled cases, improves its instructions,
|
|
30
|
+
and proves the improvement on cases it never trained on. Measuring is free and runs on your machine,
|
|
31
|
+
with no account. It works for any agent whose answers you can check: triage, root-cause analysis,
|
|
32
|
+
classification, extraction, contract review, routing, compliance checks.
|
|
33
|
+
|
|
34
|
+
From the Metis paper (draft, 1 Dec 2026): on a telecom root-cause task, a cheap model with a Metis
|
|
35
|
+
instruction matched a frontier model's net score with about half the wrong answers, at 1/13 of the cost.
|
|
36
|
+
See [`examples/`](examples) for the numbers and how to rerun the tasks yourself.
|
|
37
|
+
|
|
38
|
+
## Install
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
pip install thinkerwave-metis # the `metis` command
|
|
42
|
+
pipx run --spec thinkerwave-metis metis --version
|
|
43
|
+
npx thinkerwave-metis --version # needs uv (it fetches Python itself), or pipx (which needs Python)
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
Python 3.10 or newer. Package `thinkerwave-metis`, import `metis`, command `metis`, MCP server `metis-mcp`.
|
|
47
|
+
|
|
48
|
+
## Try it
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
metis init # writes metis/agent.yaml, instruction.md, cases.jsonl
|
|
52
|
+
# edit metis/agent.yaml: say what the agent decides, and pick your model
|
|
53
|
+
export ANTHROPIC_API_KEY=...
|
|
54
|
+
metis check # a reliability card: right, wrong, escalated, consistency, cost
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
Full walk-through: [docs/quickstart.md](docs/quickstart.md).
|
|
58
|
+
|
|
59
|
+
## What it does
|
|
60
|
+
|
|
61
|
+
| Command | What | Needs |
|
|
62
|
+
|---|---|---|
|
|
63
|
+
| `metis check` | Runs your cases several times each and writes a card | your model key |
|
|
64
|
+
| `metis compare` | Two instructions or two models on the same cases; `--ci` gates a pull request | your model key |
|
|
65
|
+
| `metis cases` | Builds an answer key from your logs, with a local labelling page | nothing |
|
|
66
|
+
| `metis optimise` | Rewrites the instruction, then proves it on held-out cases | a Metis API key |
|
|
67
|
+
| `metis accept` | Shows the diff and makes the new instruction yours | nothing |
|
|
68
|
+
|
|
69
|
+
Your model calls go to your own provider with your own key. Only `metis optimise` talks to ThinkerWave,
|
|
70
|
+
and it shows you what it will send before the first call.
|
|
71
|
+
|
|
72
|
+
## Your agent, not just a prompt
|
|
73
|
+
|
|
74
|
+
If your agent is a LangChain graph, an OpenAI Agents SDK app or a service in any language, point
|
|
75
|
+
`agent.yaml` at it and Metis tests the real thing: [docs/endpoint-mode.md](docs/endpoint-mode.md).
|
|
76
|
+
|
|
77
|
+
## Docs
|
|
78
|
+
|
|
79
|
+
- [Quickstart](docs/quickstart.md)
|
|
80
|
+
- [Endpoint mode: bring your own agent](docs/endpoint-mode.md)
|
|
81
|
+
- [Why "same answer" is not "sure answer": what Metis promises](docs/deterministic-vs-consistent.md)
|
|
82
|
+
- [Security and privacy](docs/security.md)
|
|
83
|
+
- [Pricing](docs/pricing.md)
|
|
84
|
+
- [Examples: TeleLogs and ContractNLI](examples)
|
|
85
|
+
|
|
86
|
+
Cards from your own runs say "self-reported": measured by you, on your own cases.
|
|
87
|
+
|
|
88
|
+
Apache-2.0. Source: https://github.com/thinkerwave-ai/thinkerwave
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
# Metis by ThinkerWave
|
|
2
|
+
|
|
3
|
+
**Make a cheap model reliable enough to run unattended.**
|
|
4
|
+
|
|
5
|
+
Fewer confident wrong answers. Same answer on every run. Escalate, don't guess.
|
|
6
|
+
|
|
7
|
+
Metis measures how reliable your AI agent is on your own labelled cases, improves its instructions,
|
|
8
|
+
and proves the improvement on cases it never trained on. Measuring is free and runs on your machine,
|
|
9
|
+
with no account. It works for any agent whose answers you can check: triage, root-cause analysis,
|
|
10
|
+
classification, extraction, contract review, routing, compliance checks.
|
|
11
|
+
|
|
12
|
+
From the Metis paper (draft, 1 Dec 2026): on a telecom root-cause task, a cheap model with a Metis
|
|
13
|
+
instruction matched a frontier model's net score with about half the wrong answers, at 1/13 of the cost.
|
|
14
|
+
See [`examples/`](examples) for the numbers and how to rerun the tasks yourself.
|
|
15
|
+
|
|
16
|
+
## Install
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
pip install thinkerwave-metis # the `metis` command
|
|
20
|
+
pipx run --spec thinkerwave-metis metis --version
|
|
21
|
+
npx thinkerwave-metis --version # needs uv (it fetches Python itself), or pipx (which needs Python)
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
Python 3.10 or newer. Package `thinkerwave-metis`, import `metis`, command `metis`, MCP server `metis-mcp`.
|
|
25
|
+
|
|
26
|
+
## Try it
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
metis init # writes metis/agent.yaml, instruction.md, cases.jsonl
|
|
30
|
+
# edit metis/agent.yaml: say what the agent decides, and pick your model
|
|
31
|
+
export ANTHROPIC_API_KEY=...
|
|
32
|
+
metis check # a reliability card: right, wrong, escalated, consistency, cost
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
Full walk-through: [docs/quickstart.md](docs/quickstart.md).
|
|
36
|
+
|
|
37
|
+
## What it does
|
|
38
|
+
|
|
39
|
+
| Command | What | Needs |
|
|
40
|
+
|---|---|---|
|
|
41
|
+
| `metis check` | Runs your cases several times each and writes a card | your model key |
|
|
42
|
+
| `metis compare` | Two instructions or two models on the same cases; `--ci` gates a pull request | your model key |
|
|
43
|
+
| `metis cases` | Builds an answer key from your logs, with a local labelling page | nothing |
|
|
44
|
+
| `metis optimise` | Rewrites the instruction, then proves it on held-out cases | a Metis API key |
|
|
45
|
+
| `metis accept` | Shows the diff and makes the new instruction yours | nothing |
|
|
46
|
+
|
|
47
|
+
Your model calls go to your own provider with your own key. Only `metis optimise` talks to ThinkerWave,
|
|
48
|
+
and it shows you what it will send before the first call.
|
|
49
|
+
|
|
50
|
+
## Your agent, not just a prompt
|
|
51
|
+
|
|
52
|
+
If your agent is a LangChain graph, an OpenAI Agents SDK app or a service in any language, point
|
|
53
|
+
`agent.yaml` at it and Metis tests the real thing: [docs/endpoint-mode.md](docs/endpoint-mode.md).
|
|
54
|
+
|
|
55
|
+
## Docs
|
|
56
|
+
|
|
57
|
+
- [Quickstart](docs/quickstart.md)
|
|
58
|
+
- [Endpoint mode: bring your own agent](docs/endpoint-mode.md)
|
|
59
|
+
- [Why "same answer" is not "sure answer": what Metis promises](docs/deterministic-vs-consistent.md)
|
|
60
|
+
- [Security and privacy](docs/security.md)
|
|
61
|
+
- [Pricing](docs/pricing.md)
|
|
62
|
+
- [Examples: TeleLogs and ContractNLI](examples)
|
|
63
|
+
|
|
64
|
+
Cards from your own runs say "self-reported": measured by you, on your own cases.
|
|
65
|
+
|
|
66
|
+
Apache-2.0. Source: https://github.com/thinkerwave-ai/thinkerwave
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
# Deterministic vs consistent
|
|
2
|
+
|
|
3
|
+
**You can't make an LLM deterministic. You can make it right, repeatable, and honest when it isn't sure.**
|
|
4
|
+
|
|
5
|
+
People search for "deterministic AI" because something in their pipeline broke: the same input gave a
|
|
6
|
+
refund on Monday and a refusal on Tuesday, or a model update quietly changed a classification. They want
|
|
7
|
+
the same input to give the same output, every time. It is a reasonable thing to want. It is not something
|
|
8
|
+
a language model, called through a hosted API, can promise.
|
|
9
|
+
|
|
10
|
+
## Why it cannot be promised
|
|
11
|
+
|
|
12
|
+
- **Temperature zero is not enough.** Many providers do not let you set it, or ignore it for some models.
|
|
13
|
+
Even where you can, the arithmetic behind a large model runs across many chips in different orders, and
|
|
14
|
+
tiny differences in the order change which word comes out when two are nearly tied.
|
|
15
|
+
- **The model behind the name changes.** Providers retire and update models. A name that worked in March
|
|
16
|
+
may be a different network in June.
|
|
17
|
+
- **Your own input changes.** A retrieved document, a timestamp, a different tool order: any of them can
|
|
18
|
+
move the answer.
|
|
19
|
+
|
|
20
|
+
A vendor who tells you their LLM agent is deterministic is either describing a cache, or guessing.
|
|
21
|
+
|
|
22
|
+
## What you can do instead
|
|
23
|
+
|
|
24
|
+
Stop asking for sameness of text. Ask for three things you can measure:
|
|
25
|
+
|
|
26
|
+
1. **Right.** The answer matches what a person who knows the domain would say, on cases you have labelled.
|
|
27
|
+
2. **Repeatable.** Run the same case several times; the answer, not the wording, comes out the same.
|
|
28
|
+
Metis reports this as "same answer every run", and "right in all k runs" (pass^k) for the stricter
|
|
29
|
+
question of whether you could trust one run.
|
|
30
|
+
3. **Honest when unsure.** When the instruction does not single out one answer, the agent says
|
|
31
|
+
`ESCALATE` and a person looks at it. An escalation costs a little. A confident wrong answer costs
|
|
32
|
+
whatever the answer was used for.
|
|
33
|
+
|
|
34
|
+
## How Metis scores it
|
|
35
|
+
|
|
36
|
+
On every labelled case, an answer is **right** (+1), **wrong** (-1) or **escalated** (0).
|
|
37
|
+
Net is right minus wrong. Precision is right divided by right plus wrong, which is the number to watch
|
|
38
|
+
when wrong answers are expensive. Answers that differ only by case or spacing ("C7" and "c7 ") count as
|
|
39
|
+
the same answer. A reply that cannot be parsed, or that was cut off, is counted as escalated and flagged on
|
|
40
|
+
the card, never as wrong.
|
|
41
|
+
|
|
42
|
+
`metis check` runs every case several times, so you see consistency directly. `metis optimise` then
|
|
43
|
+
searches for instructions that raise right answers, cut wrong ones, and make the agent escalate rather
|
|
44
|
+
than guess, and proves the result on held-out cases it did not train on.
|
|
45
|
+
|
|
46
|
+
From the Metis paper (draft, 1 Dec 2026): on TeleLogs with Claude Haiku 5.5, 360 held-out cases, the
|
|
47
|
+
plain instruction gave 197 right, 80 wrong and 83 escalated. The Metis instruction gave 286 right, 27
|
|
48
|
+
wrong and 47 escalated: wrong answers fell by two thirds, and the agent still answered most cases.
|
|
49
|
+
|
|
50
|
+
## What Metis does not promise
|
|
51
|
+
|
|
52
|
+
- Not word-for-word identical output. The wording will differ; the decision should not.
|
|
53
|
+
- Not zero wrong answers. It lowers them and tells you how many remain.
|
|
54
|
+
- Not a result on cases unlike your labelled ones. The card says "self-reported": it is measured by you,
|
|
55
|
+
on your cases, and not audited.
|
|
56
|
+
|
|
57
|
+
If you need an answer to be identical every time, put the decision in code and let the model feed it:
|
|
58
|
+
extract the fields with the model, decide with a function. Metis is for the part that has to stay a
|
|
59
|
+
judgement call.
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
# Endpoint mode: test the agent you actually run
|
|
2
|
+
|
|
3
|
+
Most agents are more than a prompt: a LangChain graph, an OpenAI Agents SDK app, a retrieval pipeline,
|
|
4
|
+
tool calls, or a service written in another language. In endpoint mode Metis calls your agent for each
|
|
5
|
+
case and reads only the answer.
|
|
6
|
+
|
|
7
|
+
```yaml
|
|
8
|
+
# metis/agent.yaml
|
|
9
|
+
task: Route each support email to billing, technical or sales.
|
|
10
|
+
mode: endpoint
|
|
11
|
+
agent: myapp.agent:answer # a Python function, or an http(s) URL
|
|
12
|
+
instruction_file: instruction.md
|
|
13
|
+
scorer: exact
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## The one thing your agent must do
|
|
17
|
+
|
|
18
|
+
**Use the `instruction` it is given.** Metis passes your current instruction, with a short answer-format
|
|
19
|
+
note on the end, as the first argument. Your agent must use that text as its system prompt (or as the part
|
|
20
|
+
of its prompt that Metis improves). If it ignores the argument, every instruction scores the same and
|
|
21
|
+
`metis optimise` has nothing to improve.
|
|
22
|
+
|
|
23
|
+
Keep the end of the instruction intact: it asks for a final line of JSON, `{"answer": "...", "reasoning":
|
|
24
|
+
"..."}`, and `"ESCALATE"` when the rules do not single out one answer. That is how Metis reads the reply.
|
|
25
|
+
|
|
26
|
+
## A Python function
|
|
27
|
+
|
|
28
|
+
The function takes `(instruction: str, case_input)` and returns a string or a dict
|
|
29
|
+
(`{"answer": ..., "reasoning": ..., "usage": {"input_tokens": ..., "output_tokens": ..., "model": ...}}`).
|
|
30
|
+
It may be `async`. If it returns `usage`, the card reports cost; if not, the card says "not measured".
|
|
31
|
+
|
|
32
|
+
Because it is your code, Metis asks you to approve it once (`metis trust`) and again whenever
|
|
33
|
+
`agent.yaml` or the module changes. In CI, pass `--trust`.
|
|
34
|
+
|
|
35
|
+
**A call has 60 seconds.** After that Metis records the case as failed ("error", left out of the figures)
|
|
36
|
+
and moves on. A plain (non-`async`) function runs in a worker thread, and Python cannot stop a thread: a
|
|
37
|
+
call that hangs keeps running in the background until it returns or the `metis` process exits. Give your
|
|
38
|
+
own HTTP clients and model calls a timeout shorter than 60 seconds so a stuck call cannot pile up.
|
|
39
|
+
|
|
40
|
+
**Import everything at the top of the module.** While Metis loads your function it temporarily puts your
|
|
41
|
+
project folder on the import path, then removes it. An import inside the function body (`import helpers`
|
|
42
|
+
or `from myapp import tools` run lazily) will fail with `ModuleNotFoundError`, because the project path is
|
|
43
|
+
gone by then. Top-level imports, installed packages and the standard library all work.
|
|
44
|
+
|
|
45
|
+
### LangChain
|
|
46
|
+
|
|
47
|
+
```python
|
|
48
|
+
# myapp/agent.py
|
|
49
|
+
from langchain_anthropic import ChatAnthropic
|
|
50
|
+
from langchain_core.messages import HumanMessage, SystemMessage
|
|
51
|
+
|
|
52
|
+
llm = ChatAnthropic(model="claude-haiku-5-5", temperature=0)
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
def answer(instruction: str, case_input):
|
|
56
|
+
reply = llm.invoke([SystemMessage(content=instruction), HumanMessage(content=str(case_input))])
|
|
57
|
+
return reply.content
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
For a LangGraph agent, pass `instruction` as the system message of the graph's state (or as the
|
|
61
|
+
`prompt` of `create_react_agent`) and return the last message's text.
|
|
62
|
+
|
|
63
|
+
### OpenAI Agents SDK
|
|
64
|
+
|
|
65
|
+
```python
|
|
66
|
+
# myapp/agent.py
|
|
67
|
+
from agents import Agent, Runner
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
def answer(instruction: str, case_input):
|
|
71
|
+
agent = Agent(name="router", instructions=instruction, model="gpt-5")
|
|
72
|
+
result = Runner.run_sync(agent, str(case_input))
|
|
73
|
+
return result.final_output
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
## An HTTP endpoint
|
|
77
|
+
|
|
78
|
+
```yaml
|
|
79
|
+
agent: http://localhost:8000/answer
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
Metis sends `POST` with `{"instruction": "...", "input": "...", "case_id": "..."}` and expects JSON back:
|
|
83
|
+
`{"answer": "...", "reasoning": "...", "usage": {...}}`. Only `answer` is required.
|
|
84
|
+
|
|
85
|
+
Limits, for your safety: plain `http://` is allowed only for `localhost`, `127.0.0.1` and `::1`; any other
|
|
86
|
+
host must use `https://` and resolve to a public address; redirects are not followed; a request times out
|
|
87
|
+
after 60 seconds; a response over 1 MB is refused. An endpoint on this machine needs no `metis trust`. A
|
|
88
|
+
remote endpoint receives your cases and instruction, so it needs approval: `metis trust` shows the URL and
|
|
89
|
+
approves it; changing the URL withdraws the approval. In CI, pass `--trust`.
|
|
90
|
+
|
|
91
|
+
### FastAPI
|
|
92
|
+
|
|
93
|
+
```python
|
|
94
|
+
# server.py
|
|
95
|
+
from fastapi import FastAPI
|
|
96
|
+
from pydantic import BaseModel
|
|
97
|
+
|
|
98
|
+
app = FastAPI()
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
class Ask(BaseModel):
|
|
102
|
+
instruction: str
|
|
103
|
+
input: str
|
|
104
|
+
case_id: str | None = None
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
@app.post("/answer")
|
|
108
|
+
def answer(body: Ask):
|
|
109
|
+
text = run_my_agent(rules=body.instruction, user_input=body.input) # your code
|
|
110
|
+
return {"answer": text}
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
### Express
|
|
114
|
+
|
|
115
|
+
```javascript
|
|
116
|
+
// server.js
|
|
117
|
+
import express from "express";
|
|
118
|
+
|
|
119
|
+
const app = express();
|
|
120
|
+
app.use(express.json());
|
|
121
|
+
|
|
122
|
+
app.post("/answer", async (req, res) => {
|
|
123
|
+
const { instruction, input } = req.body;
|
|
124
|
+
const text = await runMyAgent({ systemPrompt: instruction, userInput: input }); // your code
|
|
125
|
+
res.json({ answer: text });
|
|
126
|
+
});
|
|
127
|
+
|
|
128
|
+
app.listen(8000, "127.0.0.1");
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
Bind to `127.0.0.1` while you test, so only your machine can reach the endpoint.
|
|
132
|
+
|
|
133
|
+
## Then it is the same as prompt mode
|
|
134
|
+
|
|
135
|
+
```bash
|
|
136
|
+
metis check
|
|
137
|
+
metis optimise
|
|
138
|
+
metis accept
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
After `metis accept`, load the accepted instruction in production with the runtime helper
|
|
142
|
+
(`from metis import Agent; Agent.load("metis/agent.yaml").ask(text)`), or read `metis/instruction.md`
|
|
143
|
+
yourself. The helper refuses to run an instruction, ensemble member or setting (model, mode, format, agent,
|
|
144
|
+
max_tokens, escalate_token, scorer) that `agent.lock` has not accepted. A project with no `agent.lock` (you
|
|
145
|
+
never optimised) still runs, with a one-time warning that the instruction is unaccepted.
|
|
146
|
+
|
|
147
|
+
**The accepted `agent.lock` is the production approval.** For a Python agent or a remote endpoint, `metis
|
|
148
|
+
accept` also records a fingerprint of `agent.yaml` (including the URL), the agent module and its parent
|
|
149
|
+
packages. `Agent.load(...).ask()` verifies it and then calls the agent without a `metis trust` record, so a
|
|
150
|
+
deploy host or container needs none. If the module or URL changes after you accept, `Agent.load` raises
|
|
151
|
+
`LockMismatch`; review the change and run `metis accept` again. Without an `agent.lock`, `Agent` still
|
|
152
|
+
requires `metis trust`. The CLI (`check`, `compare`, `optimise`) and MCP always require `metis trust` or
|
|
153
|
+
`--trust`.
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# Pricing
|
|
2
|
+
|
|
3
|
+
**Measuring is free forever. Improving is paid.**
|
|
4
|
+
|
|
5
|
+
`metis check`, `metis compare` (including the CI gate), `metis cases`, the labelling page, the MCP server
|
|
6
|
+
and the runtime helper run on your machine, need no account and have no limits. Your own model calls are
|
|
7
|
+
billed by your own provider.
|
|
8
|
+
|
|
9
|
+
| | Free | Pro | Team | Enterprise |
|
|
10
|
+
|---|---|---|---|---|
|
|
11
|
+
| Price | $0 | $49 a month, 1 seat | $399 a month per organisation, 10 seats | from $2,000 a month, annual |
|
|
12
|
+
| check, compare, CI gate, case builder, MCP, runtime helper | unlimited, local | yes | yes | yes |
|
|
13
|
+
| `metis optimise` | your first run is included; after that $25 per run | 5 runs a month, $12 per extra run | 30 runs a month, $10 per extra run | volume contract |
|
|
14
|
+
| Cards | public, labelled "self-reported" | private cards; agree-or-escalate across three instructions; resumable runs | shared run history, team registry, data processing agreement, zero-retention option (no 30-day abuse log; only the billing record is kept), invoicing | SSO and SCIM, audit logs, data residency, rewriter in your own cloud, SLA, paid pilot |
|
|
15
|
+
|
|
16
|
+
An optimise run is the unit we bill: one session of rewrite generations plus the held-out proof, up to
|
|
17
|
+
the budget you set. We never bill by token or by case. Rewrites run on ThinkerWave's side and are included
|
|
18
|
+
in the run price. The model calls Metis makes to test your agent go to your provider on your key, so
|
|
19
|
+
set `--max-spend` and read the estimate that `metis optimise` prints before it starts.
|
|
20
|
+
|
|
21
|
+
Prices are in US dollars, exclude tax, and are listed on https://thinkerwave.ai/pricing, which is the
|
|
22
|
+
authority if it differs from this page.
|