Skip to content

Commit

Permalink
Merge branch 'main' into feature/upgrade-pydantic
Browse files Browse the repository at this point in the history
  • Loading branch information
Gonmeso committed Mar 11, 2024
2 parents b07243d + 3d06015 commit d69db81
Show file tree
Hide file tree
Showing 40 changed files with 1,710 additions and 651 deletions.
4 changes: 2 additions & 2 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
description: Giza CLI 0.12.3
description: Giza CLI 0.14.0
---

# Giza CLI
Expand All @@ -18,7 +18,7 @@ For now it provides the following capabilities:
* Model transpilation with `transpile` using multiple frameworks, like Cairo or EZKL
* Model versioning
* Proof generation for multiple frameworks, like Orion Cairo or EZKL
* Deployment of models to the Giza Platform for verifiable inferences
* Deployment of models to the Giza Platform as an endpoint for verifiable inferences
* Workspace management to help you with Giza Actions
* Actions jumpstart with `new` command to help you get started with your actions

Expand Down
2 changes: 1 addition & 1 deletion docs/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* [Models](resources/models.md)
* [Versions](resources/versions.md)
* [Workspaces](resources/workspaces.md)
* [Deployments](resources/deployments.md)
* [Endpoints](resources/endpoints.md)

## 📚 Frameworks

Expand Down
2 changes: 1 addition & 1 deletion docs/examples/full_transpilation.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ pip install -r requirements.txt
Or:

```bash
pip install giza-cli==0.12.3 onnx==1.14.1 torch==2.1.0 torchvision==0.16.0
pip install giza-cli==0.14.0 onnx==1.14.1 torch==2.1.0 torchvision==0.16.0
```

We will use the libraries for the following purposes:
Expand Down
88 changes: 74 additions & 14 deletions docs/frameworks/cairo/deploy.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,24 @@

To deploy a model, you must first have a version of that model. If you have not yet created a version, please refer to the [versions](../../resources/versions.md) documentation.

To create a new service, users can employ the `deploy` command. This command facilitates the deployment of a machine learning service ready to accept predictions at the `/cairo_run` endpoint, providing a straightforward method for deploying and using machine learning capabilities
To create a new service, users can employ the `deploy` command. This command facilitates the deployment of a machine learning service ready to accept predictions at the `/cairo_run` endpoint, providing a straightforward method for deploying and using machine learning capabilities that can easily be consumed as and API endpoint.

```
> giza deployments deploy --model-id 1 --version-id 1 model.sierra
▰▰▰▰▰▱▱ Creating deployment!
[giza][2024-02-07 12:31:02.498] Deployment is successful ✅
[giza][2024-02-07 12:31:02.501] Deployment created with id -> 1 ✅
[giza][2024-02-07 12:31:02.502] Deployment created with endpoint URL: https://deployment-gizabrain-38-1-53427f44-dagsgas-ew.a.run.app 🎉
> giza endpoints deploy --model-id 1 --version-id 1 model.sierra
▰▰▰▰▰▱▱ Creating endpoint!
[giza][2024-02-07 12:31:02.498] Endpoint is successful ✅
[giza][2024-02-07 12:31:02.501] Endpoint created with id -> 1 ✅
[giza][2024-02-07 12:31:02.502] Endpoint created with endpoint URL: https://deployment-gizabrain-38-1-53427f44-dagsgas-ew.a.run.app 🎉
```

If a model is fully compatible the sierra file is not needed and can be deployed without using it in the command:

```
> giza deployments deploy --model-id 1 --version-id 1
▰▰▰▰▰▱▱ Creating deployment!
[giza][2024-02-07 12:31:02.498] Deployment is successful ✅
[giza][2024-02-07 12:31:02.501] Deployment created with id -> 1 ✅
[giza][2024-02-07 12:31:02.502] Deployment created with endpoint URL: https://deployment-gizabrain-38-1-53427f44-dagsgas-ew.a.run.app 🎉
> giza endpoints deploy --model-id 1 --version-id 1
▰▰▰▰▰▱▱ Creating endpoint!
[giza][2024-02-07 12:31:02.498] Endpoint is successful ✅
[giza][2024-02-07 12:31:02.501] Endpoint created with id -> 1 ✅
[giza][2024-02-07 12:31:02.502] Endpoint created with endpoint URL: https://deployment-gizabrain-38-1-53427f44-dagsgas-ew.a.run.app 🎉
```

{% hint style="danger" %}
Expand Down Expand Up @@ -55,12 +55,72 @@ There is an extra args, `job_size`, that can be used in each request to specify

Available sizes are `S`, `M`, `L,` and `XL`, each with different usage limits.

## List the proving jobs for an endpoint

To list the proving jobs for an endpoint, we can use the `list-jobs` command available for the endpoints. This command will return a list of all the proving jobs for the endpoint with the `request_id` for easier tracking.

