qprompt-cli
Internal trace utility for LLM workflows.
Goal: make answers inspectable with structured records of parsing, tool execution, evidence, and risks.
Why we use this internally
- Identify why a model answer is wrong without re-running blind.
- Detect when an answer claims tool usage that did not actually happen.
- Preserve a portable artifact for incident review and QA.
- Standardize trace shape across model/tool backends.
What is captured
- Request metadata:
trace_id,timestamp,model,question - Parse stage:
intent,entities,assumptions,missing_context,suggested_tools - Request envelope: model messages and available tools
- Tool execution: name, redacted input, output summary, status, error
- Evidence records: claim/source/evidence id
- Model response metrics: latency, token usage estimates (or provider usage when available)
- Audit output: claims, unsupported claims, risk flags
Explicit limitations
- No hidden chain-of-thought extraction.
- No neuron/attention internals for hosted closed models.
- Token usage depends on provider payload; may be estimate-only.
Install
python -m pip install -e .
Import:
from qprompt import Tracer
CLI
qprompt run "why did revenue drop in March?" # real path: stub LLM, no synthetic tools
qprompt run "why did revenue drop in March?" --demo # synthetic SQL + evidence (marked is_demo=true)
qprompt list
qprompt show <trace_id_or_path>
qprompt diff <trace_a> <trace_b>
The --demo flag is opt-in; the default never injects fake tool calls or evidence. Demo traces carry is_demo: true and are flagged on stdout/stderr so they can never be silently mistaken for real data.
Default storage:
.traces/YYYY-MM-DD/trace_<uuid>.json
Data contract
- JSON schema:
src/llmtrace/trace_schema.json - Runtime builder/validator:
src/llmtrace/schema.py
Operational behavior
- Trace write occurs only after schema validation.
- Failed tool calls are recorded as step errors and surfaced as risks.
- Multi-month phrasing (e.g. "April vs March") is preserved in parsed period.
Integration notes
Tracer.run(...)currently includes a mock model path for local validation.- For production usage, replace the callable used by
Tracer.chat(...)with provider-specific calls and pass back usage fields when available. - For SQL/tool-backed workflows, run tools in code and pass outputs into the traced context; prompt text alone does not execute tools.
Metadata
Release files for qprompt-cli 0.1.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| qprompt_cli-0.1.5.tar.gz | 26.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| qprompt_cli-0.1.5-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 47.5 kB
Release files / qprompt_cli-0.1.5.tar.gz
| Download URL | qprompt_cli-0.1.5.tar.gz |
|---|---|
| Size | 26.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1272212e2acf284e62a1dc73bce8f6d259e574877892a1dd6ed1f64ee345c476
|
|
BLAKE2b-256 checksum How to use checksums |
55262108bcea76c2ad78a045c79a808f2018dfb22330b9c78fedc7f1d92923a6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on May 14, 2026.
Transparency logRelease files / qprompt_cli-0.1.5-py3-none-any.whl
| Download URL | qprompt_cli-0.1.5-py3-none-any.whl |
|---|---|
| Size | 20.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e6b3efaf9a82d3b89467801356d2b86a4455006eab4eb480db4976a827b74ef5
|
|
BLAKE2b-256 checksum How to use checksums |
71855319f52dc63d125759887224dee6687749e46165ca9e373f529c2e770bf7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on May 14, 2026.
Transparency log