Skip to main content
PUT
/
admin
/
smart-models
/
{id}
Update a smart-model policy
curl --request PUT \
  --url https://{organization_id}.platform.barndoor.ai/api/llm-gateway/admin/smart-models/{id} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "model_alias": "<string>",
  "description": "<string>",
  "enabled": true,
  "determiner_model_alias": "<string>",
  "slots": [
    {
      "model_alias": "<string>",
      "label": "<string>"
    }
  ],
  "context_breakpoints": [
    123
  ],
  "determiner_input_max_chars": 123,
  "default_slot_on_failure": 123
}
'
{
  "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "org_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "model_alias": "smart-coder",
  "enabled": true,
  "determiner_model_alias": "gpt-4o-mini",
  "slots": [
    {
      "model_alias": "<string>",
      "label": "<string>"
    }
  ],
  "context_breakpoints": [
    4000,
    32000
  ],
  "determiner_input_max_chars": 2000,
  "default_slot_on_failure": 123,
  "description": "<string>",
  "created_at": "2023-11-07T05:31:56Z",
  "updated_at": "2023-11-07T05:31:56Z"
}

Authorizations

Authorization
string
header
required

JWT obtained through Barndoor's authentication flow. Pass the token verbatim in Authorization: Bearer <token>. Use the Barndoor SDK's loginInteractive() helper to obtain a token in scripts and notebooks.

Path Parameters

id
string<uuid>
required

Body

application/json

All fields optional.

model_alias
string
description
string | null
enabled
boolean
determiner_model_alias
string
slots
object[]
context_breakpoints
integer[]
determiner_input_max_chars
integer
default_slot_on_failure
integer

Response

The updated policy

Picks one of several model aliases per request based on a determiner-model classification (e.g. send short prompts to a small model, long prompts to a larger one).

id
string<uuid>
required
org_id
string<uuid>
required
model_alias
string
required

The new alias clients call (must not collide with existing routes)

Example:

"smart-coder"

enabled
boolean
required
determiner_model_alias
string
required

The model the gateway uses to classify each request

Example:

"gpt-4o-mini"

slots
object[]
required
Minimum array length: 1
context_breakpoints
integer[]
required

Token counts at which the determiner switches between slots

Example:
[4000, 32000]
determiner_input_max_chars
integer
required
Example:

2000

default_slot_on_failure
integer
required

Slot index used when the determiner fails or times out

description
string | null
created_at
string<date-time>
updated_at
string<date-time>