Skip to content

Commit 6e62408

Browse files
committed
Update docs
1 parent 43f5320 commit 6e62408

File tree

6 files changed

+61
-66
lines changed

6 files changed

+61
-66
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Cortex is an open source platform that takes machine learning models—trained w
1515

1616
- **Autoscaling:** Cortex automatically scales APIs to handle production workloads.
1717

18-
- **Multi framework:** Cortex supports TensorFlow, Keras, PyTorch, Scikit-learn, XGBoost, and more.
18+
- **Multi framework:** Cortex supports TensorFlow, PyTorch, scikit-learn, XGBoost, and more.
1919

2020
- **CPU / GPU support:** Cortex can run inference on CPU or GPU infrastructure.
2121

docs/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Please refer to [www.cortex.dev](https://www.cortex.dev) for documentation on the latest stable version.
1+
Please refer to [cortex.dev](https://cortex.dev) for documentation on the latest stable version.

docs/deployments/apis.md

Lines changed: 0 additions & 50 deletions
This file was deleted.

docs/deployments/predictor.md

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,54 @@
1+
# Predictor APIs
2+
3+
You can deploy models from any Python framework by implementing Cortex's Predictor interface. The interface consists of an `init()` function and a `predict()` function. The `init()` function is responsible for preparing the model for serving, downloading vocabulary files, etc. The `predict()` function is called on every request and is responsible for responding with a prediction.
4+
5+
In addition to supporting Python models via the Predictor interface, Cortex can serve the following exported model formats:
6+
7+
- [TensorFlow](tensorflow.md)
8+
- [ONNX](onnx.md)
9+
10+
## Configuration
11+
12+
```yaml
13+
- kind: api
14+
name: <string> # API name (required)
15+
endpoint: <string> # the endpoint for the API (default: /<deployment_name>/<api_name>)
16+
predictor:
17+
path: <string> # path to the predictor Python file, relative to the Cortex root (required)
18+
model: <string> # S3 path to a file or directory (e.g. s3://my-bucket/exported_model) (optional)
19+
python_path: <string> # path to the root of your Python folder that will be appended to PYTHONPATH (default: folder containing cortex.yaml)
20+
metadata: <string: value> # dictionary that can be used to configure custom values (optional)
21+
tracker:
22+
key: <string> # the JSON key in the response to track (required if the response payload is a JSON object)
23+
model_type: <string> # model type, must be "classification" or "regression" (required)
24+
compute:
25+
min_replicas: <int> # minimum number of replicas (default: 1)
26+
max_replicas: <int> # maximum number of replicas (default: 100)
27+
init_replicas: <int> # initial number of replicas (default: <min_replicas>)
28+
target_cpu_utilization: <int> # CPU utilization threshold (as a percentage) to trigger scaling (default: 80)
29+
cpu: <string | int | float> # CPU request per replica (default: 200m)
30+
gpu: <int> # GPU request per replica (default: 0)
31+
mem: <string> # memory request per replica (default: Null)
32+
```
33+
34+
### Example
35+
36+
```yaml
37+
- kind: api
38+
name: my-api
39+
predictor:
40+
path: predictor.py
41+
compute:
42+
gpu: 1
43+
```
44+
45+
## Debugging
46+
47+
You can log information about each request by adding a `?debug=true` parameter to your requests. This will print:
48+
49+
1. The raw sample
50+
2. The value after running the `predict` function
51+
152
# Predictor
253

354
A Predictor is a Python file that describes how to initialize a model and use it to make a prediction.

docs/packaging/onnx.md

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,6 @@ with open("sklearn.onnx", "wb") as f:
1818
f.write(onnx_model.SerializeToString())
1919
```
2020

21-
<!-- CORTEX_VERSION_MINOR x4 -->
22-
Here are complete examples of converting models from some of the common ML frameworks to ONNX:
23-
24-
* [XGBoost](https://colab.research.google.com/github/cortexlabs/cortex/blob/master/examples/xgboost/iris-classifier/xgboost.ipynb)
25-
2621
Upload your exported model to Amazon S3 using the AWS web console or CLI:
2722

2823
```bash

docs/summary.md

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,28 +11,27 @@
1111
## Deployments
1212

1313
* [Deployments](deployments/deployments.md)
14-
* [APIs](deployments/apis.md)
15-
* [Predictor](deployments/predictor.md)
14+
* [Predictor APIs](deployments/predictor.md)
1615
* [TensorFlow APIs](deployments/tensorflow.md)
1716
* [ONNX APIs](deployments/onnx.md)
1817
* [Request handlers](deployments/request-handlers.md)
1918
* [Autoscaling](deployments/autoscaling.md)
20-
* [Prediction Monitoring](deployments/prediction-monitoring.md)
19+
* [Prediction monitoring](deployments/prediction-monitoring.md)
2120
* [Compute](deployments/compute.md)
2221
* [CLI commands](cluster/cli.md)
23-
* [Python client](deployments/python-client.md)
2422
* [API statuses](deployments/statuses.md)
25-
26-
## Dependency management
27-
28-
* [Python packages](dependencies/python-packages.md)
29-
* [System packages](dependencies/system-packages.md)
23+
* [Python client](deployments/python-client.md)
3024

3125
## Packaging models
3226

3327
* [TensorFlow](packaging/tensorflow.md)
3428
* [ONNX](packaging/onnx.md)
3529

30+
## Dependency management
31+
32+
* [Python packages](dependencies/python-packages.md)
33+
* [System packages](dependencies/system-packages.md)
34+
3635
## Cluster management
3736

3837
* [Cluster configuration](cluster/config.md)

0 commit comments

Comments
 (0)