# Deploy an LLM with an AI Agent: One Prompt, One Endpoint

Published 31 October 2026, updated 7 November 2026. 5 min read. For: Developers who want an agent to stand up a private model endpoint for them.

## Key facts

- An AI agent can deploy an LLM in one prompt: plan_deploy prices every GPU the model fits on, then deploy_model rents the machine and starts the engine.
- The agent hands back an OpenAI-compatible endpoint: a base URL, an API key and the model name to call.
- plan_deploy is free and rents nothing: it returns the memory the model needs and every machine it fits on now, best value first.
- Qwen3.8-27B needs 67 GB to serve in 16-bit (one A100), 33 GB in 8-bit (one L40S) and 17 GB in 4-bit (one RTX 4090).
- A deployed model costs the hourly price of its GPU, nothing per token or per request, until you stop it or its removal time comes.

You can deploy an LLM with an AI agent in one prompt: the agent prices every GPU the model fits on, rents the best value, starts the engine and hands you an OpenAI-compatible endpoint with its own key. On Arrakis that is two MCP tools, `plan_deploy` and `deploy_model`, plus a removal time so the endpoint cannot bill forever. No Dockerfile, no engine flags, no guessing at GPU memory.

## The prompt

With the Arrakis MCP server connected (setup in [Claude Code GPU over MCP](/blog/claude-code-rent-gpu-mcp.html.md), the same for any MCP client), say what you want and how long:

> Deploy Qwen/Qwen3.8-27B for 2 hours on the best-value GPU. Tell me the hourly price first, then give me the endpoint and a curl to test it.

That is the whole job from your side.

## What the agent does

1. **`plan_deploy`** with the Hugging Face model id. Free: it rents nothing. It reads the model's size from Hugging Face and returns the GPU memory it needs and every machine it fits on now, best value first, each with its hourly price and a rough speed.
2. **It quotes you the price** of the option it would pick and waits for your go, unless you already gave it a budget.
3. **`deploy_model`** with the model, `termination_hours` and the option's `node_id` and `gpu_count`:

   ```json
   {"model": "Qwen/Qwen3.8-27B", "termination_hours": 2, "node_id": "<from the plan>", "gpu_count": 1}
   ```

4. **`get_instance`** every 30 to 60 seconds until `endpoint_ready`. The engine downloads the model first, so it answers a few minutes after the machine starts running.
5. **It hands over** `endpoint.base_url`, the `api_key` and `served_model`, with a curl you can paste.
6. **`terminate_instance`** when you are done. Or let the removal time do it.

If a call is retried, nothing doubles: the same `idempotency_key` returns the same machine.

## What this model needs

Qwen3.8-27B has 27.8 billion parameters and a 262,144-token context. From our per-model facts:

| Precision | GPU memory to serve | Smallest setup | Lowest price per GPU-hour now |
|---|---|---|---|
| 16-bit | 67 GB | one [A100](/gpus/a100.html.md) | [the live price](/gpus/a100.html.md) |
| 8-bit | 33 GB | one [L40S](/gpus/l40s.html.md) | [the live price](/gpus/l40s.html.md) |
| 4-bit | 17 GB | one [RTX 4090](/gpus/rtx-4090.html.md) | [the live price](/gpus/rtx-4090.html.md) |

The default engine, vLLM, serves the repository as published. Want the 4-bit price? Point the agent at a GGUF repository with engine `llamacpp` and the quantization after a colon (`owner/repo:Q4_K_M`). More on this model: [Qwen3.8-27B GPU requirements](/models/qwen/qwen3.8-27b.html.md).

## Test it

The endpoint speaks the OpenAI API, so curl or any OpenAI client works. The model name in a request is the Hugging Face id:

```sh
curl http://<address>/v1/chat/completions \
  -H "Authorization: Bearer sk-..." -H "Content-Type: application/json" \
  -d '{"model": "Qwen/Qwen3.8-27B", "messages": [{"role": "user", "content": "Hello"}]}'
```

