Setup
To get started, sign into Baseten with Truss and then install the OpenAI SDK.Sign in to Baseten
Install the OpenAI SDK
Hardware
H100 × 4
Engine
vLLM (0.22.0-cu129 build)
Context
128K
Concurrency
256
Write the config
Create and move into the project directory:config.yaml and paste the following:
config.yaml
Flags
Thestart_command passes these flags to the engine. Each one controls a runtime or serving behavior:
| Flag | Value | What it does |
|---|---|---|
--trust-remote-code | (no value) | Execute model-specific Python from the checkpoint (required for many Qwen, Phi, and custom architectures). |
--max-model-len | 131072 | Maximum context length (tokens) the server accepts per request. |
--tensor-parallel-size | $GPU_COUNT | Number of GPUs to shard the model across. |
--distributed-executor-backend | mp | How vLLM coordinates tensor-parallel workers across processes. mp: Python multiprocessing (single-node default). |
--gpu-memory-utilization | 0.95 | Fraction of GPU memory vLLM may use for weights and KV cache. |
--kv-cache-dtype | fp8 | KV cache numeric precision. fp8: ~2× KV cache density with negligible quality impact on most models. |
--limit-mm-per-prompt.image | 10 | Maximum number of image inputs per prompt. |
--override-generation-config.attn_temperature_tuning | true | Sets the attn_temperature_tuning field in the model’s generation config. |
--enable-prefix-caching | (no value) | Reuse KV cache across requests that share a prefix. |
--load-format | runai_streamer | Weight loading backend. runai_streamer: Stream weights from object storage without materializing to disk. |
Deploy
Push the config to Baseten:truss push output (abcd1234 in the example). Use it wherever you see {model_id} in the next section.
Call the model
Your deployment serves an OpenAI-compatible API. Replace{model_id} with your model ID and make sure BASETEN_API_KEY is set.
Now call your deployment to run inference:
- Python
- cURL
main.py