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.- macOS or Linux
- Windows
Terminal
Terminal
Configure the model
Create a project directory:config.yaml in this directory:
config.yaml
Deploy the model
Run this command from the directory containingconfig.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:{model_id} with the model ID from the deployment output.
Save this code as chat.py:
chat.py
--with openai installs the SDK for this run:
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.- Open Dedicated Inference in the dashboard and select the model you created.
- Under Deployments, select the deployment you used in this example.
- Select Deactivate deployment, then Yes, deactivate.
- Wait for the deployment’s status to become Inactive.
Next steps
- Configure autoscaling to control replica counts and idle compute cost.
- Configure a model server to use your own serving container.
- Deploy a model through Explore or the Management API.