Skip to main content

zkcook

This package is designed to provide functionality that facilitates the transition from ML algorithms to ZKML. Its two main functionalities are:

  • Serialization: saving a trained ML model in a specific format to be interpretable by other programs.

  • model-complexity-reducer (mcr): Given a model and a training dataset, transform the model and the data to obtain a lighter representation that maximizes the tradeoff between performance and complexity.

It's important to note that although the main goal is the transition from ML to ZKML, mcr can be useful in other contexts, such as:

  • The model's weight needs to be minimal, for example for mobile applications.
  • Minimal inference times are required for low latency applications.
  • We want to check if we have created an overly complex model and a simpler one would give us the same performance (or even better).
  • The number of steps required to perform the inference must be less than X (as is currently constrained by the ZKML paradigm).

Installation

Install from PyPi

For the latest release:

pip install giza-zkcook

Installing from source

Clone the repository and install it with pip:

    git clone git@github.com:gizatechxyz/zkcook.git
    cd zkcook
    pip install .

Serialization

To see in more detail how this tool works, check out this tutorial.

To run it:

from giza.zkcook import serialize_model

serialize_model(YOUR_TRAINED_MODEL, "OUTPUT_PATH/MODEL_NAME.json")

mcr

To see in more detail how this tool works, check out this tutorial.

To run it:

model, transformer = mcr(model = MY_MODEL,
                         X_train = X_train,
                         y_train = y_train,
                         X_eval = X_test,
                         y_eval = y_test,
                         eval_metric = 'rmse',
                         transform_features = True)

Supported Models

Model status
XGBRegressor ✅
XGBClassifier ✅
LGBMRegressor ✅
LGBMClassifier ✅
Logistic Regression ⏳
GARCH ⏳

Metadata

Release files for giza-zkcook 0.2.2

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

Source distribution (sdist)

Source distribution for giza-zkcook 0.2.2
File Size Uploaded Provenance Actions
giza_zkcook-0.2.2.tar.gz 12.7 kB Without provenance Details for giza_zkcook-0.2.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for giza-zkcook 0.2.2
File Interpreter ABI Platform Actions
giza_zkcook-0.2.2-py3-none-any.whl Python 3 none any Details for giza_zkcook-0.2.2-py3-none-any.whl

Total release size: 29.7 kB

Release files / giza_zkcook-0.2.2.tar.gz

Download URL giza_zkcook-0.2.2.tar.gz
Size 12.7 kB
Tags Source
SHA-256 checksum
How to use checksums
6c55838d0dbdbdac7b156eaf2ee016b319ea5a1de9c474ebb3a710d7541d5f6f
BLAKE2b-256 checksum
How to use checksums
79821d80a319432ac446620baea2df7cd3f04d28c40e60fdcda9ba6ef5e9f0ab
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.12.3

Release files / giza_zkcook-0.2.2-py3-none-any.whl

Download URL giza_zkcook-0.2.2-py3-none-any.whl
Size 17.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
fe079ad8795bc232db89be29664b157668d06b022cff457a2e9ed04e1fe4f3fd
BLAKE2b-256 checksum
How to use checksums
35366e2f1243693ad2cd2bef9c1593623cc2b725e4eda3fedda4513a69c14aa3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.12.3

Security for giza-zkcook 0.2.2

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.

Release history Release notifications | RSS feed

This release

0.2.2 This release

2 release files No provenance

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