```python
from openai import OpenAI

client = OpenAI(base_url="http://<address>/v1", api_key="sk-...")
reply = client.chat.completions.create(
    model="Qwen/Qwen3.8-27B",
    messages=[{"role": "user", "content": "Summarize this ticket in one line: ..."}],
)
print(reply.choices[0].message.content)
```

Swap the base URL, key and model name into code that already calls an OpenAI-style API, and it runs against your own GPU.

## When the plan does not go to plan

The agent handles the usual snags without you, as long as it knows the rules:

- **Nothing fits right now.** `plan_deploy` returns no options when nothing listed holds the model. The fix is a smaller or quantized version (`owner/repo:Q4_K_M` with engine `llamacpp`), or asking again later.
- **The price moved.** Pass `max_price_per_gpu_hour` with the price the agent quoted you. If the live price is higher, nothing is rented and the error gives the new price, so the agent comes back to you instead of paying more.
- **A gated model.** Without `hf_token` the engine cannot download it. Give the agent a read-only token for that one deploy.
- **The engine will not start.** The machine stays up so you can fix it. `GET /v1/instances/{id}/endpoint/log` returns the end of the engine's log, and over SSH `arrakis-serve status` and `arrakis-serve logs` show the same.

## Pick the engine, keep your flags

| Engine | For | Tool value |
|---|---|---|
| vLLM | Text and vision models | `vllm` (default) |
| SGLang | Text models; image and video too | `sglang` |
| vLLM-Omni | Image, video, speech and sound | `omni` |
| llama.cpp | One GGUF file at any quantization | `llamacpp` |

Tuned options of your own go in `extra_args`, pasted the way you keep them: bare flags, the whole command, or a docker run line. Arrakis reads them without a shell and hands them to the engine word for word. Shell syntax is refused, settings that choose GPUs (`NVIDIA_*`) are refused, and the address, port, key and model stay Arrakis's, so the endpoint keeps its URL. `plan_deploy` checks your options for free and returns the start line before anything is rented.

Changed your mind after it is running? Over SSH, edit `/etc/arrakis/serve/command` and run `arrakis-serve restart`. Same machine, same address, same key.

## Security, in plain terms

- **A key on every request.** A gate on port 8000 checks the endpoint's key before a request reaches the engine, which listens only inside the machine. `/health` answers without a key and says only whether the engine is up.
- **Plain HTTP.** For private traffic, tunnel it and call `http://localhost:8000/v1`:

  ```sh
  ssh root@<host> -p <port> -N -L 8000:localhost:8000
  ```

- **Your Hugging Face token** (for gated models, `hf_token`) goes to the machine only, and Arrakis keeps none. Use a fine-grained, read-only token.
- **Independent hosts.** Machines run on independent hosts who can see what runs on them. Keep regulated or confidential data off them.

## Without an agent

The same two steps over REST, with a token that has the read and rent scopes:

```sh
curl -X POST https://arrakis.goodailabs.com/v1/deploy/plan \
  -H "Authorization: Bearer $ARRAKIS_TOKEN" -H "Content-Type: application/json" \
  -d '{"model": "Qwen/Qwen3.8-27B"}'

curl -X POST https://arrakis.goodailabs.com/v1/deploy \
  -H "Authorization: Bearer $ARRAKIS_TOKEN" -H "Content-Type: application/json" \
  -d '{"model": "Qwen/Qwen3.8-27B", "termination_hours": 2, "node_id": "<from the plan>"}'
```

Or click through the console's [Models page](/console/#/models). The full reference is [Deploy a model](/docs/models.html.md).

## When this beats paying per token

