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 image_convert

result = image_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/image-converter.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': 'image_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

image_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).
image_convert("logo.png", format="jpeg", quality=85, background="#000000")
image_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.1.0.tar.gz (20.5 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.1.0-py3-none-any.whl (19.8 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for thehallucinatedlab-0.1.0.tar.gz
Algorithm Hash digest
SHA256 16a4d4857b4c8c635751a2e7a61353904257b041b65e4cf79e06187d8b97b453
MD5 f7e0668178e18d1cfb72dc3c7c1c9ebd
BLAKE2b-256 6512b08454fb94318916246cbfb09b6d457a549908fe12d1657b0d4a49902398

See more details on using hashes here.

Provenance

The following attestation bundles were made for thehallucinatedlab-0.1.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.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for thehallucinatedlab-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3b21c761610e31255586921a762e7cf83f56b4ff8255df0ec683d6676f1c171d
MD5 8f972d84a254c3a2558d716a6fcec08e
BLAKE2b-256 994278e47a8fc949bdc4b224278a1ca149ad8ec1722e6533c510c45da68f8696

See more details on using hashes here.

Provenance

The following attestation bundles were made for thehallucinatedlab-0.1.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