Skip to main content

Hassle-free configs, logging, and cluster management for research projects.

Project description

Haipera: Convert Python scripts to reproducible production code

Haipera Logo

License GitHub stars Open In Colab

Find the right parameters and track experiments for your model without all the boilerplate.

Join our Discord server!

What is Haipera?

Haipera is an open-source framework to take scripts and make them 'production ready'.

  • 🦥 Config files without any code. Automatically probes the source code to generate reproducible config files.
  • 🐳 Deploy on virtualenv for reproducible experiments. Takes care of all the virtual environments of your code for maximum reproducibility of experiments.
  • 🤖 Setup grid search from CLI. Use the command line to directly iterate through hyperparameters.
  • 🪵 Automatic experiment logging. Automatically generates per-experiment output folders with reproducible configs.
  • ☁️ Hosted on the Cloud (coming soon!). Run everything locally, or send your model to Haipera Cloud for parallel experimentation.

What's next for haipera?

We want to support things like logging, experiment tracking, GPU profiling, along with a central web dashboard for everything all without having to write any custom code. Let us know at info@haipera.com if you have opinions- or if you have dying problems or needs that you want us to hear! We're all ears.

Getting Started

Install haipera:

pip install haipera

On Linux, you'll have to install a venv package, like:

apt install python3.10-venv

Make sure you have a requirements.txt file where script.py or any Python script you want to run is (or alternatively, somewhere in the Git repo for the script).

Example of using haipera

In a typical project, you may set up a script like:

import numpy

num_apples = 100
apple_price = 3.0
print("# apples: ", num_apples)
print("price of an apple: ", apple_price)
price = num_apples * apple_price
print("total: ", price)

And in the same folder, you may have a requirements.txt that lists the dependencies:

numpy

This is a superficial example, but say you want to start experimenting with this code. You'll probably adjust num_apples and apple_price manually at first, but eventually you'll lose track of what changes caused the differences in the results, unless you diligently keep a lab notebook.

To properly keep track of things, you need to often make it possible to edit these variables from command line interfaces, set up a notebook, set up a JSON or YAML file to keep track of this, log the outputs in a logging service, save the outputs / configs in a separate experiment folder, etc. There's a lot of work involved in making experimentation reproducible.

Haipera is designed to solve this. With haipera you can edit variables on the fly, which you can view with:

haipera run script.py --help

When you run haipera, you can pass in arguments without ever setting up argparse:

haipera run script.py --num-apples 30

This will also invoke a build of a virtual environment to run the code in, and generate a script.toml configuration file.

You can run these generated config files directly:

haipera run script.toml

You can also set up grid searches over parameters by:

haipera run script.py --num-apples 30,60 --apple-price 1.0,2.0

Running haipera will also generate a reports folder where you run haipera from, with isolated experiment outputs in that folder.

You can then re-run existing configs reproducibly with:

haipera run reports/experiment/script.toml

Demo on Google Colab

You can also try our Google Colab version which allows you to run Haipera in the cloud. Check out our Colab demo using the following notebook: Open In Colab

More examples

See https://github.com/haipera/haipera-samples for more complex examples that you can try running haipera on.

Have issues?

Haipera is still in its early stages, so it'll likely to have bugs. We're actively developing haipera, so if you file a GitHub issue or comment in the Discord server or drop us a line at support@haipera.com we will try to resolve them ASAP!

Project details


Download files

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

Source Distribution

haipera-0.1.6.tar.gz (52.6 kB view details)

Uploaded Source

Built Distribution

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

haipera-0.1.6-py3-none-any.whl (13.9 kB view details)

Uploaded Python 3

File details

Details for the file haipera-0.1.6.tar.gz.

File metadata

  • Download URL: haipera-0.1.6.tar.gz
  • Upload date:
  • Size: 52.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.14

File hashes

Hashes for haipera-0.1.6.tar.gz
Algorithm Hash digest
SHA256 3dfc6eef54dafc0f0ef3df863c0ba5644e45504dd7f491e4044ba0a68a601cf4
MD5 a97510a8d2666c365d6431feec2088fe
BLAKE2b-256 d392c0ce94244bc5fec06f00dd5e72b5084e9485e01ef982640773c64f87c762

See more details on using hashes here.

File details

Details for the file haipera-0.1.6-py3-none-any.whl.

File metadata

  • Download URL: haipera-0.1.6-py3-none-any.whl
  • Upload date:
  • Size: 13.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.14

File hashes

Hashes for haipera-0.1.6-py3-none-any.whl
Algorithm Hash digest
SHA256 c78b03e2883db40e31de4389a4f1412ae003d1fa6036c673a91c5c26ecd02477
MD5 e811be8990fdbff15147135b82eda06d
BLAKE2b-256 bb600251662e09e45ef75b64d1a23513ae1879f91f7e67f1a10889f4326c9866

See more details on using hashes here.

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