config.yaml, then use the Baseten CLI to deploy and manage it.
You need a Baseten account. To call the model, use cURL or run the Python example with uv.
Set up your environment
To install the Baseten CLI and sign in:1
Install the Baseten CLI
Terminal
2
Sign in
Browser login opens a tab where you approve the device. You do not need an API key until you call the deployed model:If the browser doesn’t open, copy the URL from the terminal and approve the device there.
Terminal
Create the config
To create the project:-
Create a directory:
Terminal
-
Add a
config.yaml:config.yaml
model_metadata.tags: Marks the server as OpenAI-compatible, which enables the chat playground for this model in the dashboard.base_image.image: Uses a pinned vLLM Docker image.docker_server.start_command: Starts vLLM with the mounted weights.--served-model-namesets the model identifier in requests, and--port 8000must matchserver_port.docker_server.predict_endpoint: Sets vLLM’s/v1/chat/completionsroute as the deployment’s default request endpoint.weights: Mounts the pinned Hugging Face weights at/models/qwenthrough the Baseten Delivery Network. This model is ungated, so it doesn’t need a token.resources.accelerator: Runs inference on a single L4.runtime.predict_concurrency: Allows up to 256 concurrent requests so vLLM can batch them.
Deploy the model
From the project directory, run:Terminal
Call the model
vLLM serves an OpenAI-compatible API. Replace{model_id} with the model ID from the push output. The endpoint follows this shape:
-
Create a personal API key and export it. Browser login does not set this variable:
-
Call the endpoint. The
modelvalue must match--served-model-namein thestart_command. For the Python example,uv run --with openaiinstalls the OpenAI SDK for that run:
- Python
- cURL
call_model.py
Terminal
Choose your next learning path
Operate your model in production
- Use deployment environments to control which deployment serves production traffic.
- Configure autoscaling for your traffic patterns.
- Monitor the deployment with logs and metrics.
Customize the serving stack
- Explore model deployment examples to deploy other models and serving engines.
- Follow the vLLM recipe to tune the server and add streaming.
- Learn how to deploy custom Docker servers.
- Configure weight mounting for private repositories or cloud storage.
Add custom model logic
- Implement the Model class for preprocessing, postprocessing, or other architectures.
- Add Python dependencies required by your model code.
- Deploy and iterate as you develop locally.