Skip to main content

This is openai python client hacker, do something on the fly.

Features:

  • dumping LLM requests and responses into yaml or json tarball or files
  • cache LLM responses

Installation:

pip install openai-hacker

Usage

Add the lines into your code:

from openai_hacker import hack

hack()

available options:

  • dump_dir, str, the location to dump LLM requests and responses. if it ends with ".tar" then all contents will be dumped as a tarball. default ./llm_dump_<timestamp>.tar
  • cache_dir, str, the location to store cache files. default ~/llm_cache
  • stage, str, the prefix of dumped file names
  • suffix_completion, str, the suffix of dumped file names for openai Completion. default .yaml
  • suffix_chat, str, the suffix of dumped file names for openai ChatCompletion. default _chat.yaml
  • hack_chat, bool, hack openai ChatCompletion or not. default True
  • hack_completion, bool, hack openai Completion or note. default True

Metadata

Release files for openai-hacker 0.1.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for openai-hacker 0.1.4
File Size Uploaded Provenance Actions
openai_hacker-0.1.4.tar.gz 7.8 kB Without provenance Details for openai_hacker-0.1.4.tar.gz

Release files / openai_hacker-0.1.4.tar.gz

Download URL openai_hacker-0.1.4.tar.gz
Size 7.8 kB
Tags Source
SHA-256 checksum
How to use checksums
f8ccd268103465a00d289de945132c29d8d39e427abbbceabf7de70d32c74f0d
BLAKE2b-256 checksum
How to use checksums
c1c5e85fc73fcb8a6ed56eb711384fbcfc09ccd408ad61da0971f0311ea9f9ac
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.17

Security for openai-hacker 0.1.4

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page