
- Create namespace
kserve-inference. - Inspect the InferenceService manifest (
qwen-model.yaml) for the Qwen model. - Apply the manifest to create the InferenceService.
- Wait until the InferenceService reports
READY=true. - Port-forward the predictor service to your local machine.
- Send an OpenAI-compatible chat completion request and inspect the response.
qwen-model.yaml creates an InferenceService named qwen-model in the kserve-inference namespace and configures a Hugging Face–format model. The manifest below shows the predictor configuration, storage URI, and resource requests/limits.
-w (watch) flag to observe status changes in real time:
Wait until
READY reports True before attempting to connect. Trying earlier can yield connection errors or model-startup failures.READY=true, confirm the predictor service exists — this is the service you’ll port-forward to:
8080 on your workstation now forwards to port 80 on the predictor service inside the cluster.
Send a chat completion request (OpenAI-compatible)
Use the OpenAI-compatible Chat Completions endpoint exposed by KServe. This request follows the OpenAI Chat Completions schema and targets the local port-forward.
- The assistant reply is located at
choices[0].message.content. - The
usageblock contains token counts (useful for tracking cost and quotas).
Lab checklist
- Verify the Qwen InferenceService reports
READY=truein thekserve-inferencenamespace. - Start a port-forward to the
qwen-model-predictorservice (local8080-> service80). - Send the curl request to
http://localhost:8080/openai/v1/chat/completionsas shown above. - Inspect
choices[0].message.contentto read the model’s reply.
- KServe docs: https://kserve.github.io/
- Hugging Face: https://huggingface.co
- Kubernetes docs: https://kubernetes.io/docs/