```console
> giza endpoints list-jobs --endpoint-id 1
[giza][2024-03-06 18:13:50.485] Getting jobs from endpoint 1 ✅
[
{
"id": 1,
"job_name": "proof-20240306-979342e7",
"size": "S",
"status": "Completed",
"elapsed_time": 120.,
"created_date": "2024-03-06T16:12:31.295958",
"last_update": "2024-03-06T16:14:29.952678",
"request_id": "979342e7b94641f0a260c1997d9ccfee"
},
{
"id": 2,
"job_name": "proof-20240306-f6559749",
"size": "S",
"status": "COMPLETED",
"elapsed_time": 120.0,
"created_date": "2024-03-06T16:43:27.531250",
"last_update": "2024-03-06T16:45:17.272684",
"request_id": "f655974900d8479c9bb662a060bc1365"
}
]
```

## List the proofs for an endpoint

To list the proofs for an endpoint, we can use the `list-proofs` command available for the endpoints. This command will return a list of all the proofs for the endpoint with the `request_id` for easier tracking.

```console
> giza endpoints list-proofs --endpoint-id 1
[giza][2024-03-06 18:15:23.146] Getting proofs from endpoint 32 ✅
[
{
"id": 1,
"job_id": 1,
"metrics": {
"proving_time": 0.03023695945739746
},
"created_date": "2024-03-06T16:44:46.196186",
"request_id": "979342e7b94641f0a260c1997d9ccfee"
},
{
"id": 1,
"job_id": 2,
"metrics": {
"proving_time": 0.07637895945739746
},
"created_date": "2024-03-06T16:44:46.196186",
"request_id": "f655974900d8479c9bb662a060bc1365"
}
]
```

## Download the proof

We can download the proof using the `download-proof` command available for the deployments: 
We can download the proof using the `download-proof` command available for the endpoints: 

<pre class="language-sh"><code class="lang-sh"><strong>❯ giza deployments download-proof --model-id 1 --version-id 1 --deployment-id 1 --proof-id "b14bfbcf250b404192765d9be0811c9b"
</strong>[giza][2024-02-20 15:40:48.560] Getting proof from deployment 1 ✅
<pre class="language-sh"><code class="lang-sh"><strong>❯ giza endpoints download-proof --model-id 1 --version-id 1 --endpoint-id 1 --proof-id "b14bfbcf250b404192765d9be0811c9b"
</strong>[giza][2024-02-20 15:40:48.560] Getting proof from endpoint 1 ✅
[giza][2024-02-20 15:40:49.288] Proof downloaded to zk.proof ✅
</code></pre>

Expand Down
6 changes: 3 additions & 3 deletions docs/frameworks/cairo/prove.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Giza provides two methods for proving Orion Cairo programs: through the CLI or d

**Deploying Your Model**

After deploying your model on the Giza Platform, you will receive a URL for your deployed model. Refer to the [Deployments section](../../resources/deployments.md) for more details on deploying models.
After deploying your model on the Giza Platform, you will receive a URL for your deployed model. Refer to the [Endpoints section](../../resources/endpoints.md) for more details on deploying models.

**Running Inference**

Expand All @@ -23,15 +23,15 @@ This action will execute the inference, generate Trace and Memory files on the p
To check the status of your proof, use the following command:

```
giza deployments get-proof --model-id <MODEL_ID> --version-id <VERSION_ID> --deployment-id <DEPLOYMENT_ID> --proof-id <REQUEST_ID>
giza endpoints get-proof --model-id <MODEL_ID> --version-id <VERSION_ID> --endpoint-id <ENDPOINT_ID> --proof-id <REQUEST_ID>
```

**Downloading Your Proof**

Once the proof is ready, you can download it using:

```
giza deployments download-proof --model-id <MODEL_ID> --version-id <VERSION_ID> --deployment-id <DEPLOYMENT_ID> --proof-id <REQUEST_ID> --output-path <OUTPUT_PATH>
giza endpoints download-proof --model-id <MODEL_ID> --version-id <VERSION_ID> --endpoint-id <ENDPOINT_ID> --proof-id <REQUEST_ID> --output-path <OUTPUT_PATH>
```

{% hint style="info" %}
Expand Down
4 changes: 2 additions & 2 deletions docs/frameworks/cairo/transpile.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,15 @@ my_awesome_model

When we transpile a model we have two possibilities: a fully compatible model and a partially compatible one.&#x20;

A model is fully compatible when all the operators that the model uses are supported by the Transpiler and Orion, if this happens the model is compiled after transpilation and we save the .sierra file on behalf of the user to use later for deployment ([deployment docs](../../resources/deployments.md)). This will be shown in the output of the transpile command:
A model is fully compatible when all the operators that the model uses are supported by the Transpiler and Orion, if this happens the model is compiled after transpilation and we save the .sierra file on behalf of the user to use later for deployment ([endpoint docs](../../resources/endpoints.md)). This will be shown in the output of the transpile command:

{% code overflow="wrap" %}
```
[giza][2024-02-07 16:32:13.511] Transpilation is fully compatible. Version compiled and Sierra is saved at Giza ✅
```
{% endcode %}

If a model is partially supported, we will create a warning in the output stating that not all the operators are supported right now. If it is partially supported the Cairo code can still be modified for later compilation and deployment.&#x20;
If a model is partially supported, we will create a warning in the output stating that not all the operators are supported right now. If it is partially supported the Cairo code can still be modified for later compilation and endpoint.&#x20;

