# iris API

{% hint style="danger" %}
These docs are outdated! Please check out <https://docs.titanml.co> for the latest information on the TitanML platform.\
\
If there's anything that's not covered there, please contact us on our [discord](https://discord.com/invite/83RmHTjZgf).
{% endhint %}

N.B. Some 'Options' are mandatory, and require flags to prevent erroneous use of permanent methods.

## <mark style="color:purple;">`iris`</mark>

**Usage**:

<pre class="language-console"><code class="lang-console"><strong>$ iris [OPTIONS] COMMAND [ARGS]...
</strong></code></pre>

**Options**:

* `--help`: Show this message and exit.

**Commands**:

* `delete`: delete objects from the TitanML Store.
* `download`: Download the titan-optimized onnx model.
* `get`: Get objects from the TitanML Store.
* `infer`: Run inference on a model.
* `login`: Login to iris.
* `logout`: Logout from iris.
* `makesafe`: Convert a non-safetensor model into a safetensor model, including for models with shared weights.
* `post`: Dispatch a job to the TitanML platform.
* `pull`: Pull the titan-optimized server docker image.
* `status`: Get the status of an experiment.
* `upload`: Upload an artefact to the TitanML Hub.
* `version`: Print the version of iris installed.

### <mark style="color:purple;">`iris delete`</mark>

Delete objects from the TitanML store.

**Usage**:

```console
$ iris delete [OPTIONS] [OBJECT]:[experiment|artefact]
```

**Arguments**:

* `[OBJECT]:[experiment|artefact]`: What type of object to delete - experiment or artefact (model/dataset). \[default: experiment]

**Options**:

* `-i, --id TEXT`: Which object to delete \[required]
* `--help`: Show this message and exit.

### <mark style="color:purple;">`iris download`</mark>

Download the titan-optimized onnx model.

**Usage**:

```console
$ iris download IMAGE
```

**Arguments**:

* `IMAGE`: The model to pull from those shown in the TitanML Hub. \[required]

### <mark style="color:purple;">`iris get`</mark>

Get objects from the TitanML Store.

**Usage**:

```console
$ iris get [OPTIONS] [OBJECT]:[experiment|artefact]
```

**Arguments**:

* `[OBJECT]:[experiment|artefact]`: What type of object to get \[default: experiment]

**Options**:

* `-i, --id TEXT`: Which object to get. If None, then all accessible objects are returned. Queries specified by `--id` are evaluated server-side.
* `-q, --query TEXT`: A [JMESPath](https://jmespath.org/) string, to filter the objects returned by the API. Evaluated client-side.
* `-h, --headers TEXT`: Headers to send with the get request. Should be provided as colon separated key value pairs: -h a:b -h c:d -> {a:b, c:d} \[default: ]
* `--help`: Show this message and exit.

### <mark style="color:purple;">`iris infer`</mark>

Creates an ML inference server on the specified port, allowing inference to be ran on input texts.

**Usage**:

```console
$ iris infer [OPTIONS]
```

**Options**:

* `--target TEXT`: The url to run the inference server on. \[default: localhost]
* `-p, --port INTEGER`: The port to run the inference server on. \[default: 8000]
* `-t, --task [sequence_classification|glue|question_answering| token_classification]`: The task to optimize the model for. \[required]
* `--use-cpu`: Whether to use the CPU. If False, the GPU will be used. Choose CPU only when the opmitized model is in CPU format (OnnxRuntime). The default will be False. (using TensorRT) \[default: False]
* `-t, --text TEXT`: The text to run inference on. In classification tasks, this is the TEXT to be classified. In question answering tasks, this is the QUESTION to be answered. \[required]
* `-c, --context TEXT`: The context in question answering tasks. Only used in question answering tasks. \[default: ]
* `--help`: Show this message and exit.

### <mark style="color:purple;">`iris login`</mark>

Login to iris.

**Usage**:

```console
$ iris login
```

### <mark style="color:purple;">`iris logout`</mark>

Logout from iris.

**Usage**:

```console
$ iris logout
```

### <mark style="color:purple;">`iris makesafe`</mark>

Convert an unsafe (`pytorch_model.bin`) model into a safetensor (`.safetensors`) model, including for models with shared weights. The outputted weights file is placed in the input model's folder, and allows the model to then be uploaded to the TitanML Store.

**Usage**:

```console
$ iris makesafe [MODEL]
```

**Arguments**:

* `[MODEL]`: The path of the model-containing folder which should be converted to safe\_tensors \[default: 'model']

### <mark style="color:purple;">`iris post`</mark>

Dispatch a job to the TitanML platform.

**Usage**:

```console
$ iris post [OPTIONS]
```

**Options**:

* `-m, --model TEXT`: The model to optimize. \[required]
* `-d, --dataset TEXT`: The dataset to optimize the model with. \[required]
* `-t, --task [sequence_classification|glue|question_answering|token_classification]`: The task to optimize the model for. \[required]
* `-n, --name TEXT`: The name to use for this job. Visible in the TitanML Hub. \[default: ]
* `-f, --file TEXT`: Load the options from a config file \[default: ]
* `-s, --short-run`: Truncates the run after 1 batch and 1 epoch. Will provide bad results, but useful to check that the model and dataset choices are valid. \[default: False]
* `-nl, --num-labels INTEGER`: Number of labels. Required for task sequence\_classification
* `-tf, --text-fields TEXT`: Text fields. Required for task sequence\_classification
* `-hn, --has-negative`: Has negative. Required for question\_answering \[default: False]
* `-ln, --label-names TEXT`: Names of token labels. Required for task token\_classification. Specify as a mapping with no spaces: `-ln 0:label1 -ln 1:label2`
* `--help`: Show this message and exit.

### <mark style="color:purple;">`iris pull`</mark>

Pull the titan-optimized server docker image.

**Usage**:

```console
$ iris pull IMAGE
```

**Arguments**:

* `IMAGE`: The model to pull from those shown in the TitanML Hub. \[required]

### <mark style="color:purple;">`iris status`</mark>

Get the status of an experiment.

**Usage**:

```console
$ iris status [OPTIONS]
```

**Options**:

* `-i, --id INTEGER`: The id of the experiment to get the status of \[required]

### <mark style="color:purple;">`iris upload`</mark>

Upload an artefact to the TitanML Hub.

**Usage**:

```console
$ iris upload [OPTIONS] SRC [NAME] [DESCRIPTION]
```

**Arguments**:

* `SRC`: The location of the artefact on disk. Should be a folder, containing either a model or a dataset. For more information on the supported formats, see [here](https://titanml.gitbook.io/iris-documentation/getting-started/iris-commands/using-iris-upload). \[required]
* `[NAME]`: The name of the artefact. Displayed in the TitanML Hub.
* `[DESCRIPTION]`: A short description of the artefact. Displayed in the TitanML Hub.

**Options**:

* `--help`: Show this message and exit.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://titanml.gitbook.io/iris-documentation/getting-started/iris-commands/iris-api.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
