Shows how to use the OpenAI-compatible chat completion endpoint
to run inference on a Predibase deployment.
This example assumes using Predibase; is in scope and apiKey contains your Predibase API key.
1 2 3 4 5 6 7 8 9101112131415161718
usingvarclient=newPredibaseClient(apiKey);// Send a chat completion request to a deployment.varresponse=awaitclient.Inference.ChatCompletionAsync(deploymentName:DeploymentName,request:newChatCompletionRequest{Messages=[ new ChatMessage { Role = "user", Content = "What is LoRA fine-tuning?", }, ],MaxTokens=256,Temperature=0.7f,});