Skip to content

Example: Qwen3.8-27B

This example puts a widely used open model into operation on xCloud AI, from the import to the first answer. It explains which source, which flavor, and which start parameters fit and how to find such values for other models. Then you deploy the model, either in the web app or via the management API, and make the first request. The values have been tested.

You need a project with a stored payment method and the project role Owner or User (see Roles and permissions).

The model

Qwen/Qwen3.8-27B is a language model with 27.8 billion parameters under the Apache 2.0 license. The repository is public and not gated; you don't need an access token for the import. The weights are available as safetensors in BF16, about 55.6 GB in total.

The model processes text and images and has a native context length of 262,144 tokens. Only 16 of its 64 layers use full attention; the remaining 48 make do with a fixed state per request. That's why the model needs little memory in the KV cache per token, and long contexts fit even on a part of a card. By default, it reasons before it answers (see Using the model).

Item Value
Source Hugging Face, repository Qwen/Qwen3.8-27B, revision main
Model name (example) qwen3-8-27b
Flavor b300-96g
Engine vLLM

Flavor

The weights take up about 51 GiB on the GPU. xCloud AI offers the model from b300-72g upwards. This example uses b300-96g with 89 GiB of GPU memory so that there is enough room for the KV cache besides the weights: with the start parameters below, it holds 886,440 tokens. That's enough for about three concurrent requests with full context length or many shorter ones.

Engine and start parameters

The deployment uses the vLLM engine with these start parameters:

--max-model-len 262144 --kv-cache-dtype fp8 --reasoning-parser qwen3 --max-num-seqs 64
  • --max-model-len 262144: the model's full native context length. In reasoning mode, answers get long; for demanding tasks, Qwen recommends plenty of room for the output.
  • --kv-cache-dtype fp8: stores the KV cache in FP8 and thus halves the memory per token. For this, vLLM uses an older, slightly slower attention variant on B300. Without this parameter, the KV cache holds about half as many tokens; it's still enough for one request with full context length.
  • --reasoning-parser qwen3: separates the reasoning from the answer. The reasoning is then in the reasoning_content field, the answer alone in content.
  • --max-num-seqs 64: at most 64 concurrent requests. Without this limit, vLLM plans for up to 1,024 concurrent requests at start, reserves about 50 GiB for them, and aborts with CUDA out of memory.

How to find these values

For another model, you follow the same three steps:

  1. Read the model card. The model card on Hugging Face states the format, size, context length, and architecture of the model, recommends values for generation, and refers to engine recipes in the section on serving.
  2. Adopt the engine's recipe. The vLLM recipe for Qwen3.8-27B generates a ready-made start command when you choose the hardware (B300) and variant (BF16). --reasoning-parser qwen3 comes from there. xCloud AI sets the model path, name, and port itself; parameters for multiple GPUs such as --tensor-parallel-size don't apply on a flavor with a share of a card, and this example doesn't use parameters for tool calls.
  3. Adapt to the flavor and test. Recipes assume whole cards. On a share of a card, you choose the context length and KV cache so that weights and cache fit into the GPU memory; the recipe shows its own variants for tight memory with --kv-cache-dtype fp8 and --max-num-seqs for this. Then you start the deployment and read the start log: it states the size of the KV cache (GPU KV cache size) or, if the memory isn't sufficient, CUDA out of memory with the point where it fails. This is how --max-num-seqs 64 was found.

Import and deploy

Both ways lead to the same result: an imported model qwen3-8-27b, a running deployment qwen3-8-27b, and a key for requests. What is created via the API also appears in the web app.

In the web app

In the xCloud web app, open your project and choose AI in the sidebar.

Import model

  1. On the Import models tab, click Import model
  2. Under Source, choose the Hugging Face tile
  3. Enter Qwen/Qwen3.8-27B as the Repository and leave Revision and Access token empty
  4. Enter qwen3-8-27b as the Model name
  5. Click Check. The Check step shows the size and monthly costs of the model storage.
  6. Click Import with obligation to pay

The model appears in the list with the status Importing. As soon as it's Ready, xCloud sends you an email.

Deploy model

  1. In the model's action menu, choose Deploy model
  2. Leave the Name at qwen3-8-27b; you'll call the model by this name later
  3. Click Next: Configuration
  4. Under Choose flavor, choose the flavor b300-96g
  5. Under Engine and start parameters, choose the engine vLLM
  6. Replace the prefilled Start parameters with:

    --max-model-len 262144 --kv-cache-dtype fp8 --reasoning-parser qwen3 --max-num-seqs 64
    
  7. Click Next: Review and check the summary

  8. Click Deploy with obligation to pay

The deployment appears with the status Setting up. After about two minutes, the list shows Running; from then on, the model answers requests. If it shows Not starting instead, open Show start log in the action menu.

Create service account

The last step of the dialog, Instructions, shows that no service account may access the new deployment yet.

  1. In the Instructions, click Create service account
  2. Enter a Name, e.g. first-test
  3. Under Access, choose the option Selected for Private models and check qwen3-8-27b
  4. Click Next: Create credentials
  5. Copy the key for requests and keep it in a safe place. It's only shown now.
  6. Click Next: Instructions and then Done

