Skip to main content
Deploy Qwen 2.5 3B Instruct on an L4 GPU and send an inference request. The Baseten CLI submits your configuration to Engine-Builder-LLM, which compiles the model with TensorRT-LLM and creates a dedicated endpoint.

Install and sign in

You’ll need a Baseten account and uv for the Python client. This example creates billable GPU compute. Check L4 pricing before deploying.
Terminal
For other platforms or a specific version, see the Baseten CLI install reference. Sign in with the browser:
Terminal

Configure the model

Create a project directory:
Create config.yaml in this directory:
config.yaml
The configuration selects Qwen’s public weights, an L4 GPU, and FP8 quantization. Engine-Builder-LLM compiles the model using the builder GPUs, then serves it on the L4. See the engine configuration reference for these settings.

Deploy the model

Run this command from the directory containing config.yaml:
--tail shows logs; --wait waits for Active. Baseten must finish compiling and loading the model before it can answer requests. Save your model ID from the output, abc1d2ef in this example.

Call the model

Engine-based deployments serve an OpenAI-compatible API. Once the deployment becomes Active, create a personal key in API keys, or reuse one you’ve saved. Set it in the terminal where you’ll run the request:
Replace {model_id} with the model ID from the deployment output. Save this code as chat.py:
chat.py
Run it in the same terminal. --with openai installs the SDK for this run:
The response wording varies. The URL sends the request to your model’s production environment.

Clean up

Exiting the client script doesn’t stop the deployment. When you’re finished testing, deactivate the deployment to release its replicas and stop its compute charges. Its endpoint stops serving requests; the model and configuration remain available for reactivation.
  1. Open Dedicated Inference in the dashboard and select the model you created.
  2. Under Deployments, select the deployment you used in this example.
  3. Select Deactivate deployment, then Yes, deactivate.
  4. Wait for the deployment’s status to become Inactive.
See Manage the deployment lifecycle to reactivate it later.

Next steps