Qwen2.5-7B-Instruct model on a single GPU and send an inference request to the server.
Costs
Nebius AI Cloud only charges you for running Managed Kubernetes nodes. For more details, see Pricing in Managed Service for Kubernetes. Managed Service for SkyPilot is free of charge.Prerequisites
- Make sure you are in a group that has at least the
editorrole within your tenant; for example, the defaulteditorsgroup. You can check this in the Administration → IAM section of the web console. - Install the SkyPilot CLI.
Steps
Prepare the infrastructure
Create the Managed SkyPilot server and the Managed Kubernetes cluster in the same Nebius AI Cloud project.
- In the web console, go to AI orchestration → SkyPilot. If you don’t have a Managed SkyPilot server in your project, a landing page opens.
- Click Create server. The creation page opens.
- Enter a name for the server or keep the default one.
- Click Create server.
-
Connect the SkyPilot CLI to your Managed SkyPilot server:
-
In your terminal, run:
The browser opens automatically.
- Select your Managed SkyPilot server, and click Connect.
- Follow the instructions to authenticate to Nebius AI Cloud and sign in to SkyPilot CLI.
-
In your terminal, verify that the CLI displays the following:
-
In your terminal, run:
-
Create a Managed Kubernetes cluster named
vllm-k8s-cluster, and add a GPU node group. The Managed Kubernetes cluster will provide the GPU for running the vLLM server.
Verify that SkyPilot can access your Managed Kubernetes cluster
- In the web console, go to AI orchestration → SkyPilot.
- On the Managed SkyPilot server page, click How to connect.
- In the window that opens, click the public endpoint URL. The SkyPilot dashboard opens in the browser.
-
In the SkyPilot dashboard, go to the Infra tab, and click Refresh.
The dashboard lists the Managed Kubernetes clusters available to SkyPilot, including
vllm-k8s-cluster. -
In your terminal, verify that SkyPilot can access your Managed Kubernetes cluster:
The context for
vllm-k8s-clusteris listed as enabled. For example:
Prepare the vLLM task configuration and launch the vLLM server
-
Create and enter a directory for the task configuration file:
-
In this directory, create a
vllm.yamltask configuration file. Replace<gpu_platform>with the GPU platform of your node group, such asH200:This file defines a Kubernetes workload that requests one GPU of the specified platform and starts vLLM. The container image provides vLLM versionv0.11.0and its runtime dependencies. When the task starts, vLLM downloads theQwen/Qwen2.5-7B-Instructmodel from Hugging Face Hub and serves it through an OpenAI-compatible API. -
Launch the task that starts the vLLM server:
When prompted, confirm the launch. This command creates a
vllm-inferenceSkyPilot environment in the Managed Kubernetes cluster namedvllm-k8s-clusterand runs the task defined invllm.yaml. -
Wait until the logs confirm that the SkyPilot environment was launched and the vLLM server started successfully:
You may now exit log streaming. The vLLM server continues to run.
Send an inference request
-
To ask a question, send the following request to the vLLM server:
The generated answer is in
choices[0].message.content:Response example
-
To constrain the response to a predefined set of values, ask the model to select from the provided possible answers:
The generated answer is in
choices[0].message.content:Response example
max_tokens defines the maximum number of tokens generated in the answer. temperature controls randomness; lower values such as 0.2 reduce variation between responses. For more information on the parameters, see vLLM documentation.
How to delete the created resources
Some of the created resources are chargeable. If you don’t need the resources created for this tutorial, delete them:-
Delete the SkyPilot environment:
-
Delete the Managed SkyPilot server:
- In the web console, go to AI orchestration → SkyPilot.
- On the Managed SkyPilot server page, go to the Settings tab.
- In the Danger zone section, click Delete server.
- In the window that opens, confirm the deletion.
- Delete the Managed Kubernetes cluster.