Continue with Using the model.

Via the management API

The management API needs the key for deployments of a service account with Import models: Allowed. You create this service account once in the web app (see Create a service account); you also receive its key for requests there. The examples use curl and jq:

export XCLOUD_AI_CONTROL_TOKEN='<key for deployments>'
export XCLOUD_AI_API='https://control.ai.xcloud.eu/v1'

Import model

curl -X POST "$XCLOUD_AI_API/models/import" \
  -H "Authorization: Bearer $XCLOUD_AI_CONTROL_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"name": "qwen3-8-27b", "source": "hf://Qwen/Qwen3.8-27B", "revision": "main"}'

The API responds with 202 and the model in the Verifying phase. Query the import until phase has the value Ready:

curl -s "$XCLOUD_AI_API/models/own/qwen3-8-27b" \
  -H "Authorization: Bearer $XCLOUD_AI_CONTROL_TOKEN" | jq -r .phase

Deploy model

You take a provided engine from GET /engines: image, start command, port, and default arguments. You append the start parameters to the default arguments; this way, the web app also recognizes the engine. The following script builds the deployment from this and starts it:

engine=$(curl -s "$XCLOUD_AI_API/engines" \
  -H "Authorization: Bearer $XCLOUD_AI_CONTROL_TOKEN" \
  | jq '.items[] | select(.name == "vllm")')

jq -n --argjson e "$engine" '{
  name: "qwen3-8-27b",
  model: "xcloud://models/qwen3-8-27b",
  flavor: "b300-96g",
  serving: {
    image: $e.image,
    command: $e.command,
    args: ($e.defaultArgs + ["--max-model-len", "262144", "--kv-cache-dtype", "fp8",
                             "--reasoning-parser", "qwen3", "--max-num-seqs", "64"]),
    endpoint: {port: $e.port}
  }
}' > placement.json

curl -X POST "$XCLOUD_AI_API/model-placements" \
  -H "Authorization: Bearer $XCLOUD_AI_CONTROL_TOKEN" \
  -H "Content-Type: application/json" \
  -d @placement.json

The API responds with 201. It takes about two minutes until the engine answers requests. The start log shows the progress; at the end, it reports Application startup complete:

curl -s "$XCLOUD_AI_API/model-placements/qwen3-8-27b/logs?tail=20" \
  -H "Authorization: Bearer $XCLOUD_AI_CONTROL_TOKEN"

A service account may always make requests to deployments it created itself. For the first request, you therefore use the key for requests of the same service account.

Using the model

Set the key for requests as an environment variable and make the first request. The model field contains the name of the deployment:

export OPENAI_API_KEY='<key for requests>'

curl https://ai.xcloud.eu/v1/chat/completions \
  -H "Authorization: Bearer $OPENAI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model": "qwen3-8-27b", "messages": [{"role": "user", "content": "Hello!"}]}'

The response contains the model's answer in the content field and its reasoning in the reasoning_content field; --reasoning-parser qwen3 takes care of this. Further clients, e.g. the OpenAI SDK for Python, are described in Using models.

For this model, there are some additional settings that you set per request in the chat_template_kwargs field:

  • "reasoning_effort": how thoroughly the model reasons: xhigh (default), medium, or low
  • "enable_thinking": false: the model answers directly, without reasoning.
curl https://ai.xcloud.eu/v1/chat/completions \
  -H "Authorization: Bearer $OPENAI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
        "model": "qwen3-8-27b",
        "messages": [
          {"role": "user", "content": "Explain in three sentences what a KV cache is."}
        ],
        "chat_template_kwargs": {"reasoning_effort": "low"}
      }'

Qwen recommends these values for generation:

Mode temperature top_p top_k presence_penalty
With reasoning 1.0 0.95 20 0.0
Without reasoning 0.7 0.8 20 1.5

The model ships the values for reasoning mode as its default; you don't need to specify them.

What to expect

After the start, vLLM loads the weights and prepares the engine; it takes about two minutes until the deployment answers requests. The KV cache then holds 886,440 tokens.

A single request generates about 90 tokens per second. A large part of this goes into reasoning: asked to tell something interesting about a city, the model reasoned for about 950 tokens and answered with about 180. For short questions, "reasoning_effort": "low" or "enable_thinking": false save time.

Like any language model without access to current sources, Qwen3.8-27B occasionally states facts that aren't true, in the same confident language as correct ones.

Clean up

As long as the deployment is running, it's billed; the imported model costs model storage until you delete it.

In the web app:

  1. On the Deployments tab, open the action menu of qwen3-8-27b and choose End deployment
  2. In the dialog, click End deployment
  3. If you no longer need the model, choose Delete in its action menu on the Import models tab and confirm with the model name

Via the management API:

curl -X DELETE "$XCLOUD_AI_API/model-placements/qwen3-8-27b" \
  -H "Authorization: Bearer $XCLOUD_AI_CONTROL_TOKEN"

curl -X DELETE "$XCLOUD_AI_API/models/own/qwen3-8-27b" \
  -H "Authorization: Bearer $XCLOUD_AI_CONTROL_TOKEN"