{% code overflow="wrap" %}
```
Expand Down
78 changes: 69 additions & 9 deletions docs/frameworks/ezkl/deploy.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@

To deploy a model, you must first have a version of that model. If you have not yet created a version, please refer to the [versions](../../resources/versions.md) documentation.

To create a new service, users can employ the `deploy` command. This command facilitates the deployment of a machine learning service ready to accept predictions at the `/predict` endpoint, providing a straightforward method for deploying and using machine learning capabilities. As we are using `EZKL` we need to add `--framework EZKL` (or `-f EZKL` for short) to the command:
To create a new service, users can employ the `deploy` command. This command facilitates the deployment of a machine learning service ready to accept predictions at the `/predict` endpoint, providing a straightforward method for deploying and using machine learning capabilities as an API endpoint. As we are using `EZKL` we need to add `--framework EZKL` (or `-f EZKL` for short) to the command:

{% code overflow="wrap" %}
```shell
> giza deployments deploy --model-id 1 --version-id 1 --framework EZKL
▰▰▰▰▰▱▱ Creating deployment!
[giza][2024-02-07 12:31:02.498] Deployment is successful ✅
[giza][2024-02-07 12:31:02.501] Deployment created with id -> 1 ✅
[giza][2024-02-07 12:31:02.502] Deployment created with endpoint URL: https://deployment-gizabrain-38-1-53427f44-dagsgas-ew.a.run.app 🎉
> giza endpoints deploy --model-id 1 --version-id 1 --framework EZKL
▰▰▰▰▰▱▱ Creating endpoint!
[giza][2024-02-07 12:31:02.498] Endpoint is successful ✅
[giza][2024-02-07 12:31:02.501] Endpoint created with id -> 1 ✅
[giza][2024-02-07 12:31:02.502] Endpoint created with endpoint URL: https://deployment-gizabrain-38-1-53427f44-dagsgas-ew.a.run.app 🎉
```
{% endcode %}

Expand Down Expand Up @@ -73,12 +73,72 @@ curl https://deployment-gizabrain-38-1-53427f44-dagsgas-ew.a.run.app/predict \

Available sizes are `S`, `M`, `L,` and `XL`, each with different usage limits.

## List the proving jobs for an endpoint

To list the proving jobs for an endpoint, we can use the `list-jobs` command available for the endpoints. This command will return a list of all the proving jobs for the endpoint with the `request_id` for easier tracking.

```console
giza endpoints list-jobs --endpoint-id 1
[giza][2024-03-06 18:13:50.485] Getting jobs from endpoint 1 ✅
[
{
"id": 1,
"job_name": "proof-ezkl-20240306-979342e7",
"size": "S",
"status": "Completed",
"elapsed_time": 120.,
"created_date": "2024-03-06T16:12:31.295958",
"last_update": "2024-03-06T16:14:29.952678",
"request_id": "979342e7b94641f0a260c1997d9ccfee"
},
{
"id": 2,
"job_name": "proof-ezkl-20240306-f6559749",
"size": "S",
"status": "COMPLETED",
"elapsed_time": 120.0,
"created_date": "2024-03-06T16:43:27.531250",
"last_update": "2024-03-06T16:45:17.272684",
"request_id": "f655974900d8479c9bb662a060bc1365"
}
]
```

## List the proofs for an endpoint

To list the proofs for an endpoint, we can use the `list-proofs` command available for the endpoints. This command will return a list of all the proofs for the endpoint with the `request_id` for easier tracking.

```console
giza endpoints list-proofs --endpoint-id 1
[giza][2024-03-06 18:15:23.146] Getting proofs from endpoint 1 ✅
[
{
"id": 1,
"job_id": 1,
"metrics": {
"proving_time": 0.03023695945739746
},
"created_date": "2024-03-06T16:44:46.196186",
"request_id": "979342e7b94641f0a260c1997d9ccfee"
},
{
"id": 1,
"job_id": 2,
"metrics": {
"proving_time": 0.07637895945739746
},
"created_date": "2024-03-06T16:44:46.196186",
"request_id": "f655974900d8479c9bb662a060bc1365"
}
]
```

## Download the proof

We can download the proof using the `download-proof` command available for the deployments:&#x20;
We can download the proof using the `download-proof` command available for the endpoints:&#x20;

<pre class="language-sh"><code class="lang-sh"><strong>❯ giza deployments download-proof --model-id 1 --version-id 1 --deployment-id 1 --proof-id "d0564505755944b8bef9292d980f3e27"
</strong>[giza][2024-02-20 15:40:48.560] Getting proof from deployment 1 ✅
<pre class="language-sh"><code class="lang-sh"><strong>❯ giza endpoints download-proof --proof-id "d0564505755944b8bef9292d980f3e27"
</strong>[giza][2024-02-20 15:40:48.560] Getting proof from endpoint 1 ✅
[giza][2024-02-20 15:40:49.288] Proof downloaded to zk.proof ✅
</code></pre>

Expand Down
Loading

0 comments on commit d69db81

Please sign in to comment.