> ## Documentation Index
> Fetch the complete documentation index at: https://starforge.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# sf serve

> Start, list, extend, and stop Playground inference services

See [Playground](/en/guides/playground) for the workflow walkthrough.

## sf serve start

```bash theme={"theme":{"light":"github-light","dark":"github-dark-dimmed"}}
sf serve start <MODEL> [options]
```

| Argument / Option  | Description                                                                            |
| ------------------ | -------------------------------------------------------------------------------------- |
| `MODEL` (required) | HF id / absolute path on the shared disk / `run:<run_id>` (uses that run's hf\_export) |
| `-g, --gpus`       | GPU count = tensor parallel size (default 1)                                           |
| `--ttl-hours`      | Idle TTL in hours; defaults to the server-side configuration                           |

## sf serve ls / extend / stop

```bash theme={"theme":{"light":"github-light","dark":"github-dark-dimmed"}}
sf serve ls                          # My services: status, endpoint, remaining TTL
sf serve extend <SERVE_ID> --ttl-hours 4
sf serve stop <SERVE_ID>
```

<Warning>
  Services consume real GPU quota; when the TTL expires they stop automatically and release the GPUs. For long sessions use `extend`, and `stop` as soon as you're done.
</Warning>

Services are OpenAI-compatible endpoints — the address from `sf serve ls` can be configured directly into any OpenAI SDK client.

## `sf serve`

Manage inference services

```bash theme={"theme":{"light":"github-light","dark":"github-dark-dimmed"}}
sf serve <subcommand>
```

| Command           | Description                       |
| ----------------- | --------------------------------- |
| `sf serve extend` | Extend an inference service's TTL |
| `sf serve ls`     | List my inference services        |
| `sf serve start`  | Start an inference service        |
| `sf serve stop`   | Stop an inference service         |

### `sf serve extend`

Extend an inference service's TTL

```bash theme={"theme":{"light":"github-light","dark":"github-dark-dimmed"}}
sf serve extend <RUN_ID> [options]
```

| Argument | Description  |
| -------- | ------------ |
| `RUN_ID` | **required** |

| Option              | Description                               |
| ------------------- | ----------------------------------------- |
| `--hours` `<float>` | How much longer, in hours (default `1.0`) |

### `sf serve ls`

List my inference services

```bash theme={"theme":{"light":"github-light","dark":"github-dark-dimmed"}}
sf serve ls
```

No options beyond `--help`.

### `sf serve start`

Start an inference service

```bash theme={"theme":{"light":"github-light","dark":"github-dark-dimmed"}}
sf serve start <MODEL> [options]
```

| Argument | Description                                                                   |
| -------- | ----------------------------------------------------------------------------- |
| `MODEL`  | An HF id / an absolute path on shared storage / run:\<run\_id> (**required**) |

| Option                  | Description                                             |
| ----------------------- | ------------------------------------------------------- |
| `--gpus`, `-g` `<int>`  | How many cards (the tensor-parallel size) (default `1`) |
| `--ttl-hours` `<float>` | Idle TTL in hours (default: the server setting)         |

### `sf serve stop`

Stop an inference service

```bash theme={"theme":{"light":"github-light","dark":"github-dark-dimmed"}}
sf serve stop <RUN_ID>
```

| Argument | Description  |
| -------- | ------------ |
| `RUN_ID` | **required** |

No options beyond `--help`.
