Skip to main content

thehallucinatedlab

The Hallucinated Lab toolkit — local-first tools you can call as ordinary Python methods.

Every tool runs on your machine. There is no API key, no account, no service to be up, and nothing is uploaded anywhere.

pip install thehallucinatedlab

Use it

from thehallucinatedlab import convert

result = convert("photo.jpg", format="png")
print(result.path, result.bytes)

Forgot what a tool takes? The argument reference lives on the website, generated from the same spec this package validates against — so the docs cannot describe an argument the code does not accept:

https://thehallucinatedlab.space/convert.html

Plain english works too

The same intent parser that powers the website's assistant ships in the package:

from thehallucinatedlab import parse

parse("convert it to webp at 80")
# {'tool': 'convert', 'args': {'format': 'webp', 'quality': 80}, 'missing': [], ...}

And from a shell:

thl tools                                    # every tool and its arguments
thl convert photo.jpg --format webp -q 80
thl "convert photo.jpg to webp at 80"

Tools

convert

Convert an image between PNG, JPEG, WebP and AVIF.

Argument Accepts Default What it does
format png | jpeg | webp | avif required Target format. Aliases like jpg are accepted.
quality int 1–100 92 Encoder quality. Ignored for PNG, which is lossless.
background hex colour #ffffff Fills transparency when the target has no alpha channel (JPEG).
convert("logo.png", format="jpeg", quality=85, background="#000000")
convert(raw_bytes, "out.webp", format="webp")   # bytes and file objects work too

Converting a transparent PNG to JPEG flattens it onto background rather than leaving black where the transparency was. AVIF needs Pillow 11.3+ or pillow-avif-plugin; if your install cannot encode a format, you get an UnsupportedFormat error rather than a file whose extension lies about its contents.

Companion projects

NexusLink Engine is reachable through the same namespace once its binding is installed:

from thehallucinatedlab import nexuslink

if nexuslink.is_available():
    ...

It is built and released separately and is not yet on PyPI, so the import raises NexusLinkNotInstalled with a pointer to the repository until it ships.

Errors

Everything deliberate inherits from THLError:

ToolNotFound · InvalidArgument · MissingArgument · UnsupportedFormat · NexusLinkNotInstalled

Licence

MIT.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

thehallucinatedlab-0.2.0.tar.gz (72.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

thehallucinatedlab-0.2.0-py3-none-any.whl (62.8 kB view details)

Uploaded Python 3

File details

Details for the file thehallucinatedlab-0.2.0.tar.gz.

File metadata

  • Download URL: thehallucinatedlab-0.2.0.tar.gz
  • Upload date:
  • Size: 72.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for thehallucinatedlab-0.2.0.tar.gz
Algorithm Hash digest
SHA256 02d0011aa0fd2dacc76a8484c6328c2855410c259ea96414ce8c19895632b965
MD5 bb9ff8a7f95ce8d642c6d6c8f9bce570
BLAKE2b-256 2e63f7c53d09cdec4fa6ebf8b9ecb9cbe9752c10caffa4f0fff6be894ed311e8

See more details on using hashes here.

Provenance

The following attestation bundles were made for thehallucinatedlab-0.2.0.tar.gz:

Publisher: release.yml on The-Hallucinated-Lab/thehallucinatedlab

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file thehallucinatedlab-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for thehallucinatedlab-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4c33662034e282e37014c455a41f17392e49df2b2625252c4f4e2b865f1eb9d3
MD5 5bc5f05573fdb6424939baccaf619c7d
BLAKE2b-256 2b04b548e51dc55814cafd5c9a01a637951bfbba05d8df131387b5e2fae66d3f

See more details on using hashes here.

Provenance

The following attestation bundles were made for thehallucinatedlab-0.2.0-py3-none-any.whl:

Publisher: release.yml on The-Hallucinated-Lab/thehallucinatedlab

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page