Observed since 21 Oct, 09:38 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
Dependency-light Python utilities for GPT, agent, retrieval, and tool pipelines.
Dependency-light utilities for the unglamorous parts of production GPT and agent systems: preparing retrieval data, reducing unsafe context, shrinking tool payloads, validating action schemas, guarding model-selected URLs, cleaning HTML, handling transient HTTP failures, and keeping retrieval corpora clean.
These utilities are intentionally useful outside one OpenAI surface. They can sit around GPT Actions, Responses/API tool loops, plugin-style integrations, n8n automations, MCP-backed workflows, or other model runtimes.
The core package uses only the Python standard library.
python -m pip install -e .
YAML support for the OpenAPI auditor is optional:
python -m pip install -e '.[yaml]'
Python 3.11+ is required.
Turn text-forward files into deterministic JSONL chunks with source metadata and SHA-256 hashes.
gpt-chunk ./knowledge ./docs \
--output chunks.jsonl \
--max-chars 4000 \
--overlap-chars 400
Supported input: Markdown, text, JSON, and CSV.
Good for:
The chunker is character-based on purpose. It does not pretend character counts are exact model token counts.
Remove common sensitive values before text is sent to a model, written to a debug log, or stored in a prompt trace.
cat support-ticket.txt | gpt-redact --report > support-ticket.redacted.txt
It detects common patterns for:
This is a safety layer, not a compliance product. Real privacy programs still need data classification, access controls, retention rules, and service-specific review.
Large API responses are expensive and often distract the model with irrelevant fields. The compactor recursively trims them before they enter model context.
gpt-compact api-response.json \
--output compact.json \
--max-items 20 \
--max-string 1000 \
--max-depth 8 \
--stats
Default behavior:
Use it between a REST/MCP/function call and the model when the upstream API returns much more data than the model needs.
Review an OpenAPI schema for common problems that make GPT/model actions unreliable.
gpt-action-audit python/examples/action-openapi.json
Checks include:
operationId values;JSON works with no dependencies. YAML input requires the optional yaml extra.
This auditor does not replace the platform's own schema validation. It is an earlier engineering check for action surfaces that are ambiguous, unsafe, or difficult for a model to call reliably.
Check a model-selected URL before a backend fetch.
gpt-url-check https://example.com/resource
By default it:
For server-side tools, add DNS resolution:
gpt-url-check https://example.com/resource --resolve-dns
With --resolve-dns, resolved addresses are also rejected if they are non-public.
This reduces common SSRF mistakes but is not a complete fetch sandbox. Production fetchers must also validate every redirect target, consider DNS rebinding/TOCTOU risk, apply egress controls, limit response size/time, and restrict protocols in the actual HTTP client.
Strip noisy HTML into compact text that is easier to send into retrieval or model context.
gpt-html-text python/examples/page.html \
--base-url https://example.com \
--json
It:
This is intentionally a parser, not a browser. It does not execute JavaScript, render SPAs, evaluate CSS visibility, or bypass access controls.
Make retry decisions explicitly instead of blindly retrying every failed tool call.
gpt-retry 429 --method GET --attempt 2
The helper knows common transient HTTP statuses and honors Retry-After when provided.
By default it retries only methods that are normally safe to repeat:
A POST or PATCH is not retried unless you explicitly mark the operation idempotent:
gpt-retry 503 --method POST --idempotent
The built-in exponential backoff is deterministic so it is easy to test. Distributed production systems should usually add jitter at the caller layer to avoid synchronized retries.
Remove exact duplicates from retrieval datasets after Unicode/whitespace normalization.
gpt-dedupe-jsonl python/examples/retrieval-duplicates.jsonl \
--output deduped.jsonl \
--report
Default behavior:
normalized_sha256 to retained records.Use --case-sensitive when casing is meaningful.
This performs exact normalized-text deduplication. It does not claim to detect semantically similar paraphrases; semantic dedupe needs embeddings or another similarity system and should be evaluated separately.
You can also run every tool through the package:
PYTHONPATH=python python -m gpt_tools chunk ...
PYTHONPATH=python python -m gpt_tools redact ...
PYTHONPATH=python python -m gpt_tools compact ...
PYTHONPATH=python python -m gpt_tools audit-action ...
PYTHONPATH=python python -m gpt_tools url-check ...
PYTHONPATH=python python -m gpt_tools html-text ...
PYTHONPATH=python python -m gpt_tools retry ...
PYTHONPATH=python python -m gpt_tools dedupe-jsonl ...
PYTHONPATH=python python -m unittest discover -s tests/python -p 'test_*.py'
python -m compileall -q python
The repository CI runs these tests alongside the n8n workflow validator and CLI smoke tests.
Built and maintained by Ahmad Yar as part of the Ahmad Yar Automation Lab.
The public scripts here are generic building blocks. Client credentials, private infrastructure, production customer data, and proprietary implementations are intentionally excluded.
Download counts and popularity will appear here as the collector receives them.
| Version | Published | Direct dependencies | Open version |
|---|---|---|---|
| 0.3.1 | 5 Oct 2026 | 1 |
This describes our collected data; it is not a security assessment.
Shared repository data · GitHub
Observed since 21 Oct, 09:38 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
package:6b9bac11936a26814f492be8f7411bc2f96dcd489296a3270fba9e22af468d3c