POST
/
v1
/
chat
/
completions
Create Chat Completion
curl --request POST \
  --url https://serving.app.predibase.com/tenant_id/deployments/v2/llms/deployment_name/v1/chat/completions \
  --header 'Content-Type: application/json' \
  --data '{
  "model": "alignment-handbook/zephyr-7b-dpo-lora",
  "messages": [
    {
      "role": "user",
      "content": "What is deep learning?"
    }
  ],
  "temperature": 0.5,
  "top_p": 0.95,
  "n": 2,
  "max_tokens": "20",
  "stop": [
    "photographer"
  ],
  "stream": "false",
  "adapter_source": "<string>",
  "api_token": "<string>"
}'
{
  "id": "<string>",
  "object": "<string>",
  "created": 123,
  "model": "<string>",
  "choices": [
    {
      "index": 123,
      "message": {
        "role": "<string>",
        "content": "<string>"
      },
      "finish_reason": "<string>"
    }
  ],
  "usage": {
    "prompt_tokens": 123,
    "total_tokens": 123,
    "completion_tokens": 123
  },
  "system_fingerprint": "<string>"
}

Body

application/json
model
string
Example:

"alignment-handbook/zephyr-7b-dpo-lora"

messages
object[]
temperature
number | null
default:null
Required range: x > 0
Example:

0.5

top_p
number | null
default:null
Required range: 0 < x <= 1
Example:

0.95

n
integer | null
default:null
Required range: 0 < x <= 2
Example:

2

max_tokens
integer
default:20
Required range: x > 0
stop
string[]
Maximum length: 4
Example:
["photographer"]
stream
boolean
default:false
adapter_source
string | null
api_token
string | null

Response

Generated Text

id
string
object
string
created
integer
model
string
choices
object[]
usage
object
system_fingerprint
string