> ## 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.

# Run inference

> Save an inference key and send prompts to a deployed model.

Inference means sending a model a prompt and getting an answer back. For that you need an inference key. Your normal Rivvr login can create and delete models, but it can't send prompts.

Your platform team [creates the key](https://docs.rivvr.ai/administration/inference-keys.md) and gives you two things: a key ID and a secret. The ID is safe to share. Treat the secret like a password.

## Save the key on your computer

Do this once on each computer you use:

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

Paste the secret when asked; it won't show on screen. `rivvr` saves it in your system's password store (the keychain). The saved key only works with this Rivvr URL and this project.

Don't type the secret as part of a command. Your terminal remembers every command you type, so the secret would end up in that history.

To see which keys exist in the project (secrets are never shown):

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

Automated pipelines (CI) usually have no keychain. There, use [environment variables](https://docs.rivvr.ai/configuration/ci.md#sending-prompts-in-ci).

## Send a prompt

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

The model must be running (`DEPLOY_READY`). You always choose which saved key to use with `--key-id`. If Rivvr rejects that key, the command fails. It won't try a different key.

Text you pass with `--prompt` also ends up in your terminal history. For private text, put it in a file and pass the file in instead:

```bash bash / zsh theme={"theme":{"light":"github-light","dark":"vesper"}}
rivvr model infer hello --key-id KEY_ID --prompt-stdin < prompt.txt
```

```powershell PowerShell theme={"theme":{"light":"github-light","dark":"vesper"}}
Get-Content -Raw .\prompt.txt | rivvr model infer hello --key-id KEY_ID --prompt-stdin
```

To see the address prompts are sent to:

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

`rivvr` always sends prompts to that address. You can't change it.

## Limits

| Limit | Value |
| - | - |
| Answer length | 64 tokens by default. Raise it with `--max-tokens`. |
| Time per request | 5 minutes by default. You can set `--timeout` up to `30m`. |
| Prompt size | Up to 1 MiB |
| Answer size | Up to 8 MiB |

The whole answer arrives at once when it's finished. It doesn't appear word by word.

`rivvr` doesn't retry a failed request. If your connection drops while waiting, the model may still have processed the prompt.

If something goes wrong, see [inference troubleshooting](https://docs.rivvr.ai/troubleshooting/common-issues.md#inference-fails).


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