quickthink
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.
It currently ships as a lightweight scaffolding layer for local LLMs with three modes:
lite(default): one-pass inline plan prefix + answer in a single generationtwo_pass: separate plan call then answer calldirect: no planning pass, raw prompt to model
The plan can be logged as metadata while hidden from normal UI output.
Part of the Hermes Labs reliability stack. quickthink shapes the inference call; sibling tools cover other layers — for example, LintLang statically lints agent-config files, which is complementary to (not a substitute for) quickthink's runtime planning scaffold.
Where it fits
quickthink is useful when you need:
- local LLM routing for local-first inference pipelines
- small model optimization for constrained hardware and low-latency workflows
- latency-aware inference via routing, bypass, and planning-budget controls
- structured output reliability through strict planning grammar and eval gates
- Ollama middleware for practical local deployment
- agent runtime compatibility for CLI and automation-driven execution contexts
What this is / what this is not
What this is:
- A local middleware layer for Ollama-backed LLM calls.
- A small CLI for planned-answer generation, routing diagnostics, and local benchmarking.
- A canonical eval harness for reproducible project-level quality checks.
What this is not:
- Not a hosted API service.
- Not a model training framework.
- Not a replacement for full agent orchestration platforms.
Why
Small/local models are fast but often underperform on multi-step tasks.
quickthink adds a strict planning pass (6-16 keyword tokens by default) to improve response quality without full verbose reasoning traces.
Features
- Ollama-first integration
- Model profiles:
qwen2.5:1.5b,mistral:7b,gemma3:27b - Three execution modes:
lite(default),two_pass,direct - Preset routing profiles:
fast,balanced,strict - Lane policy:
defaultorstrict_safe(routes strict-format tasks to direct path) - Hidden plan by default, optional plan display/logging
- Bypass mode for short prompts (latency control)
- Adaptive routing (
skip,12-token,max-tokenplanning lanes) - Strict plan grammar:
g:<...>;c:<...>;s:<...>;r:<...> - Local eval UI server (
quickthink ui) athttp://127.0.0.1:7860 - Canonical eval harness: run → judge → validate → report
5-minute quickstart
Prerequisite: install and start Ollama locally.
# 1) Before the first PyPI publication, install the current source
python -m pip install "quickthink @ git+https://github.com/hermes-labs-ai/quickthink.git"
# 2) Pull one supported model
ollama pull qwen2.5:1.5b
# 3) Run your first command
quickthink ask "Give me a 3-step plan to learn SQL basics" --model qwen2.5:1.5b
If this command works, your local setup is ready.
After v0.2.1 has been published to PyPI, install the release instead:
python -m pip install "quickthink==0.2.1"
For development, clone the repository and install the editable development extras:
git clone https://github.com/hermes-labs-ai/quickthink.git
cd quickthink
python -m pip install -e '.[dev]'
Documentation Map
- Docs index:
docs/README.md - First-time setup:
docs/GETTING_STARTED.md - Common failures and fixes:
docs/TROUBLESHOOTING.md - Known limitations:
docs/KNOWN_LIMITATIONS.md - Quick demo script:
docs/demo/QUICK_DEMO.md - OSS readiness scorecard:
docs/release/OSS_READINESS_SCORECARD_2026-02-25.md - OSS standards alignment (with external references):
docs/release/OSS_STANDARDS_ALIGNMENT_2026.md - Agent operating notes:
AGENTS.md
Repository Layout
src/quickthink/ Runtime package (CLI, engine, prompts, routing, UI server)
scripts/eval_harness/ Canonical evaluation pipeline (run/judge/validate/report)
scripts/evals/ Legacy smoke/demo helpers (non-canonical)
scripts/demo/ One-command local demo runner
docs/evals/ Prompt sets, rubrics, harness specs, deployment gate notes
docs/release/ Release process and repository audit notes
tests/ Unit tests for runtime and harness safety checks
See full architecture + publishability audit:
docs/release/REPO_STRUCTURE_AND_PUBLISHABILITY_AUDIT_2026-02-20.md.
Canonical vs Legacy Scripts
Canonical project workflows:
scripts/eval_harness/*: maintained evaluation pipeline for run/judge/validate/report.scripts/demo/quickstart.sh: canonical end-to-end local smoke/demo flow.
Legacy helpers (kept for compatibility and ad-hoc smoke checks):
scripts/evals/*: non-canonical helpers; do not treat as release gate source of truth.
When in doubt, use scripts/eval_harness/* and scripts/demo/quickstart.sh.
Usage
List supported profiles:
quickthink list-models
List preset routing profiles:
quickthink list-presets
Show officially supported compatibility models:
quickthink compatibility
Ask with compressed planning:
quickthink ask "How would a cow round up a border collie?" --model qwen2.5:1.5b --preset balanced
Show plan in terminal:
quickthink ask "How would a cow round up a border collie?" --model mistral:7b --show-plan
Switch to two-pass mode:
quickthink ask "How would a cow round up a border collie?" --mode two_pass --show-route --show-plan
Show routing diagnostics:
quickthink ask "Design a robust parser with tradeoffs and a JSON output schema" --show-route --show-plan
Optional continuity hint (tiny, off by default):
quickthink ask "Continue the previous structure" --continuity-hint "ctx:prior_goal,format_json"
Strict-format-safe lane policy (routes strict format tasks to direct path first):
quickthink ask "json only: {\"ok\":true,\"why\":\"short\"}" --lane-policy strict_safe --show-route
Benchmark with strict-safe lane policy:
quickthink bench "Answer with YES or NO only: Is 2+2=4?" --lane-policy strict_safe --runs 3
Log plan + metrics as JSONL metadata:
quickthink ask "Design a tiny retry strategy" --log-file ./logs/quickthink.jsonl
Benchmark all three modes (lite, two_pass, direct):
quickthink bench "Design a robust parser for CSV with malformed quotes" --model qwen2.5:1.5b --runs 3
One-Command Quickstart Demo
Run full local demo setup and artifact generation:
bash scripts/demo/quickstart.sh
It does:
- Python env + package install
ollama pullfor supported models- Sample A/B/C eval run
- Result validation
- Markdown/HTML report generation
- Compatibility snapshot update
For a one-minute terminal walkthrough command set, see docs/demo/QUICK_DEMO.md.
Optional environment flags:
QUICKTHINK_PRESET=fast|balanced|strictQUICKTHINK_LIMIT=<n>(number of prompts from canonical set)QUICKTHINK_RUNS=<n>QUICKTHINK_RUN_JUDGE=1(switch judge backend fromruletoollama)QUICKTHINK_JUDGE_MODEL=<model>
Troubleshooting
For common setup/runtime failures and fixes, see docs/TROUBLESHOOTING.md.
Reports
Canonical report flow:
python3 scripts/eval_harness/run_suite.py \
--prompt-set docs/evals/prompt_set.jsonl \
--out docs/evals/results/run-<timestamp>.jsonl \
--manifest-out docs/evals/results/manifest-<timestamp>.json \
--runs 3
python3 scripts/eval_harness/judge_suite.py \
--prompt-set docs/evals/prompt_set.jsonl \
--results docs/evals/results/run-<timestamp>.jsonl \
--out docs/evals/results/judged-<timestamp>.jsonl \
--backend rule
python3 scripts/eval_harness/validate_judged_results.py \
--path docs/evals/results/judged-<timestamp>.jsonl
python3 scripts/eval_harness/report_suite.py \
--runs docs/evals/results/run-<timestamp>.jsonl \
--judged docs/evals/results/judged-<timestamp>.jsonl \
--out-json docs/evals/results/report-<timestamp>.json \
--out-md docs/evals/results/report-<timestamp>.md \
--out-html docs/evals/results/report-<timestamp>.html
Legacy helpers in scripts/evals/* remain available for smoke/demo use only.
Compatibility Matrix
- Supported models are fixed to:
qwen2.5:1.5bmistral:7bgemma3:27b
- Experimental evaluations may include additional models (for example
llama3.2:latest) in deployment-gate or variant-gate workflows. Treat those as research lanes unless promoted intoSUPPORTED_MODELSin runtime config. - Regenerate matrix + snapshot with:
python3 scripts/evals/compat_matrix_snapshot.py
Launch local web UI (for eval/scaffolding testing):
quickthink ui
Then open http://127.0.0.1:7860 if it does not open automatically.
UI lane control:
Lane policydropdown supportsdefaultandstrict_safefor single-prompt runs and 3-mode comparisons.
UI eval safety gates:
- Preflight is required before any eval run (
validate_prompt_set.pymust returnstatus=OK). - Run-file ingestion is blocked unless
validate_results.pyreturnsstatus=OK. - UI displays validator output and dataset SHA256 for reproducible/comparable runs.
Public Repo Scope
Included in this public repository:
- runtime source code (
src/quickthink) - reusable evaluation harness (
scripts/eval_harness,docs/evalsprompt/spec files) - tests and release process notes
Excluded from public tracking:
- internal multi-agent comms logs
- generated eval result dumps and ad-hoc local traces
- private experiment workspaces under
experiments-local/
Branching
- Keep version tracks isolated in
codex/*branches. - Merge to
mainonly after benchmarks and notes are updated. - See
docs/VERSION_NOTES.mdfor version-to-version differences.
Maintainer Commands
Install (editable + dev):
python -m venv .venv
source .venv/bin/activate
pip install -e '.[dev]'
Test:
PYTHONPATH=src .venv/bin/pytest -q
Lint (basic syntax/import sanity):
python -m compileall src tests scripts
Release docs + checklist:
make release-check VERSION=x.y.z
Follow:
docs/release/RELEASE_CHECKLIST.mddocs/release/RELEASE_PROCESS.mddocs/release/SUPPLY_CHAIN_BASELINE_2026.md
Limitations / What it does not do
Grounded in how the code actually behaves:
- It does not improve every answer. Whether the planning scaffold helps is model- and task-dependent; run the eval harness before claiming improvements.
- 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_passmode, the plan) still come from your Ollama model, sotwo_passadds one extra model call versusdirect. - 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. - 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. - 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.
- Hidden planning is still logged for transparency; keep
--log-fileoutput auditable if you rely on the plan.
License
Apache-2.0
About Hermes Labs
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.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file quickthink-0.2.1.tar.gz.
File metadata
- Download URL: quickthink-0.2.1.tar.gz
- Upload date:
- Size: 37.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7849e1d916b938fbbc003a283105ef3f924eb747876bb41aac356a063d1eb527
|
|
| MD5 |
8cf5e1eb8870cda3b9884f61da5b007b
|
|
| BLAKE2b-256 |
fb92767c3eb55b5c52a5643d94b142ba118beef3cc8b832dcef6068cdcb68853
|
Provenance
The following attestation bundles were made for quickthink-0.2.1.tar.gz:
Publisher:
publish.yml on hermes-labs-ai/quickthink
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
quickthink-0.2.1.tar.gz -
Subject digest:
7849e1d916b938fbbc003a283105ef3f924eb747876bb41aac356a063d1eb527 - Sigstore transparency entry: 2341110266
- Sigstore integration time:
-
Permalink:
hermes-labs-ai/quickthink@998aceeeff5cf80ddbed82acca1c7d980b216117 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/hermes-labs-ai
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@998aceeeff5cf80ddbed82acca1c7d980b216117 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file quickthink-0.2.1-py3-none-any.whl.
File metadata
- Download URL: quickthink-0.2.1-py3-none-any.whl
- Upload date:
- Size: 30.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
84feb022440b129d83a56e853095a2f4240210053859ef152fe6201f6190f773
|
|
| MD5 |
68346a50e3b91b91cd2fc3b06353f5df
|
|
| BLAKE2b-256 |
aaac5eccd807f0af64fcdb0a0d76ac2e3e74b6a93b7a8e536481dae1efd61d7b
|
Provenance
The following attestation bundles were made for quickthink-0.2.1-py3-none-any.whl:
Publisher:
publish.yml on hermes-labs-ai/quickthink
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
quickthink-0.2.1-py3-none-any.whl -
Subject digest:
84feb022440b129d83a56e853095a2f4240210053859ef152fe6201f6190f773 - Sigstore transparency entry: 2341110270
- Sigstore integration time:
-
Permalink:
hermes-labs-ai/quickthink@998aceeeff5cf80ddbed82acca1c7d980b216117 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/hermes-labs-ai
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@998aceeeff5cf80ddbed82acca1c7d980b216117 -
Trigger Event:
workflow_dispatch
-
Statement type: