Black Friday: 10% off every GPU you launch, no code needed. Until 30 Nov. Rent a GPU

Arrakis / Blog / AI agents

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

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, 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 the live price
8-bit 33 GB one L40S the live price
4-bit 17 GB one RTX 4090 the live price

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.

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:

Shell
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:

    Shell
    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:

Shell
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. The full reference is Deploy a model.

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.

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.

New here? Use code FIRST25 for $25 off your first deposit of $50 or more, until 31 December 2026.

Rent the GPUs in this post

New here? Use code FIRST25 for $25 off your first deposit of $50 or more, until 31 December 2026.

Lowest price now, per GPU-hour. Billed per started hour; stop any time.

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

Every postRSS feed