Create a vLLM Managed Inference Job in the web interface
Serve a language model behind an OpenAI-compatible endpoint by creating a vLLM Managed Inference Job in the CosmicAC web interface.
Create a vLLM Managed Inference Job to serve a language model behind an OpenAI-compatible chat endpoint. The form has six sections, and you click Continue to move from one section to the next. For a description of each field in the form, see vLLM Managed Inference Job configuration.
Prerequisites
Before you start, make sure that you have the following.
- A running CosmicAC deployment. See Set up CosmicAC.
- Access to the CosmicAC web interface.
- A recommended configuration for the model. For the models that CosmicAC provides, see Recommended configuration values. To use another model, register a vLLM model. You can also add a recommended configuration.
Steps
Open the new job form
In the left navigation, click Jobs, and then click New Job.
Select the job type
In the What kind of job? section, select Managed Inference, and then click Continue.
Enter the basics
In the Basics section, enter a Job name. Use at least three lowercase letters, numbers, or hyphens.
In the Tags field, add at least one tag. To add a tag, type it, and then press Enter.
Click Continue.
Select a model
In the Model to serve section, select a vLLM model in the Model list. CosmicAC prefills the Serving configuration from the model's recommended configuration.
Name the endpoint
Under Endpoint, enter an Endpoint name. Use a name that no other Managed Inference Job in the deployment uses, including a failed job that you haven't deleted.
Below the name, Will be reachable at shows the endpoint URL.
Edit the serving configuration (optional)
If you change the recommended serving values, the job can fail.
Under Serving configuration, edit the values that you want to change. For a description of each field, see vLLM Managed Inference Job configuration.
To serve a different runtime image, update the recommended model configuration.
Set the root disk and environment variables
Under Instance resources, in the Root disk (GB) field, select a preset or enter a value.
Under Environment variables, review the prefilled variables. You can make the following changes.
- To add a variable, click Add variable, and then enter a Name and Value.
- To remove a variable, click the X beside the variable.
- To make the model weight download faster, add HF_TOKEN with a Hugging Face read token as the value.
- To serve a gated model, add HF_TOKEN with a token from a Hugging Face account that accepted the model's license. Without the token, the job fails.
For the variable names that CosmicAC reads, see vLLM serving options.
Click Continue.
Select the hardware
- In the Hardware section, select a location in the Location list.
- Select a GPU.
- Set the GPU count. Below the count, Recommended for this model shows the model's GPU count. On one node shows the most free GPUs on any single node, and In this region shows the total free GPUs in the location.
- In the CUDA / driver list, select a driver.
- Set Replicas to 1, 2, or 4. Total shows the number of GPUs that the job claims.
- Click Continue.
For more information about how replicas work, see Replicas.
Select the notification events
In the Notifications section, turn off each job lifecycle event that you don't want this job to report. CosmicAC turns on all four events by default. For more information about the events and their delivery, see Set up webhook notifications.
Click Continue.
Review and create the job
In the Review & launch section, check that the section reports Ready to create, and then click Create job. If the section reports issues, click Edit in the row that names the problem. Fix the problem, and then return to the Review & launch section.
If the form shows a Job creation warning, check the values that the warning names. A job with those values can fail to start. To create the job anyway, select Create anyway with this configuration, and then click Create job. To change which values cause a warning, see Set the job creation warnings.
Open the endpoint
In the Provisioning status dialog, click Open job. When the job's status is Active, click the Endpoint tab to view the endpoint URL. To send a request to the endpoint, follow the steps in Connect to a vLLM Managed Inference endpoint.
Help and troubleshooting
Job stuck in Creating or Starting
If a job stays in Creating or Starting, check the status of its KubeVirt virtual machine instance (VMI).
-
Find the job's container ID. The web interface doesn't show the container ID of a Managed Inference Job. Get it with the CosmicAC CLI.
-
In the left navigation, click Jobs, and then click the job.
-
On the Overview tab, in the Specification section, copy the Job ID.
-
To list the job's containers, run the following command.
cosmicac jobs detail <jobId>Replace
<jobId>with the job ID that you copied.
The output lists one container for each replica. Each container shows a Container ID. If the job has more than one replica, do steps 2 and 3 for each container.
-
-
Find the VMI for the container.
CosmicAC creates one VMI for each container and names it
<container-id>-n0. A multi-node job has one VMI per node.From a machine with
kubectlaccess to your Kubernetes cluster, run the following command.kubectl get vmi -n <namespace>Replace
<namespace>with the namespace configured inK8S_NAMESPACE. -
Check the VMI status.
-
If the VMI is not Running, inspect its events.
kubectl describe vmi <container-id>-n0 -n <namespace> -
If the VMI is Running but the job stays in Creating or Starting, cosmicac-wrk-agent-inference cannot reach cosmicac-wrk-server-k8s-nvidia. These two components connect directly, and some cluster network configurations can block the connection.
To route the connection through a relay, see Set up a relay for CosmicAC.
-
Job fails with max restarts exceeded
A job moves to Failed with the reason max restarts exceeded or container not running when the model server stops before it's ready. The reason doesn't name the cause. To find the cause, check the model server's output.
-
In the left navigation, click Jobs, and then click the job. On the Overview tab, hold the pointer over the information icon in the failed replica's row. The tooltip shows the failure reason.
-
Click the Logs tab, and then select Application and History. Find the last error that the model server wrote before it stopped.
-
Fix the cause that the error names, and then create the job again.
- If the error says that the repository is gated, accept the model's license on Hugging Face. Sign in to Hugging Face, open the model's page, and then accept the license. From the same account, create a user access token with the Read role, and then add HF_TOKEN to the job's environment variables with the token as the value.
- If the logs show that the weight download was still in progress when the model server restarted, the startup timeout is too short for the model. See Startup timeout.