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

# Deploy a dedicated endpoint

> Deploy a catalog model on on-demand GPUs or your team's cluster, send a request, and release the GPUs.

Create a dedicated endpoint when you need GPUs reserved for your model. You can use Prime's on-demand capacity or a Model Factory cluster your team owns.

To serve trained weights, use [Deploy a training checkpoint](https://docs.primeintellect.ai/inference/checkpoint-deployments.md).

## Before you start

* For on-demand capacity, fund the personal or team wallet that owns the deployment. Review the GPU type, hourly price, and availability in the creation dialog.
* For a team catalog deployment, use a team admin account. For a team cluster, inference and self-service actions must be enabled on that cluster.
* For CLI operations, install Prime CLI 0.21.0 or later and authenticate. Your API key needs Model Factory read and write permissions, `factory:read` and `factory:write`. Requests to the deployed model need the **Inference** permission.

```bash theme={null}
uv tool install -U prime
prime login
```

On-demand deployments bill reserved GPUs per GPU-hour from the moment the endpoint reaches `RUNNING`, including time with no requests. Closing your terminal does not stop the deployment. Deployments on your team's cluster use that cluster's GPUs without an additional on-demand GPU-hour charge.

An on-demand endpoint stops automatically when the wallet that pays for it runs out of funds. Its error message says so; top up the wallet and deploy again.

## Create an endpoint in the dashboard

1. Open [Dedicated Endpoints](https://app.primeintellect.ai/dashboard/inference/dedicated), and select the personal or team account that will own the endpoint.
2. Click **Create endpoint**.
3. Select **Open weights**, then choose a model from the catalog.
4. Under **Deploy to**, select **On-demand capacity**, which lets Prime choose the cluster, or one of your team's clusters.
5. Set the deployment name and replica count. Each replica is a complete serving engine and can require several GPUs.
6. Review the placement, GPU reservation, and projected cost, then click **Create endpoint**.

The endpoint page shows startup progress in the endpoint's status. Wait until the endpoint is running before sending requests. Available GPUs do not mean the model is already loaded. Startup can also include preparing workers and loading weights. A running endpoint also reports serving metrics and repeats the request example on its **API** tab.

## Create an endpoint with the CLI

List the deployable models:

```bash theme={null}
prime inference catalog
```

Copy a value from the **ID** column. This catalog ID selects a deployment configuration. It differs from the Hugging Face repository and the model identifier used for requests.

Create an on-demand endpoint in your selected account:

```bash theme={null}
prime inference deploy <model-catalog-id> --name my-endpoint --wait
```

For a team deployment, select the team explicitly:

```bash theme={null}
prime inference catalog --team <team-id>
prime inference deploy <model-catalog-id> --team <team-id> --name my-endpoint --wait
```

To use a team cluster, copy its ID from the catalog's **Team Clusters** table and add `--cluster`:

```bash theme={null}
prime inference deploy <model-catalog-id> \
  --team <team-id> --cluster <cluster-id> --name my-endpoint --wait
```

The command prints a deployment ID. With `--wait`, it polls until the deployment reaches `RUNNING` or a terminal state. It then prints the model identifier, endpoint, and a request example.

If the wait times out, check the existing deployment before creating another one:

```bash theme={null}
prime inference deployments get <deployment-id>
```

A timeout stops the local wait. The deployment can continue starting and later incur charges.

## Send a request

Copy `servedModelAlias` and `endpointUrl` from the deployment details:

```bash theme={null}
prime inference deployments get <deployment-id> -o json
```

Set these values in your environment. `endpointUrl` is the OpenAI-compatible base URL and is available once the deployment is `RUNNING`. It is the same Prime Inference base URL that serves shared models; the `model` field selects your deployment.

```bash theme={null}
export PRIME_API_KEY="your-api-key"
export DEPLOYMENT_BASE_URL="https://api.pinference.ai/api/v1"
export DEPLOYMENT_MODEL="<servedModelAlias>"
```

Use the returned alias exactly. The deployment name, catalog ID, and base model repository do not select your dedicated endpoint.

```bash theme={null}
prime inference chat "$DEPLOYMENT_MODEL" "Hello" --max-tokens 100
```

For a team endpoint, first select its team in CLI configuration with `prime config set-team-id`. Direct HTTP and SDK requests instead need `X-Prime-Team-ID` on each request.

For a direct HTTP request:

```bash theme={null}
curl "$DEPLOYMENT_BASE_URL/chat/completions" \
  -H "Authorization: Bearer $PRIME_API_KEY" \
  -H "Content-Type: application/json" \
  -d "{\"model\": \"$DEPLOYMENT_MODEL\", \"messages\": [{\"role\": \"user\", \"content\": \"Hello\"}]}"
```

For a team endpoint, add `-H "X-Prime-Team-ID: <team-id>"` to that command. With the OpenAI Python SDK:

```python theme={null}
import os
from openai import OpenAI

client = OpenAI(
    api_key=os.environ["PRIME_API_KEY"],
    base_url=os.environ["DEPLOYMENT_BASE_URL"],
    # For a team endpoint, add:
    # default_headers={"X-Prime-Team-ID": "<team-id>"},
)
response = client.chat.completions.create(
    model=os.environ["DEPLOYMENT_MODEL"],
    messages=[{"role": "user", "content": "Hello"}],
    max_tokens=100,
)
print(response.choices[0].message.content)
```

For a personal endpoint, use the owner's API key and omit the team header. See [deployment troubleshooting](https://docs.primeintellect.ai/inference/troubleshooting.md#dedicated-endpoint-requests-fail) if requests fail.

## Change the replica count

In the dashboard, open the running endpoint, set the count with the replica controls under **Replicas**, and click **Update**. Review the additional GPU cost when scaling up on-demand capacity.

Scale a running deployment with the CLI:

```bash theme={null}
prime inference deployments scale <deployment-id> --replicas 2
prime inference deployments get <deployment-id> -o json
```

The returned `replicas` is the desired count. Check `scaleState` while workers converge to that count. The deployment's `maxReplicas`, available GPUs, and account limits can restrict scaling.

On-demand scale-ups reserve and bill the added GPUs. To release all GPUs, delete the deployment. Scaling to zero is not supported.

## Stop serving and release the GPUs

In the dashboard, open the endpoint's actions menu, choose **Delete**, and confirm **Delete endpoint**.

List deployments, or pass `--team` to list a team's deployments:

```bash theme={null}
prime inference deployments list
prime inference deployments list --team <team-id>
```

In Prime CLI 0.21.0, omitting `--team` lists your personal deployments even when CLI configuration has a selected team.

Delete the endpoint when you finish:

```bash theme={null}
prime inference deployments delete <deployment-id>
```

Confirm the deletion. The API accepts teardown asynchronously and returns `TERMINATING`. Requests to its alias start failing as the endpoint stops serving, and its GPUs are released. Refresh the [Dedicated Endpoints page](https://app.primeintellect.ai/dashboard/inference/dedicated) to check completion. A team admin or the deployment's creator, while still a team member, can delete a team deployment.

For automation and option details, see the [CLI reference](https://docs.primeintellect.ai/cli-reference/inference-deployments.md) and [deployment API reference](https://docs.primeintellect.ai/api-reference/inference-deployments.md).
