Prerequisites
Before you begin, verify that you have the following:- A CoreWeave account with Inference access enabled.
- A CoreWeave API access token with the Inference Admin role.
- Model weights uploaded to a CoreWeave Object Storage bucket. Dedicated Inference uses a bring-your-own-weights (BYOW) model. Download model weights from your model provider and upload them to Object Storage before starting.
curlor another HTTP client for making API requests.
Want to interact with the API programmatically? See the Inference API reference for the REST, gRPC, and Connect interfaces, or install a generated client from the Inference SDKs.
Set your API token
Set your API token as an environment variable so that subsequent commands can authenticate with the CoreWeave API. Replace[API-TOKEN] with your token. For details about creating a token, see Manage API access tokens.
Grant inference access to your bucket
Dedicated Inference reads model weights from CoreWeave Object Storage using a dedicated service account. Attach the following bucket policy to your weights bucket so the service can list and read its contents. Replace[BUCKET-NAME] with the name of the bucket containing your model weights.
inference-bucket-policy.json) and apply it with the AWS CLI. If you have configured a named AWS CLI profile for CoreWeave (for example, cw), pass it with --profile [PROFILE-NAME]. Omit --profile if your CoreWeave credentials are in the default profile.
This bucket policy for inference has the potential to override your existing permissions and bucket policy. This put-bucket-policy command is a
replace, not a merge.The
Principal value is the canonical CoreWeave Inference service account and is the same for all customers. A missing bucket policy is the most common cause of deployments that fail to load weights. For tooling alternatives (s3cmd, Boto3, Terraform), how to scope access to a specific path prefix, and notes on the Cloud Console, see Grant inference access to your bucket.Create a gateway
With the bucket policy in place, provision the gateway. A gateway provides the external endpoint that routes traffic to your model deployments. It handles authentication and load balancing. First, query the available zones so you can place the gateway in a region where Dedicated Inference capacity is offered:If the request returns
{"code":7, "message":"organization is not allowed to perform this operation"}, your organization isn’t enabled for Dedicated Inference yet. Contact your CoreWeave representative or CoreWeave support with your organization ID to request access.[ZONE-NAME] with a zone from the response. The gateway name must be a valid hostname label: letters, digits, and hyphens only, starting and ending with a letter or digit, and no more than 63 characters. Dots are not allowed. If validation fails, you receive validation error: name: must be a valid hostname label.
This example creates a gateway with CoreWeave IAM authentication and body-based routing, which routes requests based on the model field in the request body. Body-based routing is the default and follows OpenAI API conventions.
status.status and endpoints fields appear on subsequent GET requests once the gateway is provisioned.
gateway.spec.id for the next step. You need this ID to associate deployments with the gateway.
The gateway may take a few moments to become ready. You can check its status with a
GET request to /v1alpha1/inference/gateways/{id}.View all gateways
You can view all existing gateways with the following command. Use it to confirm your gateway was created correctly. Parse the output withjq to make the response more readable.
Create a deployment
A deployment configures a model serving instance with your chosen runtime, GPU type, and model weights. Attaching the deployment to the gateway you just created makes the model reachable through the gateway endpoint. First, query the available instance types and runtime versions so you can pick a GPU type and runtime that match your model:[GATEWAY-ID]: The gateway ID from the previous step (creating the gateway, or theinference/gatewayslist command).[INSTANCE-TYPE]: An instance type from theinference/deployments/parametersresponse in the previous step. For details on each type, see GPU instances.[MODEL-NAME]: A name for your model (from 4 to 63 characters). The gateway uses this name to route inference requests to this deployment.[BUCKET-NAME]: The CoreWeave Object Storage bucket containing the model weights.[MODEL-PATH]: The path within the bucket to the model directory.[ENGINE-VERSION]: Thevllmruntime version to serve your model with. Theinference/deployments/parametersresponse (above) returns the available versions.
name field ("my-first-deployment" in the example) must be a valid hostname label: letters, digits, and hyphens only, starting and ending with a letter or digit, and no more than 63 characters. Dots are not allowed. The model’s name field ([MODEL-NAME]) follows the same hostname label rule. If the deployment name fails validation, you receive validation error: name: must be a valid hostname label.
An S3 path breaks down into
[BUCKET-NAME] and [MODEL-PATH]. For example, s3://test-bucket/raw/Qwen/Qwen3.5-0.8B/2fc06364715b967f1860aea9cf38778875588b17 breaks down into:{"code":3, "message":"model path has no objects: path ..."}, the model path is invalid or inaccessible.
If you receive {"code":3, "message":"model bucket is not accessible..."}, the bucket is invalid or inaccessible.
status.status field appears when you poll the deployment with a GET request.
deployment.spec.id so subsequent commands can reference the deployment:
View all deployments
You can view all existing deployments with the following command. Use it to confirm your deployment was created correctly. Parse the output withjq to make the response more readable.
Wait for the deployment to start
After creation, the deployment loads model weights and starts the inference engine. Poll the deployment status until it reachesSTATUS_READY. This typically takes several minutes.
deployment.status.status in the response. Continue polling until you see STATUS_READY:
STATUS_READY, fails with STATUS_ERROR or STATUS_FAILED, or reaches the 15-minute timeout:
jq to parse the response. Install jq with your package manager (for example, brew install jq on macOS or apt install jq on Debian or Ubuntu).
Once the deployment is running, retrieve the gateway endpoint URL:
gateway.status.endpoints field contains an array of endpoint URLs for inference requests. The first entry is the primary endpoint:
The gateway’s public DNS record and TLS certificate provision asynchronously after the deployment reaches
STATUS_READY and can take several minutes to resolve. If your first inference request fails with an SSL handshake error or DNS resolution failure, wait a few minutes and retry.Send an inference request
With the deployment ready and the gateway endpoint exported, you can now send your first inference request to verify the end-to-end path. The gateway exposes an OpenAI-compatible API. With body-based routing, the gateway routes requests based on themodel field in the request body. Send a chat completion request using the model name from your deployment:
coreWeaveAuth.
The response is an OpenAI-compatible chat completion. Beyond the standard fields, vLLM also returns several engine-specific fields (token_ids, prompt_logprobs, kv_transfer_params, and others). These are typically null for normal requests, so you can ignore them.
openai library:
Update a deployment
Over time, you may need to adjust capacity, swap the GPU type, or point the deployment at new model weights. To change a deployment’s configuration, send aPATCH request with the complete deployment specification. All fields are required, not just the ones you change. Omitting a field either fails validation (for required fields) or reverts it to its default, so start from the command you used to create the deployment and change only the fields you want to update.
This example increases the autoscaling maximum from 1 to 4:
When you update a deployment, any patch that changes routing (for example,
model.name) forces the route to be recreated. The old route becomes unavailable immediately and stays down until the new route is ready.Observability
To view logs from your deployment:- Go to console.coreweave.com and open Grafana under the Observability section.
- In Grafana, click Explore in the left nav, then select CoreWeave Logs from the data source dropdown.
- In the query builder, click Code on the right, then enter the following query:
- Click Run query in the top-right corner to see the logs.
Clean up
When you no longer need the inference endpoint, delete the resources to stop incurring charges. You must delete deployments before their associated gateway.Next steps
You now have a working baseline: a gateway, a deployment serving a model, and a successful inference response. Explore these resources to learn more about CoreWeave Inference and to take the deployment beyond a single-replica baseline.- Gateways: Configure authentication, routing strategies, and traffic splitting.
- Models and deployments: Learn about runtime configuration, GPU selection, and deployment options.
- Scaling: Configure autoscaling and reserve GPU capacity.
- Billing: Understand pricing and optimize inference costs.
- Inference API reference: Explore the full API surface.