# Chat with an open model

You will run an open language model on a rented GPU and chat with it. The **Ollama** template downloads the model for you when the server starts. You need an account with credit and an SSH key. If you have no key yet, [Connect with SSH](/docs/connect-ssh) shows how to make one.

## 1. Deploy the server

1. Open **Deploy**. Under **Sort by**, choose **Price, low to high**, pick a GPU with **VRAM** of 8 GB or more and select **Continue**.
2. Above the template cards, select the **Language models** filter. Select the **Ollama** card, then **Continue**.
3. On the configure step, name the server `chat-test` and under **SSH keys** select your key.
4. Under **Environment variables**, check `OLLAMA_MODEL`. The template sets it to `llama3.2:3b`, a small model that fits the smallest GPU allowed. Keep it for now.
5. Select **Continue**, check **Per hour** on the review step and select **Start my server**.

A bigger model needs more GPU memory. The [GPU memory guide](/docs/gpu-memory-guide) helps you choose.

## 2. Wait for the model

When the status is **Running**, open the server and select the **Connect** tab. Copy the SSH command and run it in a terminal, then check the model:

```bash
ollama list
```

You should see `llama3.2:3b` in the list. If the list is empty, the download is still running. Wait a minute and run the command again. The first download takes longest.

## 3. Chat in the terminal

```bash
ollama run llama3.2:3b
```

Wait for the `>>>` prompt, type a question and press Enter. Type `/bye` to leave. The model stays loaded on the GPU for a few minutes after you leave, so the next question is fast.

## 4. Chat from your own computer

On the **Connect** tab, copy the **App address**. It looks like `http://HOST:PORT`. From your own computer:

```bash
curl http://HOST:PORT/api/tags -H "Authorization: Bearer YOUR_KEY"
```

This lists the downloaded models. To ask a question:

```bash
curl http://HOST:PORT/api/chat -H "Authorization: Bearer YOUR_KEY" -d '{"model": "llama3.2:3b", "messages": [{"role": "user", "content": "Explain a GPU in one sentence."}], "stream": false}'
```

The answer is JSON with the reply in `message.content`. Ollama also offers an OpenAI-style API under `/v1`, so many chat apps can use `http://HOST:PORT/v1` as their base address.

> [!NOTE]
> Ollama has no login of its own, so the server puts an API key in front of it. On the **Connect** tab, under **API key**, press the eye button, copy the key and use it where the examples say `YOUR_KEY`. Without the key the server answers `401`.

## Prefer a chat website?

The **Open WebUI + Ollama (private chat)** template gives you a chat web page, with Ollama built in. In **Deploy**, choose **Language models**, then select the **Open WebUI + Ollama (private chat)** card, and deploy as above. The first start takes about 8 minutes while the app and the starter model download. When the server is **Running**, open the **Connect** tab and choose **Open app**. Under **Sign in with**, copy the e-mail and the password (the eye button shows it): the platform created them for this server, so you do not need SSH. To use a password of your own instead, set `WEBUI_ADMIN_PASSWORD` in **Environment variables** before you deploy.

Your chats and models are kept in `/workspace`, so they survive a stop. The page uses plain `http` and the address is open to anyone who knows it, so use a strong password and do not share the address.

## Try another model

Download any model from the Ollama library, then run it. It must fit in the GPU memory.

```bash
ollama pull MODEL_NAME
ollama run MODEL_NAME
```

Models are stored on the server's disk, in `/workspace/ollama`, so they survive a stop. To have a different model downloaded at every start, change `OLLAMA_MODEL` when you deploy.

## When you are done: stop or delete

- **Stop** the server to end the compute charge. The disk, and the models on it, are kept and still charged. After **Start**, open the **Connect** tab again, because the address can change.
- **Destroy** the server to end every charge. The models are deleted with the disk and download again next time. See [Start, stop and restart](/docs/start-stop-restart).

## Next

- [Serve a model as an API](/docs/tutorial-model-api)
- [Common mistakes and how to fix them](/docs/tutorial-common-mistakes)
