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

# Pools

> Manage compute allocation

A pool records an allocation of compute time. You buy compute time into a pool with orders, and
[instances on the pool run during the scheduled time slots](https://docs.sfcompute.com/preview/guides/instances-and-pools.md).
You can also move compute between pools with [transfers](#transfers).

## Create a pool

A new pool starts with no allocation.

```bash theme={null}
sf pools create --name dev
```

## List pools

List the pools in your workspace.

```bash theme={null}
sf pools list
```

```text theme={null}
─────────────────────────────────────────────────
NAME  KIND    NODES  PERIOD  NEXT 48H
dev   market  -      -       ▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁
```

## View a pool

Get a pool by name or ID.

```bash theme={null}
sf pools get dev
```

```text theme={null}
│ POOL ID         pool_nuO4nVSM8O3NnsRE7udBe
│ NAME            dev
│ RESOURCE PATH   sfc:pool:acme:default:dev
│ KIND            market
│ CREATED         Feb 17, 5:23pm PDT
└ TOTAL SCHEDULE  Today, 5:00pm → Aug 14, 5:00pm: 1 node
```

## Allocation schedule

The allocation schedule shows how many nodes you have over time on this pool. The schedule gains
time when a buy order fills and loses time when a sell order fills.

You can create instances on a pool before it has allocation. They start running when allocation
becomes available and stop when it runs out.

The schedule is a net node count over time, not a ledger of the orders that built it. Filled buy and
sell orders each add or remove a schedule segment (see [Orders](https://docs.sfcompute.com/preview/orders.md)), but the pool
keeps only the running total at each instant. There's no stable identifier for an individual
segment: 2 fills of the same SKU and time range are indistinguishable once merged into the total. To
track which order added or removed a given block of time, keep the order's own ID.

## Mixed hardware

A single pool can hold allocation across several [SKUs](https://docs.sfcompute.com/preview/instance-skus.md). Each order
fills against whatever SKU matches its requirements, and the schedule tracks each SKU's allocation
independently. Within a SKU, nodes are interchangeable, so the schedule tracks a node count, not
which physical machine is running it.

For example, a pool might hold 100 H100 nodes in `sea-3` from 9am to 5pm today. It could hold 50
more H100 nodes in `iad-12` from 5pm today to 9am tomorrow. The SKUs do not need to overlap in time;
the schedule records what was bought and when.

Run `sf pools get dev --verbose` to see a separate schedule block per SKU in addition to the
aggregate `TOTAL SCHEDULE`.

### Buy more on an existing SKU

To add allocation to a SKU you already have, pass its ID via `--sku` on the buy order. Each
SKU has a stable ID (`sku_...`) that pins the order to exactly that SKU.

```bash theme={null}
sf orders create --side buy --pool dev --nodes 1 --start now --duration 1h \
  --max-rate 20.00 \
  --sku sku_4UpxzQw7A8N
```

Run `sf pools get dev --verbose` or `sf skus list` to find the ID.

## Transfers

Transfers move nodes between 2 pools for a specified window of time.

### Create a transfer

Specify the source pool, destination pool, time window, node count, and SKU.

```bash theme={null}
sf pools transfers create \
  --from dev \
  --to prod \
  --start-at "tomorrow" \
  --duration 7d \
  --count 4 \
  --sku sku_4UpxzQw7A8N
```

Start and end times must be on the
[allocation schedule grid](https://docs.sfcompute.com/api-reference/platform/get-platform-constants.md#response-allocation-schedule-grid).
A transfer can also start at the current time.

Omitting a required flag opens an interactive picker to help you fill in the remaining values.

Specify the full resource path if the `--from` or `--to` pool is located in a
different workspace.

```bash theme={null}
sf pools transfers create \
  --from dev \
  --to sfc:pool:acme:prod_ws:prod \
  --start-at "tomorrow" \
  --duration 7d \
  --count 4 \
  --sku sku_4UpxzQw7A8N
```

### List transfers

List the transfers in your organization.

```bash theme={null}
sf pools transfers list
```

```text theme={null}
────────────────────────────────────────────────────────────────────
ID           CREATED AT      STATUS    FROM       TO    INSTANCE SKU
pxfr_abc123  Mar 19, 4:40pm  executed  dev        prod  -
pxfr_def456  Mar 18, 9:15am  pending   dev        prod  -
pxfr_ghi789  Mar 18, 9:02am  rejected  inference  prod  -
```

Filter by pool (repeatable) or status, or pass `--verbose` for the schedule details of each
transfer.

```bash theme={null}
sf pools transfers list --pool prod --status executed
```

```text theme={null}
───────────────────────────────────────────────────────────────
ID           CREATED AT      STATUS    FROM  TO    INSTANCE SKU
pxfr_abc123  Mar 19, 4:40pm  executed  dev   prod  -
```

### Get a transfer

Get a transfer by ID.

```bash theme={null}
sf pools transfers get pxfr_abc123
```

```text theme={null}
│ TRANSFER ID   pxfr_abc123
│ STATUS        executed
│ FROM POOL     dev
│ TO POOL       prod
│ INSTANCE SKU  sea-3-h100 (sku_4UpxzQw7A8N)
│ CREATED       Mar 19, 4:40pm PDT
│
└ SCHEDULE      Mar 20, 12:00am → Mar 27, 12:00am: 4 nodes
```

### Protect instances from termination

A pool's allocation can drop below the number of running instances when a sell order fills or a
transfer leaves. When that happens,
SF Compute terminates instances until the running count matches the schedule, lowest
[priority](https://docs.sfcompute.com/preview/instances.md#instance-priority) first, newest first within a priority.

To keep specific instances running when allocation shrinks, raise their priority. The system keeps
`critical` instances over everything else.

```bash theme={null}
sf instances set gpu-worker --priority critical
```

## Extend a pool

Extending places a buy order that continues the schedule's final node count to a new end time.

```bash theme={null}
sf pools extend dev
```

For example, consider the following pool.

```bash theme={null}
sf pools get dev
```

```text theme={null}
│ POOL ID         pool_nuO4nVSM8O3NnsRE7udBe
│ NAME            dev
│ RESOURCE PATH   sfc:pool:acme:default:dev
│ KIND            market
│ CREATED         Feb 17, 5:23pm PDT
└ TOTAL SCHEDULE  Today, 5:00pm → Aug 14, 5:00pm: 2 nodes
```

Extend it by 2 hours. The prompt asks for a duration and whether to leave a standing order. It then
quotes the current rate for the extension.

```bash theme={null}
sf pools extend dev
```

```text theme={null}
  note: extending from Aug 14, 5:00pm PDT

> Duration of compute time: 2h
> Allow as standing order until filled? No

│ ACTION                  extend pool
│ POOL                    dev (pool_nuO4nVSM8O3NnsRE7udBe)
│ NODES                   2
│ EXTENDING FROM          Aug 14, 5:00pm PDT
│ EXTENDING TO            Aug 14, 7:00pm PDT
│ INSTANCE SKU            sea-3-h100 (sku_4UpxzQw7A8N)
│ RATE (PER 8X GPU NODE)  $20.00/node/hr
│ TOTAL                   $80.00
│ ESTIMATED FEE           $4.00
│ FILL                    expected to fill at this rate
│ STANDING                false
└ to be placed
> Place this order? Yes
Order ordr_HV6cjCNfgs2y9HCIOJITO filled
```

Non-interactive runs require an end time and a price cap: pass `--duration` or `--stop`, plus
`--max-rate` or `--max-price`.

Fetch the pool again; the schedule now ends 2 hours later.

```bash theme={null}
sf pools get dev
```

```text theme={null}
│ POOL ID         pool_nuO4nVSM8O3NnsRE7udBe
│ NAME            dev
│ RESOURCE PATH   sfc:pool:acme:default:dev
│ KIND            market
│ CREATED         Feb 17, 5:23pm PDT
└ TOTAL SCHEDULE  Today, 5:00pm → Aug 14, 7:00pm: 2 nodes
```

Extension requires availability during the requested window.

## Rename a pool

Renaming a pool changes its resource path but not its ID.

```bash theme={null}
sf pools set dev --name production
```

## Delete a pool

A pool must have no active orders, future allocation, non-terminated instances, procurements, or
pending transfers before you can delete it.

```bash theme={null}
sf pools delete dev
```

## API reference

See the [Pools API](https://docs.sfcompute.com/api-reference/pools/list-pools.md) for programmatic access.
