quickthink 0.2.1__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.
- quickthink-0.2.1/LICENSE +176 -0
- quickthink-0.2.1/PKG-INFO +387 -0
- quickthink-0.2.1/README.md +356 -0
- quickthink-0.2.1/pyproject.toml +80 -0
- quickthink-0.2.1/setup.cfg +4 -0
- quickthink-0.2.1/src/quickthink/__init__.py +6 -0
- quickthink-0.2.1/src/quickthink/cli.py +187 -0
- quickthink-0.2.1/src/quickthink/config.py +108 -0
- quickthink-0.2.1/src/quickthink/engine.py +174 -0
- quickthink-0.2.1/src/quickthink/inline_protocol.py +18 -0
- quickthink-0.2.1/src/quickthink/ollama_client.py +38 -0
- quickthink-0.2.1/src/quickthink/plan_grammar.py +24 -0
- quickthink-0.2.1/src/quickthink/prompts.py +73 -0
- quickthink-0.2.1/src/quickthink/routing.py +65 -0
- quickthink-0.2.1/src/quickthink/ui_server.py +1465 -0
- quickthink-0.2.1/src/quickthink.egg-info/PKG-INFO +387 -0
- quickthink-0.2.1/src/quickthink.egg-info/SOURCES.txt +31 -0
- quickthink-0.2.1/src/quickthink.egg-info/dependency_links.txt +1 -0
- quickthink-0.2.1/src/quickthink.egg-info/entry_points.txt +2 -0
- quickthink-0.2.1/src/quickthink.egg-info/requires.txt +7 -0
- quickthink-0.2.1/src/quickthink.egg-info/top_level.txt +1 -0
- quickthink-0.2.1/tests/test_cli_lane_policy.py +13 -0
- quickthink-0.2.1/tests/test_cli_version.py +12 -0
- quickthink-0.2.1/tests/test_engine_lane_policy.py +72 -0
- quickthink-0.2.1/tests/test_eval_harness_safety.py +52 -0
- quickthink-0.2.1/tests/test_inline_protocol.py +15 -0
- quickthink-0.2.1/tests/test_make_gate_decision.py +68 -0
- quickthink-0.2.1/tests/test_plan_grammar.py +17 -0
- quickthink-0.2.1/tests/test_presets.py +22 -0
- quickthink-0.2.1/tests/test_prompts.py +20 -0
- quickthink-0.2.1/tests/test_routing.py +37 -0
- quickthink-0.2.1/tests/test_ui_lane_policy.py +58 -0
- quickthink-0.2.1/tests/test_ui_server_paths.py +24 -0
quickthink-0.2.1/LICENSE
ADDED
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
@@ -0,0 +1,387 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: quickthink
|
|
3
|
+
Version: 0.2.1
|
|
4
|
+
Summary: Compressed planning scaffold for local LLMs — latency-aware routing and structured output reliability
|
|
5
|
+
Author-email: Rolando Bosch <roli@hermes-labs.ai>
|
|
6
|
+
License-Expression: Apache-2.0
|
|
7
|
+
Project-URL: Homepage, https://hermes-labs.ai
|
|
8
|
+
Project-URL: Repository, https://github.com/hermes-labs-ai/quickthink
|
|
9
|
+
Project-URL: Documentation, https://github.com/hermes-labs-ai/quickthink#readme
|
|
10
|
+
Project-URL: Changelog, https://github.com/hermes-labs-ai/quickthink/blob/main/CHANGELOG.md
|
|
11
|
+
Project-URL: Issues, https://github.com/hermes-labs-ai/quickthink/issues
|
|
12
|
+
Keywords: llm,local-llm,ollama,inference,scaffold,routing,llm-routing,plan-then-answer,latency-aware-routing,agent,structured-output
|
|
13
|
+
Classifier: Development Status :: 4 - Beta
|
|
14
|
+
Classifier: Intended Audience :: Developers
|
|
15
|
+
Classifier: Programming Language :: Python :: 3
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
20
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
21
|
+
Requires-Python: >=3.9
|
|
22
|
+
Description-Content-Type: text/markdown
|
|
23
|
+
License-File: LICENSE
|
|
24
|
+
Requires-Dist: httpx>=0.27.0
|
|
25
|
+
Requires-Dist: typer>=0.12.0
|
|
26
|
+
Requires-Dist: pydantic>=2.7.0
|
|
27
|
+
Provides-Extra: dev
|
|
28
|
+
Requires-Dist: pytest>=8.2.0; extra == "dev"
|
|
29
|
+
Requires-Dist: ruff>=0.4.0; extra == "dev"
|
|
30
|
+
Dynamic: license-file
|
|
31
|
+
|
|
32
|
+
# quickthink
|
|
33
|
+
|
|
34
|
+
[](https://github.com/hermes-labs-ai/quickthink/actions/workflows/ci.yml)
|
|
35
|
+
[](LICENSE)
|
|
36
|
+
[](pyproject.toml)
|
|
37
|
+
|
|
38
|
+
**quickthink is a local-first CLI and Python library that wraps Ollama-backed LLM calls with a compressed plan-then-answer scaffold and latency-aware routing.** It adds a short, validated planning step before the answer for prompts that look multi-step, and routes simple prompts straight through to the model.
|
|
39
|
+
|
|
40
|
+
It currently ships as a lightweight scaffolding layer for local LLMs with three modes:
|
|
41
|
+
- `lite` (default): one-pass inline plan prefix + answer in a single generation
|
|
42
|
+
- `two_pass`: separate plan call then answer call
|
|
43
|
+
- `direct`: no planning pass, raw prompt to model
|
|
44
|
+
|
|
45
|
+
The plan can be logged as metadata while hidden from normal UI output.
|
|
46
|
+
|
|
47
|
+
Part of the [Hermes Labs reliability stack](https://github.com/hermes-labs-ai). quickthink shapes the inference call; sibling tools cover other layers — for example, [LintLang](https://github.com/hermes-labs-ai/lintlang) statically lints agent-config files, which is complementary to (not a substitute for) quickthink's runtime planning scaffold.
|
|
48
|
+
|
|
49
|
+
## Where it fits
|
|
50
|
+
|
|
51
|
+
quickthink is useful when you need:
|
|
52
|
+
- **local LLM routing** for local-first inference pipelines
|
|
53
|
+
- **small model optimization** for constrained hardware and low-latency workflows
|
|
54
|
+
- **latency-aware inference** via routing, bypass, and planning-budget controls
|
|
55
|
+
- **structured output reliability** through strict planning grammar and eval gates
|
|
56
|
+
- **Ollama middleware** for practical local deployment
|
|
57
|
+
- **agent runtime compatibility** for CLI and automation-driven execution contexts
|
|
58
|
+
|
|
59
|
+
## What this is / what this is not
|
|
60
|
+
|
|
61
|
+
What this is:
|
|
62
|
+
- A local middleware layer for Ollama-backed LLM calls.
|
|
63
|
+
- A small CLI for planned-answer generation, routing diagnostics, and local benchmarking.
|
|
64
|
+
- A canonical eval harness for reproducible project-level quality checks.
|
|
65
|
+
|
|
66
|
+
What this is not:
|
|
67
|
+
- Not a hosted API service.
|
|
68
|
+
- Not a model training framework.
|
|
69
|
+
- Not a replacement for full agent orchestration platforms.
|
|
70
|
+
|
|
71
|
+
## Why
|
|
72
|
+
|
|
73
|
+
Small/local models are fast but often underperform on multi-step tasks.
|
|
74
|
+
`quickthink` adds a strict planning pass (6-16 keyword tokens by default) to improve response quality without full verbose reasoning traces.
|
|
75
|
+
|
|
76
|
+
## Features
|
|
77
|
+
|
|
78
|
+
- Ollama-first integration
|
|
79
|
+
- Model profiles: `qwen2.5:1.5b`, `mistral:7b`, `gemma3:27b`
|
|
80
|
+
- Three execution modes: `lite` (default), `two_pass`, `direct`
|
|
81
|
+
- Preset routing profiles: `fast`, `balanced`, `strict`
|
|
82
|
+
- Lane policy: `default` or `strict_safe` (routes strict-format tasks to direct path)
|
|
83
|
+
- Hidden plan by default, optional plan display/logging
|
|
84
|
+
- Bypass mode for short prompts (latency control)
|
|
85
|
+
- Adaptive routing (`skip`, `12-token`, `max-token` planning lanes)
|
|
86
|
+
- Strict plan grammar: `g:<...>;c:<...>;s:<...>;r:<...>`
|
|
87
|
+
- Local eval UI server (`quickthink ui`) at `http://127.0.0.1:7860`
|
|
88
|
+
- Canonical eval harness: run → judge → validate → report
|
|
89
|
+
|
|
90
|
+
## 5-minute quickstart
|
|
91
|
+
|
|
92
|
+
Prerequisite: install and start [Ollama](https://ollama.com/) locally.
|
|
93
|
+
|
|
94
|
+
```bash
|
|
95
|
+
# 1) Before the first PyPI publication, install the current source
|
|
96
|
+
python -m pip install "quickthink @ git+https://github.com/hermes-labs-ai/quickthink.git"
|
|
97
|
+
|
|
98
|
+
# 2) Pull one supported model
|
|
99
|
+
ollama pull qwen2.5:1.5b
|
|
100
|
+
|
|
101
|
+
# 3) Run your first command
|
|
102
|
+
quickthink ask "Give me a 3-step plan to learn SQL basics" --model qwen2.5:1.5b
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
If this command works, your local setup is ready.
|
|
106
|
+
|
|
107
|
+
After `v0.2.1` has been published to PyPI, install the release instead:
|
|
108
|
+
|
|
109
|
+
```bash
|
|
110
|
+
python -m pip install "quickthink==0.2.1"
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
For development, clone the repository and install the editable development extras:
|
|
114
|
+
|
|
115
|
+
```bash
|
|
116
|
+
git clone https://github.com/hermes-labs-ai/quickthink.git
|
|
117
|
+
cd quickthink
|
|
118
|
+
python -m pip install -e '.[dev]'
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
## Documentation Map
|
|
122
|
+
|
|
123
|
+
- Docs index: `docs/README.md`
|
|
124
|
+
- First-time setup: `docs/GETTING_STARTED.md`
|
|
125
|
+
- Common failures and fixes: `docs/TROUBLESHOOTING.md`
|
|
126
|
+
- Known limitations: `docs/KNOWN_LIMITATIONS.md`
|
|
127
|
+
- Quick demo script: `docs/demo/QUICK_DEMO.md`
|
|
128
|
+
- OSS readiness scorecard: `docs/release/OSS_READINESS_SCORECARD_2026-02-25.md`
|
|
129
|
+
- OSS standards alignment (with external references): `docs/release/OSS_STANDARDS_ALIGNMENT_2026.md`
|
|
130
|
+
- Agent operating notes: `AGENTS.md`
|
|
131
|
+
|
|
132
|
+
## Repository Layout
|
|
133
|
+
|
|
134
|
+
```text
|
|
135
|
+
src/quickthink/ Runtime package (CLI, engine, prompts, routing, UI server)
|
|
136
|
+
scripts/eval_harness/ Canonical evaluation pipeline (run/judge/validate/report)
|
|
137
|
+
scripts/evals/ Legacy smoke/demo helpers (non-canonical)
|
|
138
|
+
scripts/demo/ One-command local demo runner
|
|
139
|
+
docs/evals/ Prompt sets, rubrics, harness specs, deployment gate notes
|
|
140
|
+
docs/release/ Release process and repository audit notes
|
|
141
|
+
tests/ Unit tests for runtime and harness safety checks
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
See full architecture + publishability audit:
|
|
145
|
+
`docs/release/REPO_STRUCTURE_AND_PUBLISHABILITY_AUDIT_2026-02-20.md`.
|
|
146
|
+
|
|
147
|
+
## Canonical vs Legacy Scripts
|
|
148
|
+
|
|
149
|
+
Canonical project workflows:
|
|
150
|
+
- `scripts/eval_harness/*`: maintained evaluation pipeline for run/judge/validate/report.
|
|
151
|
+
- `scripts/demo/quickstart.sh`: canonical end-to-end local smoke/demo flow.
|
|
152
|
+
|
|
153
|
+
Legacy helpers (kept for compatibility and ad-hoc smoke checks):
|
|
154
|
+
- `scripts/evals/*`: non-canonical helpers; do not treat as release gate source of truth.
|
|
155
|
+
|
|
156
|
+
When in doubt, use `scripts/eval_harness/*` and `scripts/demo/quickstart.sh`.
|
|
157
|
+
|
|
158
|
+
## Usage
|
|
159
|
+
|
|
160
|
+
List supported profiles:
|
|
161
|
+
|
|
162
|
+
```bash
|
|
163
|
+
quickthink list-models
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
List preset routing profiles:
|
|
167
|
+
|
|
168
|
+
```bash
|
|
169
|
+
quickthink list-presets
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
Show officially supported compatibility models:
|
|
173
|
+
|
|
174
|
+
```bash
|
|
175
|
+
quickthink compatibility
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
Ask with compressed planning:
|
|
179
|
+
|
|
180
|
+
```bash
|
|
181
|
+
quickthink ask "How would a cow round up a border collie?" --model qwen2.5:1.5b --preset balanced
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
Show plan in terminal:
|
|
185
|
+
|
|
186
|
+
```bash
|
|
187
|
+
quickthink ask "How would a cow round up a border collie?" --model mistral:7b --show-plan
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
Switch to two-pass mode:
|
|
191
|
+
|
|
192
|
+
```bash
|
|
193
|
+
quickthink ask "How would a cow round up a border collie?" --mode two_pass --show-route --show-plan
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
Show routing diagnostics:
|
|
197
|
+
|
|
198
|
+
```bash
|
|
199
|
+
quickthink ask "Design a robust parser with tradeoffs and a JSON output schema" --show-route --show-plan
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
Optional continuity hint (tiny, off by default):
|
|
203
|
+
|
|
204
|
+
```bash
|
|
205
|
+
quickthink ask "Continue the previous structure" --continuity-hint "ctx:prior_goal,format_json"
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
Strict-format-safe lane policy (routes strict format tasks to direct path first):
|
|
209
|
+
|
|
210
|
+
```bash
|
|
211
|
+
quickthink ask "json only: {\"ok\":true,\"why\":\"short\"}" --lane-policy strict_safe --show-route
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
Benchmark with strict-safe lane policy:
|
|
215
|
+
|
|
216
|
+
```bash
|
|
217
|
+
quickthink bench "Answer with YES or NO only: Is 2+2=4?" --lane-policy strict_safe --runs 3
|
|
218
|
+
```
|
|
219
|
+
|
|
220
|
+
Log plan + metrics as JSONL metadata:
|
|
221
|
+
|
|
222
|
+
```bash
|
|
223
|
+
quickthink ask "Design a tiny retry strategy" --log-file ./logs/quickthink.jsonl
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
Benchmark all three modes (lite, two_pass, direct):
|
|
227
|
+
|
|
228
|
+
```bash
|
|
229
|
+
quickthink bench "Design a robust parser for CSV with malformed quotes" --model qwen2.5:1.5b --runs 3
|
|
230
|
+
```
|
|
231
|
+
|
|
232
|
+
## One-Command Quickstart Demo
|
|
233
|
+
|
|
234
|
+
Run full local demo setup and artifact generation:
|
|
235
|
+
|
|
236
|
+
```bash
|
|
237
|
+
bash scripts/demo/quickstart.sh
|
|
238
|
+
```
|
|
239
|
+
|
|
240
|
+
It does:
|
|
241
|
+
- Python env + package install
|
|
242
|
+
- `ollama pull` for supported models
|
|
243
|
+
- Sample A/B/C eval run
|
|
244
|
+
- Result validation
|
|
245
|
+
- Markdown/HTML report generation
|
|
246
|
+
- Compatibility snapshot update
|
|
247
|
+
|
|
248
|
+
For a one-minute terminal walkthrough command set, see `docs/demo/QUICK_DEMO.md`.
|
|
249
|
+
|
|
250
|
+
Optional environment flags:
|
|
251
|
+
- `QUICKTHINK_PRESET=fast|balanced|strict`
|
|
252
|
+
- `QUICKTHINK_LIMIT=<n>` (number of prompts from canonical set)
|
|
253
|
+
- `QUICKTHINK_RUNS=<n>`
|
|
254
|
+
- `QUICKTHINK_RUN_JUDGE=1` (switch judge backend from `rule` to `ollama`)
|
|
255
|
+
- `QUICKTHINK_JUDGE_MODEL=<model>`
|
|
256
|
+
|
|
257
|
+
## Troubleshooting
|
|
258
|
+
|
|
259
|
+
For common setup/runtime failures and fixes, see `docs/TROUBLESHOOTING.md`.
|
|
260
|
+
|
|
261
|
+
## Reports
|
|
262
|
+
|
|
263
|
+
Canonical report flow:
|
|
264
|
+
|
|
265
|
+
```bash
|
|
266
|
+
python3 scripts/eval_harness/run_suite.py \
|
|
267
|
+
--prompt-set docs/evals/prompt_set.jsonl \
|
|
268
|
+
--out docs/evals/results/run-<timestamp>.jsonl \
|
|
269
|
+
--manifest-out docs/evals/results/manifest-<timestamp>.json \
|
|
270
|
+
--runs 3
|
|
271
|
+
|
|
272
|
+
python3 scripts/eval_harness/judge_suite.py \
|
|
273
|
+
--prompt-set docs/evals/prompt_set.jsonl \
|
|
274
|
+
--results docs/evals/results/run-<timestamp>.jsonl \
|
|
275
|
+
--out docs/evals/results/judged-<timestamp>.jsonl \
|
|
276
|
+
--backend rule
|
|
277
|
+
|
|
278
|
+
python3 scripts/eval_harness/validate_judged_results.py \
|
|
279
|
+
--path docs/evals/results/judged-<timestamp>.jsonl
|
|
280
|
+
|
|
281
|
+
python3 scripts/eval_harness/report_suite.py \
|
|
282
|
+
--runs docs/evals/results/run-<timestamp>.jsonl \
|
|
283
|
+
--judged docs/evals/results/judged-<timestamp>.jsonl \
|
|
284
|
+
--out-json docs/evals/results/report-<timestamp>.json \
|
|
285
|
+
--out-md docs/evals/results/report-<timestamp>.md \
|
|
286
|
+
--out-html docs/evals/results/report-<timestamp>.html
|
|
287
|
+
```
|
|
288
|
+
|
|
289
|
+
Legacy helpers in `scripts/evals/*` remain available for smoke/demo use only.
|
|
290
|
+
|
|
291
|
+
## Compatibility Matrix
|
|
292
|
+
|
|
293
|
+
- Supported models are fixed to:
|
|
294
|
+
- `qwen2.5:1.5b`
|
|
295
|
+
- `mistral:7b`
|
|
296
|
+
- `gemma3:27b`
|
|
297
|
+
- Experimental evaluations may include additional models (for example `llama3.2:latest`) in
|
|
298
|
+
deployment-gate or variant-gate workflows. Treat those as research lanes unless promoted
|
|
299
|
+
into `SUPPORTED_MODELS` in runtime config.
|
|
300
|
+
- Regenerate matrix + snapshot with:
|
|
301
|
+
|
|
302
|
+
```bash
|
|
303
|
+
python3 scripts/evals/compat_matrix_snapshot.py
|
|
304
|
+
```
|
|
305
|
+
|
|
306
|
+
Launch local web UI (for eval/scaffolding testing):
|
|
307
|
+
|
|
308
|
+
```bash
|
|
309
|
+
quickthink ui
|
|
310
|
+
```
|
|
311
|
+
|
|
312
|
+
Then open `http://127.0.0.1:7860` if it does not open automatically.
|
|
313
|
+
|
|
314
|
+
UI lane control:
|
|
315
|
+
- `Lane policy` dropdown supports `default` and `strict_safe` for single-prompt runs and 3-mode comparisons.
|
|
316
|
+
|
|
317
|
+
UI eval safety gates:
|
|
318
|
+
- Preflight is required before any eval run (`validate_prompt_set.py` must return `status=OK`).
|
|
319
|
+
- Run-file ingestion is blocked unless `validate_results.py` returns `status=OK`.
|
|
320
|
+
- UI displays validator output and dataset SHA256 for reproducible/comparable runs.
|
|
321
|
+
|
|
322
|
+
## Public Repo Scope
|
|
323
|
+
|
|
324
|
+
Included in this public repository:
|
|
325
|
+
- runtime source code (`src/quickthink`)
|
|
326
|
+
- reusable evaluation harness (`scripts/eval_harness`, `docs/evals` prompt/spec files)
|
|
327
|
+
- tests and release process notes
|
|
328
|
+
|
|
329
|
+
Excluded from public tracking:
|
|
330
|
+
- internal multi-agent comms logs
|
|
331
|
+
- generated eval result dumps and ad-hoc local traces
|
|
332
|
+
- private experiment workspaces under `experiments-local/`
|
|
333
|
+
|
|
334
|
+
## Branching
|
|
335
|
+
|
|
336
|
+
- Keep version tracks isolated in `codex/*` branches.
|
|
337
|
+
- Merge to `main` only after benchmarks and notes are updated.
|
|
338
|
+
- See `docs/VERSION_NOTES.md` for version-to-version differences.
|
|
339
|
+
|
|
340
|
+
## Maintainer Commands
|
|
341
|
+
|
|
342
|
+
Install (editable + dev):
|
|
343
|
+
```bash
|
|
344
|
+
python -m venv .venv
|
|
345
|
+
source .venv/bin/activate
|
|
346
|
+
pip install -e '.[dev]'
|
|
347
|
+
```
|
|
348
|
+
|
|
349
|
+
Test:
|
|
350
|
+
```bash
|
|
351
|
+
PYTHONPATH=src .venv/bin/pytest -q
|
|
352
|
+
```
|
|
353
|
+
|
|
354
|
+
Lint (basic syntax/import sanity):
|
|
355
|
+
```bash
|
|
356
|
+
python -m compileall src tests scripts
|
|
357
|
+
```
|
|
358
|
+
|
|
359
|
+
Release docs + checklist:
|
|
360
|
+
```bash
|
|
361
|
+
make release-check VERSION=x.y.z
|
|
362
|
+
```
|
|
363
|
+
Follow:
|
|
364
|
+
- `docs/release/RELEASE_CHECKLIST.md`
|
|
365
|
+
- `docs/release/RELEASE_PROCESS.md`
|
|
366
|
+
- `docs/release/SUPPLY_CHAIN_BASELINE_2026.md`
|
|
367
|
+
|
|
368
|
+
## Limitations / What it does not do
|
|
369
|
+
|
|
370
|
+
Grounded in how the code actually behaves:
|
|
371
|
+
|
|
372
|
+
- It does not improve every answer. Whether the planning scaffold helps is model- and task-dependent; run the eval harness before claiming improvements.
|
|
373
|
+
- It does not add an LLM of its own. The routing, plan grammar, and validation/repair logic are plain Python; the answer (and, in `two_pass` mode, the plan) still come from your Ollama model, so `two_pass` adds one extra model call versus `direct`.
|
|
374
|
+
- It does not verify correctness. When a generated plan fails the grammar check, the engine substitutes a fixed fallback plan (`g:solve;c:constraints;s:direct_reasoning;r:verify_output`); this keeps the format valid but does not make the answer correct.
|
|
375
|
+
- It only targets the three pinned models in `SUPPORTED_MODELS` (`qwen2.5:1.5b`, `mistral:7b`, `gemma3:27b`). Other models may run but are untuned.
|
|
376
|
+
- It is local-first only: it talks to a local Ollama HTTP endpoint and is not a hosted API, a training framework, or an agent-orchestration platform.
|
|
377
|
+
- Hidden planning is still logged for transparency; keep `--log-file` output auditable if you rely on the plan.
|
|
378
|
+
|
|
379
|
+
## License
|
|
380
|
+
|
|
381
|
+
Apache-2.0
|
|
382
|
+
|
|
383
|
+
---
|
|
384
|
+
|
|
385
|
+
## About Hermes Labs
|
|
386
|
+
|
|
387
|
+
Hermes Labs is an independent AI-reliability lab building open-source tools that catch silent failure modes in production AI. More at [hermes-labs.ai](https://hermes-labs.ai).
|