# Submission Commands

## model

Register, update, and manage models on the network.
**Note:** State-modifying subcommands accept [transaction processing arguments](https://docs.soma.org/reference/cli/overview/#transaction-processing-arguments).

### create

Create a new model (step 1 of create-commit-reveal). Sets up economic parameters (stake, commission) and creates the staking pool. Returns the model ID for subsequent commit and reveal steps.

```
soma model create [OPTIONS]
```

| Argument | Type | Required | Description |
|----------|------|----------|-------------|
| `--architecture-version` | `u64` | No | Architecture version (auto-fetched if omitted) |
| `--stake-amount` | `SomaAmount` | No | Amount of SOMA to stake (auto-fetches minimum if omitted) |
| `--commission-rate` | `u64` | No | Commission rate in basis points (default `0`) |

```
soma model create --commission-rate 500
```

```
soma model create --stake-amount 100 --commission-rate 500
```

### commit

Commit model weights (step 2 of create-commit-reveal). Commitments are auto-computed from the weights file, embedding, and decryption key. Works on both created models (initial) and active models (update).

```
soma model commit <MODEL_ID> [OPTIONS]
```

| Argument | Type | Required | Description |
|----------|------|----------|-------------|
| `model_id` | `ObjectID` | Yes | Model object ID |
| `--weights-file` | `path` | Yes | Path to the encrypted weights file |
| `--weights-url` | `string` | Yes | URL where the encrypted weights are (or will be) hosted |
| `--embedding` | `string` | Yes | Comma-separated floats for the model embedding |
| `--decryption-key` | `Base58 (32 bytes)` | Yes | Base58-encoded AES-256 decryption key (commitment auto-computed) |

```
soma model commit 0xMODEL... \
  --weights-file ./model.bin \
  --weights-url https://storage.example.com/weights.bin \
  --embedding 0.1,0.2,0.3 \
  --decryption-key <base58-key>
```

### reveal

Reveal model weights (step 3 of create-commit-reveal). Must be called in the epoch following the commit. Works on both pending models (initial activation) and active models with a pending update.

```
soma model reveal <MODEL_ID> [OPTIONS]
```

| Argument | Type | Required | Description |
|----------|------|----------|-------------|
| `model_id` | `ObjectID` | Yes | Model object ID |
| `--decryption-key` | `Base58 (32 bytes)` | Yes | Base58-encoded AES-256 decryption key |
| `--embedding` | `string` | Yes | Comma-separated floats for the model embedding |

```
soma model reveal 0xMODEL... \
  --decryption-key <base58-key> \
  --embedding 0.1,0.2,0.3,0.4
```

### deactivate

Deactivate a model. Only the model owner can deactivate.

```
soma model deactivate <MODEL_ID>
```

| Argument | Type | Required | Description |
|----------|------|----------|-------------|
| `model_id` | `ObjectID` | Yes | Model object ID |

```
soma model deactivate 0xMODEL...
```

### info

Display model information.

```
soma model info <MODEL_ID>
```

| Argument | Type | Required | Description |
|----------|------|----------|-------------|
| `model_id` | `ObjectID` | Yes | Model object ID |

```
soma model info 0xMODEL...
```

### list

List all registered models.

```
soma model list
```

### set-commission-rate

Set the commission rate for a model.

```
soma model set-commission-rate <MODEL_ID> --commission-rate <RATE>
```

| Argument | Type | Required | Description |
|----------|------|----------|-------------|
| `model_id` | `ObjectID` | Yes | Model object ID |
| `--commission-rate` | `u16` | Yes | Commission rate in basis points (max `10000`) |

```
soma model set-commission-rate 0xMODEL... --commission-rate 500
```

### download

Download model weights via the proxy network.

```
soma model download <MODEL_ID> [OPTIONS]
```

| Argument | Type | Required | Description |
|----------|------|----------|-------------|
| `model_id` | `ObjectID` | Yes | Model object ID |
| `-o`, `--output` | `path` | No | Output file path (default: `./<model_id>.weights`) |

```
soma model download 0xMODEL...
```

```
soma model download 0xMODEL... -o ./my-model.weights
```

## target

List targets, submit data, and claim rewards.
**Note:** State-modifying subcommands accept [transaction processing arguments](https://docs.soma.org/reference/cli/overview/#transaction-processing-arguments).

### list

List targets with optional filters.

```
soma target list [OPTIONS]
```

| Argument | Type | Required | Description |
|----------|------|----------|-------------|
| `-s`, `--status` | `string` | No | Filter by status: `open`, `filled`, `claimed` |
| `-e`, `--epoch` | `u64` | No | Filter by epoch |
| `--limit` | `u64` | No | Max number of results (default `50`) |

```
soma target list
```

```
soma target list --status open --epoch 5 --limit 20
```

### info

Show target information.

```
soma target info <TARGET_ID>
```

| Argument | Type | Required | Description |
|----------|------|----------|-------------|
| `target_id` | `ObjectID` | Yes | Target object ID |

```
soma target info 0xTARGET...
```

### submit

Submit data to fill a target. Commitment, checksum, and size are auto-computed from the data file. Bond coin is auto-selected.

```
soma target submit [OPTIONS]
```

| Argument | Type | Required | Description |
|----------|------|----------|-------------|
| `--target-id` | `ObjectID` | Yes | Target to fill |
| `--data-file` | `path` | Yes | Path to the data file (commitment, checksum, size auto-computed) |
| `--data-url` | `string` | Yes | URL where data is hosted |
| `--model-id` | `ObjectID` | Yes | Model used for the submission (must be in target's model_ids) |
| `--embedding` | `string` | Yes | Comma-separated floats for the data embedding |
| `--distance-score` | `f32` | Yes | Distance score (must be ≤ target threshold) |
| `--loss-score` | `string` | Yes | Float for the loss score from model inference |

```
soma target submit \
  --target-id 0xTARGET... \
  --data-file ./data.bin \
  --data-url https://storage.example.com/data.bin \
  --model-id 0xMODEL... \
  --embedding 0.1,0.2,0.3 \
  --distance-score 0.5 \
  --loss-score 0.1
```

### claim

Claim rewards from a filled target. The challenge window must be closed.

```
soma target claim <TARGET_ID>
```

| Argument | Type | Required | Description |
|----------|------|----------|-------------|
| `target_id` | `ObjectID` | Yes | Target object ID |

```
soma target claim 0xTARGET...
```

### download

Download submission data for a target.

```
soma target download <TARGET_ID> [OPTIONS]
```

| Argument | Type | Required | Description |
|----------|------|----------|-------------|
| `target_id` | `ObjectID` | Yes | Target object ID |
| `-o`, `--output` | `path` | No | Output file path |

```
soma target download 0xTARGET...
```

```
soma target download 0xTARGET... -o ./submission-data.bin
```