You pay for the GPU by the hour, not per token, per request or per picture. Once the model is loaded there are no cold starts. You get a private copy of an open model, root SSH on the machine, and models the hosted APIs do not offer. The trade: an endpoint bills while it sits idle, which is exactly why the agent sets a removal time. Busy endpoint, hourly wins; one request a day, it does not. The break-even math is in [self-hosted LLM cost per million tokens](/blog/inference-cost-per-million-tokens.html.md).

## Ask for an endpoint, get an endpoint

Connect your agent, name a model and a number of hours, and have a private OpenAI-compatible endpoint in minutes. [See what you can deploy](/deploy.html.md).

New here? Use code [FIRST25](/console/?code=FIRST25) for $25 off your first deposit of $50 or more, until 31 December 2026.

## Rent the GPUs in this post

- [RTX 4090](/gpus/rtx-4090.html.md): [the live price](/gpus/rtx-4090.html.md) per GPU-hour now; rent in the console (/console/#/gpus?gpu_type=RTX 4090) or with the MCP tool rent_gpu.
- [L40S](/gpus/l40s.html.md): [the live price](/gpus/l40s.html.md) per GPU-hour now; rent in the console (/console/#/gpus?gpu_type=L40S) or with the MCP tool rent_gpu.
- [A100](/gpus/a100.html.md): [the live price](/gpus/a100.html.md) per GPU-hour now; rent in the console (/console/#/gpus?gpu_type=A100) or with the MCP tool rent_gpu.
- [H100](/gpus/h100.html.md): [the live price](/gpus/h100.html.md) per GPU-hour now; rent in the console (/console/#/gpus?gpu_type=H100) or with the MCP tool rent_gpu.

## Questions

**Can an AI agent deploy a model for me?** Yes. Over the Arrakis MCP server it calls plan_deploy to price every GPU the model fits on, then deploy_model to rent the machine and start the engine. It hands back a base URL, an API key and the model name to call.

**How long until the endpoint answers?** Usually a few minutes. The machine starts, then the engine downloads and loads the model; get_instance shows endpoint_ready once it answers. Large models take longer.

**Is the endpoint private?** Every request needs the endpoint's own API key, checked by a gate before it reaches the engine. Traffic is plain HTTP, so for private traffic open an SSH tunnel and call localhost.

**What does a deployed model cost?** The hourly price of the GPU it runs on, paid an hour at a time until you stop it or its removal time comes. Nothing per token or per request.

## More from the blog

- [Gemma 4 31B Self Host: One GPU, One API Call](/blog/gemma-4-31b-self-host.html.md): Self host Gemma 4 31B on one rented GPU: 75 GB in 16-bit fits an A100 80 GB, 19 GB in 4-bit fits an RTX 4090. Your own endpoint and key, by the hour.
- [Self-hosted ChatGPT: Open WebUI and Ollama on your GPU](/blog/self-hosted-chatgpt-open-webui.html.md): A self-hosted ChatGPT in minutes: Open WebUI with Ollama on a rented GPU. Pull Qwen, Gemma, gpt-oss or DeepSeek models and chat on your own machine.
- [How Much GPU Memory Do I Need? The Plain-English Answer](/blog/how-much-gpu-memory-beginners.html.md): How much GPU memory do I need? Multiply the model's billions of parameters by 2.4, 1.2 or 0.6 GB, then rent the cheapest GPU that holds the result.
- [Private LLM Deployment: Your Own Endpoint, Your Own Key](/blog/private-llm-for-enterprise.html.md): Private LLM deployment on a GPU you rent: an open model behind your own OpenAI-style endpoint and key, no shared API in the path, and the limits to know first.
- [Qwen3.8 27B GPU Requirements: One GPU Is Enough](/blog/qwen-3-8-27b-gpu-requirements.html.md): Qwen3.8 27B GPU requirements: 67 GB in 16-bit, 33 GB in 8-bit, 17 GB in 4-bit. One A100, L40S or RTX 4090 runs it. Pick the card, deploy in one call.

Every post: [/blog](/blog.html.md). RSS: [/blog/feed.xml](/blog/feed.xml).
