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

# Deploy your first model

> Sign in, deploy SmolLM2 from Hugging Face, and send it a prompt.

In this guide you'll start a small model called [SmolLM2-135M-Instruct](https://huggingface.co/HuggingFaceTB/SmolLM2-135M-Instruct) and ask it a question. It's tiny (135 million parameters), so it starts quickly and costs little. That makes it a good first test.

## Before you start

You need:

* `rivvr` [installed](https://docs.rivvr.ai/get-started/installation.md).
* A connection to your company network, or the company VPN turned on.
* These from your platform team:
  * the Rivvr URL,
  * your username and password,
  * the name of your project,
  * the name of a cluster in that project with the status `ACTIVE`,
  * how much your model may cost per hour,
  * an inference key: an ID and a secret.
* Hugging Face access [turned on for your project](https://docs.rivvr.ai/administration/projects.md#configure-hugging-face-access). Without it, step 3 fails. Your platform team can check this.

The examples below use the project `research`, the cluster `development`, a limit of 3 USD per hour, and `KEY_ID` for the key ID. Replace them with your own.

## 1. Sign in

```bash theme={"theme":{"light":"github-light","dark":"vesper"}}
rivvr auth login --api-url https://rivvr.customer.example --username alice
```

Use your Rivvr URL and username. Type your password when asked; it won't show on screen. `rivvr` remembers your login, so you won't need to do this again for a while.

## 2. Pick your project and cluster

```bash theme={"theme":{"light":"github-light","dark":"vesper"}}
rivvr project use research
rivvr cluster use development
```

From now on, commands use this project and cluster unless you say otherwise. If you don't know the names, `rivvr project list` shows your projects and `rivvr cluster list` shows the clusters in the project you picked.

Now check that everything is set up:

```bash theme={"theme":{"light":"github-light","dark":"vesper"}}
rivvr doctor
```

It checks your settings, your saved login, that your computer can reach the Rivvr URL, that the login works, and that you can use the project and cluster you picked. If a check fails, see [common issues](https://docs.rivvr.ai/troubleshooting/common-issues.md).

## 3. Deploy the model

```bash theme={"theme":{"light":"github-light","dark":"vesper"}}
rivvr deploy hf://HuggingFaceTB/SmolLM2-135M-Instruct --name hello --max-cost-per-hour 3 --wait
```

This one command does three things:

1. Rivvr copies the model files from Hugging Face into a new storage entry.
2. It creates a model called `hello` from those files.
3. Rivvr tests the model and starts it. Because of `--wait`, the command waits until that's finished.

While it runs you'll see messages like these. The capital-letter words are IDs, which will be long random strings in your output:

```text theme={"theme":{"light":"github-light","dark":"vesper"}}
Import job "IMPORT_ID" in project "PROJECT_ID" accepted. Waiting for Storage; Ctrl-C stops local work only.
Storage entry "STORAGE_ID" available. Creating Model "hello" in cluster "CLUSTER_ID".
Model "MODEL_ID" accepted; CP runs testing and deployment automatically. ...
Waiting for DEPLOY_READY. Ctrl-C stops waiting only; resume with rivvr model wait "MODEL_ID" --project "PROJECT_ID".
```

When the model's status reaches `DEPLOY_READY`, it's running and the command ends.

If you press Ctrl-C, or the command gives up after 30 minutes, the work keeps going on Rivvr's side. To keep waiting, copy the `rivvr model wait ...` command from the last message and run it. Don't run `deploy` again: it would copy the files a second time. More in [deployment recovery](https://docs.rivvr.ai/troubleshooting/recovery.md#deployment-interrupted).

`--max-cost-per-hour 3` means this model may spend at most 3 USD per hour on serving. It limits this model only, not the whole cluster.

## 4. Send a prompt

To send prompts you need an inference key. Your login can't do it. Save the key on your computer once:

```bash theme={"theme":{"light":"github-light","dark":"vesper"}}
rivvr inference-key store KEY_ID
```

Paste the key's secret when asked; it won't show on screen. Then ask the model something:

```bash theme={"theme":{"light":"github-light","dark":"vesper"}}
rivvr model infer hello --key-id KEY_ID --prompt "Say hello in one sentence."
```

The model's answer is printed in your terminal.

## Look around

```bash theme={"theme":{"light":"github-light","dark":"vesper"}}
rivvr model get hello              # status, settings, and errors if any
rivvr model testing-runs hello     # what happened during testing
rivvr model endpoint hello         # the address prompts are sent to
rivvr model performance hello --since 1h --step 1m   # speed over the last hour
```

A model that has only just started won't have speed numbers yet. It needs to answer some requests first.

## Clean up

When you're done, delete the model and type `y` to confirm:

```bash theme={"theme":{"light":"github-light","dark":"vesper"}}
rivvr model delete hello
```

The copied model files stay in storage, so you can use them again later.

## Next

* [Upload your own model files](https://docs.rivvr.ai/guides/storage.md#upload-from-your-computer) or add [LoRA adapters](https://docs.rivvr.ai/guides/create-models.md#add-lora-adapters)
* [Change serving settings](https://docs.rivvr.ai/guides/create-models.md#serving-settings) such as context length
* [Let an AI assistant use Rivvr](https://docs.rivvr.ai/get-started/ai-agents.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.