You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The name of the class that defines your Truss model. Note that this class must implement
11
+
at least a `predict` method.
12
+
### `model_module_dir`
13
+
(default: `model`)
14
+
15
+
Folder in the Truss where to find the model class.
16
+
### `data_dir`
17
+
(default: `data/`)
18
+
19
+
Folder where to place data files in your Truss. Note that you can access this within your model like so:
20
+
21
+
22
+
```python model/model.py
23
+
classModel:
24
+
def__init__(self, **kwargs):
25
+
data_dir = kwargs["data_dir"]
26
+
27
+
...
28
+
```
29
+
30
+
31
+
### `environment_variables`
32
+
5
33
<Warning>
6
34
Do not store secret values directly in environment variables (or anywhere in the config file). See the `secrets` arg for information on properly managing secrets.
Set any additional metadata in this catch-all field. The entire contents of the config file are available to the model at runtime, so this is a good place to store any custom information that model needs. For example, scikit-learn models include a flag here that indicates whether the model supports returning probabilities alongside predictions.
19
47
20
48
```yaml
21
49
model_metadata:
22
50
supports_predict_proba: true
23
51
```
24
-
</ParamField>
25
-
<ParamField body="model_name" type="str">
26
-
The model's name, for documentation purposes.
27
-
</ParamField>
28
-
<ParamField body="requirements" type="List[str]">
52
+
53
+
This is also where display metdata can be stored
54
+
55
+
### `requirements`
56
+
29
57
List the Python dependencies that the model depends on. The requirements should be provided in the [pip requirements file format](https://pip.pypa.io/en/stable/reference/requirements-file-format/), but as a yaml list.
30
58
31
59
We strongly recommend pinning versions in your requirements.
Specify model server runtime resources such as CPU, RAM and GPU.
69
+
70
+
### `resources`
71
+
72
+
The `resources` section is where you specify the compute resources that your model needs. This includes CPU, memory, and GPU resources.
73
+
If you need a GPU, you must also set `resources.use_gpu` to `true`.
74
+
75
+
#### `resources.cpu`
76
+
77
+
CPU resources needed, expressed as either a raw number, or "millicpus". For example, `1000m` and `1` are equivalent.
78
+
Fractional CPU amounts can be requested using millicpus. For example, `500m` is half of a CPU core.
79
+
80
+
#### `resources.memory`
81
+
82
+
CPU RAM needed, expressed as a number with units. Units acceptable include "Gi" (Gibibytes), "G" (Gigabytes), "Mi" (Mebibytes), and"M" (Megabytes). For example, `1Gi` and `1024Mi` are equivalent.
83
+
84
+
#### `resources.use_gpu`
85
+
86
+
Whether or not a GPU is required for this model.
87
+
88
+
#### `resources.accelerator`
89
+
90
+
Which GPU you would like for your instance. Available Nvidia GPUs supported in Truss include:
91
+
* T4
92
+
* L4
93
+
* A10G
94
+
* V100
95
+
* A100
96
+
97
+
Note that if you need multiple GPUs to server your model, you can use the `:` operator to request multiple
98
+
GPUs on your instance, eg:
44
99
45
100
```yaml
46
101
resources:
47
-
cpu: "3"
48
-
memory: 14Gi
49
-
use_gpu: true
50
-
accelerator: A10G
102
+
...
103
+
accelerator: A10G:2 # Requests 2 A10Gs
104
+
51
105
```
52
-
</ParamField>
53
-
<ParamField body="secrets" type="Dict[str, str]">
106
+
107
+
108
+
### `secrets`
54
109
<Warning>
55
110
This field can be used to specify the keys for such secrets and dummy default
56
111
values. ***Never store actual secret values in the config***. Dummy default
@@ -66,8 +121,8 @@ information from s3 and may need access to AWS credentials for that.
0 commit comments