The default LLM model is the model your project falls back to whenever an evaluator (or another feature) needs an LLM but the caller didn't pick one. You set it once per project through the SDK, and every later evaluation run uses it automatically. There's only one per project — no id to pass around.
Returns the current default for your project. If no default is
set, returns `404` — make sure your code handles that case
rather than assuming a default exists.
Sets the default if none exists, or replaces it if one does. One
call handles both cases. `updatedAt` bumps every time you call
this, even if the values are unchanged.
Any `modelParams` fields the adapter doesn't support (like
`top_k` on OpenAI) are quietly dropped before saving. The
response echoes what was actually kept — compare the response to
your request if you want to see which fields were dropped.
Your `provider` and `adapter` need to match an existing LLM API
key in your project. If they don't, the request returns `404`.
Param
Type
Required
Description
provider
string
true
The provider name as stored on your LLM API key (for example `openai-prod`, `bedrock-us-east-1`).
adapter
LlmAdapter
true
The adapter to use with the model (for example `openai`, `anthropic`, `bedrock`).
model
string
true
The model name for the chosen adapter (for example `gpt-4o-mini`, `claude-3-5-sonnet-20240620`).
modelParams
DefaultLlmModelParams | null
false
Optional. If you leave this out (or pass `null`), it's
saved as `null`. Any fields the target adapter doesn't
support are quietly dropped; the response echoes what was
kept.
Param
Type
Required
Description
provider
str
true
The provider name as stored on your LLM API key (for example `openai-prod`, `bedrock-us-east-1`).
adapter
LlmAdapter
true
The adapter to use with the model (for example `openai`, `anthropic`, `bedrock`).
model
str
true
The model name for the chosen adapter (for example `gpt-4o-mini`, `claude-3-5-sonnet-20240620`).
model_params
Optional[object]
false
Optional. If you leave this out (or pass `null`), it's
saved as `null`. Any fields the target adapter doesn't
support are quietly dropped; the response echoes what was
kept.
Param
Type
Required
Description
provider
String
true
The provider name as stored on your LLM API key (for example `openai-prod`, `bedrock-us-east-1`).
adapter
LlmAdapter
true
The adapter to use with the model (for example `openai`, `anthropic`, `bedrock`).
model
String
true
The model name for the chosen adapter (for example `gpt-4o-mini`, `claude-3-5-sonnet-20240620`).
modelParams
Object
false
Optional. If you leave this out (or pass `null`), it's
saved as `null`. Any fields the target adapter doesn't
support are quietly dropped; the response echoes what was
kept.
Param
Type
Required
Description
Provider
string
true
The provider name as stored on your LLM API key (for example `openai-prod`, `bedrock-us-east-1`).
Adapter
LlmAdapter
true
The adapter to use with the model (for example `openai`, `anthropic`, `bedrock`).
Model
string
true
The model name for the chosen adapter (for example `gpt-4o-mini`, `claude-3-5-sonnet-20240620`).
ModelParams
interface{}
false
Optional. If you leave this out (or pass `null`), it's
saved as `null`. Any fields the target adapter doesn't
support are quietly dropped; the response echoes what was
kept.
Removes the current default. Safe to call more than once — if no default is set, you get back { success: true, alreadyDeleted: true } instead of an error.
const result = await client.defaultLlmModel.delete();
Removes the default.
**Heads up:** any eval templates that relied on the default
(templates without their own `provider` and `model`) get marked
`INACTIVE` at the same time. Evaluator runs scheduled from those
templates stop firing until you either set a new default or
point each template at a specific model.
Safe to call more than once. If no default is set, the response
comes back with `alreadyDeleted: true` instead of an error —
handy for telling "you just unset it" apart from "it was
already gone" when retrying.
This method takes no parameters.
This method takes no parameters.
This method takes no parameters.
This method takes no parameters.
Clearing the default also marks any eval-template jobs that depend on it as INACTIVE. Set a new default before re-enabling those jobs.
Every step above, stitched together into one block you can copy and adapt.
// 1. Set up the clientimport { AISDK, type LlmAdapter } from '@browserstack/ai-sdk';const publicKey = process.env.AISDK_PUBLIC_KEY!;const secretKey = process.env.AISDK_SECRET_KEY!;const client = new AISDK({ publicKey, secretKey,});// 2. Per-run variablesconst provider = 'openai-prod';const adapter: LlmAdapter = 'openai';const model = 'gpt-4o-mini';// 3. Get the current defaultconst defaultLlmModel = await client.defaultLlmModel.get();// 4. Set the defaultconst updatedDefault = await client.defaultLlmModel.set({ provider, adapter, model,});// 5. Clear the defaultconst result = await client.defaultLlmModel.delete();
Returns the current default model. If no default is set, the call returns 404 (or raises in typed clients).
default_model = client.default_llm_model.get()
Returns the current default for your project. If no default is
set, returns `404` — make sure your code handles that case
rather than assuming a default exists.
Sets the default if none exists, or replaces it if one does. One
call handles both cases. `updatedAt` bumps every time you call
this, even if the values are unchanged.
Any `modelParams` fields the adapter doesn't support (like
`top_k` on OpenAI) are quietly dropped before saving. The
response echoes what was actually kept — compare the response to
your request if you want to see which fields were dropped.
Your `provider` and `adapter` need to match an existing LLM API
key in your project. If they don't, the request returns `404`.
Param
Type
Required
Description
provider
string
true
The provider name as stored on your LLM API key (for example `openai-prod`, `bedrock-us-east-1`).
adapter
LlmAdapter
true
The adapter to use with the model (for example `openai`, `anthropic`, `bedrock`).
model
string
true
The model name for the chosen adapter (for example `gpt-4o-mini`, `claude-3-5-sonnet-20240620`).
modelParams
DefaultLlmModelParams | null
false
Optional. If you leave this out (or pass `null`), it's
saved as `null`. Any fields the target adapter doesn't
support are quietly dropped; the response echoes what was
kept.
Param
Type
Required
Description
provider
str
true
The provider name as stored on your LLM API key (for example `openai-prod`, `bedrock-us-east-1`).
adapter
LlmAdapter
true
The adapter to use with the model (for example `openai`, `anthropic`, `bedrock`).
model
str
true
The model name for the chosen adapter (for example `gpt-4o-mini`, `claude-3-5-sonnet-20240620`).
model_params
Optional[object]
false
Optional. If you leave this out (or pass `null`), it's
saved as `null`. Any fields the target adapter doesn't
support are quietly dropped; the response echoes what was
kept.
Param
Type
Required
Description
provider
String
true
The provider name as stored on your LLM API key (for example `openai-prod`, `bedrock-us-east-1`).
adapter
LlmAdapter
true
The adapter to use with the model (for example `openai`, `anthropic`, `bedrock`).
model
String
true
The model name for the chosen adapter (for example `gpt-4o-mini`, `claude-3-5-sonnet-20240620`).
modelParams
Object
false
Optional. If you leave this out (or pass `null`), it's
saved as `null`. Any fields the target adapter doesn't
support are quietly dropped; the response echoes what was
kept.
Param
Type
Required
Description
Provider
string
true
The provider name as stored on your LLM API key (for example `openai-prod`, `bedrock-us-east-1`).
Adapter
LlmAdapter
true
The adapter to use with the model (for example `openai`, `anthropic`, `bedrock`).
Model
string
true
The model name for the chosen adapter (for example `gpt-4o-mini`, `claude-3-5-sonnet-20240620`).
ModelParams
interface{}
false
Optional. If you leave this out (or pass `null`), it's
saved as `null`. Any fields the target adapter doesn't
support are quietly dropped; the response echoes what was
kept.
Removes the current default. Safe to call more than once — if no default is set, you get back {"success": True, "already_deleted": True} instead of an error.
client.default_llm_model.delete()
Removes the default.
**Heads up:** any eval templates that relied on the default
(templates without their own `provider` and `model`) get marked
`INACTIVE` at the same time. Evaluator runs scheduled from those
templates stop firing until you either set a new default or
point each template at a specific model.
Safe to call more than once. If no default is set, the response
comes back with `alreadyDeleted: true` instead of an error —
handy for telling "you just unset it" apart from "it was
already gone" when retrying.
This method takes no parameters.
This method takes no parameters.
This method takes no parameters.
This method takes no parameters.
Clearing the default also marks any eval-template jobs that depend on it as INACTIVE. Set a new default before re-enabling those jobs.
Every step above, stitched together into one block you can copy and adapt.
# 1. Set up the clientimport osfrom browserstack_ai_sdk import AISDKclient = AISDK( public_key=os.environ["AISDK_PUBLIC_KEY"], secret_key=os.environ["AISDK_SECRET_KEY"],)# 2. Per-run variablesprovider = "openai-prod"adapter = "openai"model = "gpt-4o-mini"# 3. Get the current defaultdefault_model = client.default_llm_model.get()# 4. Set the defaultdefault_model = client.default_llm_model.set( provider=provider, adapter=adapter, model=model,)# 5. Clear the defaultclient.default_llm_model.delete()
Returns the current default model. If no default is set, the call throws (mapped from HTTP 404).
DefaultLlmModelConfig row = client.get();
Returns the current default for your project. If no default is
set, returns `404` — make sure your code handles that case
rather than assuming a default exists.
set() writes the default if there isn't one, and replaces it if there is. There's no separate "create" method — one call handles both cases.
SetDefaultLlmModelInput body = new SetDefaultLlmModelInput();body.provider = provider;body.adapter = adapter;body.model = model;DefaultLlmModelConfig updated = client.set(body);
Sets the default if none exists, or replaces it if one does. One
call handles both cases. `updatedAt` bumps every time you call
this, even if the values are unchanged.
Any `modelParams` fields the adapter doesn't support (like
`top_k` on OpenAI) are quietly dropped before saving. The
response echoes what was actually kept — compare the response to
your request if you want to see which fields were dropped.
Your `provider` and `adapter` need to match an existing LLM API
key in your project. If they don't, the request returns `404`.
Param
Type
Required
Description
provider
string
true
The provider name as stored on your LLM API key (for example `openai-prod`, `bedrock-us-east-1`).
adapter
LlmAdapter
true
The adapter to use with the model (for example `openai`, `anthropic`, `bedrock`).
model
string
true
The model name for the chosen adapter (for example `gpt-4o-mini`, `claude-3-5-sonnet-20240620`).
modelParams
DefaultLlmModelParams | null
false
Optional. If you leave this out (or pass `null`), it's
saved as `null`. Any fields the target adapter doesn't
support are quietly dropped; the response echoes what was
kept.
Param
Type
Required
Description
provider
str
true
The provider name as stored on your LLM API key (for example `openai-prod`, `bedrock-us-east-1`).
adapter
LlmAdapter
true
The adapter to use with the model (for example `openai`, `anthropic`, `bedrock`).
model
str
true
The model name for the chosen adapter (for example `gpt-4o-mini`, `claude-3-5-sonnet-20240620`).
model_params
Optional[object]
false
Optional. If you leave this out (or pass `null`), it's
saved as `null`. Any fields the target adapter doesn't
support are quietly dropped; the response echoes what was
kept.
Param
Type
Required
Description
provider
String
true
The provider name as stored on your LLM API key (for example `openai-prod`, `bedrock-us-east-1`).
adapter
LlmAdapter
true
The adapter to use with the model (for example `openai`, `anthropic`, `bedrock`).
model
String
true
The model name for the chosen adapter (for example `gpt-4o-mini`, `claude-3-5-sonnet-20240620`).
modelParams
Object
false
Optional. If you leave this out (or pass `null`), it's
saved as `null`. Any fields the target adapter doesn't
support are quietly dropped; the response echoes what was
kept.
Param
Type
Required
Description
Provider
string
true
The provider name as stored on your LLM API key (for example `openai-prod`, `bedrock-us-east-1`).
Adapter
LlmAdapter
true
The adapter to use with the model (for example `openai`, `anthropic`, `bedrock`).
Model
string
true
The model name for the chosen adapter (for example `gpt-4o-mini`, `claude-3-5-sonnet-20240620`).
ModelParams
interface{}
false
Optional. If you leave this out (or pass `null`), it's
saved as `null`. Any fields the target adapter doesn't
support are quietly dropped; the response echoes what was
kept.
Removes the current default. Safe to call more than once — if no default is set, the response has alreadyDeleted = true instead of throwing.
DeleteDefaultLlmModelResponse result = client.delete();
Removes the default.
**Heads up:** any eval templates that relied on the default
(templates without their own `provider` and `model`) get marked
`INACTIVE` at the same time. Evaluator runs scheduled from those
templates stop firing until you either set a new default or
point each template at a specific model.
Safe to call more than once. If no default is set, the response
comes back with `alreadyDeleted: true` instead of an error —
handy for telling "you just unset it" apart from "it was
already gone" when retrying.
This method takes no parameters.
This method takes no parameters.
This method takes no parameters.
This method takes no parameters.
Clearing the default also marks any eval-template jobs that depend on it as INACTIVE. Set a new default before re-enabling those jobs.
Every step above, stitched together into one block you can copy and adapt.
// 1. Set up the SDKimport com.browserstack.aisdk.AISDK;import com.browserstack.aisdk.clients.default_llm_model.DefaultLlmModel;import com.browserstack.aisdk.clients.default_llm_model.DefaultLlmModelConfig;import com.browserstack.aisdk.clients.default_llm_model.DeleteDefaultLlmModelResponse;import com.browserstack.aisdk.clients.default_llm_model.LlmAdapter;import com.browserstack.aisdk.clients.default_llm_model.SetDefaultLlmModelInput;AISDK sdk = AISDK.builder() .publicKey(System.getenv("BROWSERSTACK_PUBLIC_KEY")) .secretKey(System.getenv("BROWSERSTACK_SECRET_KEY")) .build();DefaultLlmModel defaultLlmModel = sdk.defaultLlmModel();// 2. Per-run variablesString provider = "openai-prod";LlmAdapter adapter = LlmAdapter.OPENAI;String model = "gpt-4o-mini";// 3. Get the current defaultDefaultLlmModelConfig row = client.get();// 4. Set the defaultSetDefaultLlmModelInput body = new SetDefaultLlmModelInput();body.provider = provider;body.adapter = adapter;body.model = model;DefaultLlmModelConfig updated = client.set(body);// 5. Clear the defaultDeleteDefaultLlmModelResponse result = client.delete();
Returns the current default model. If no default is set, the call returns an error mapped from HTTP 404.
row, err := client.Get(context.Background())
Returns the current default for your project. If no default is
set, returns `404` — make sure your code handles that case
rather than assuming a default exists.
Sets the default if none exists, or replaces it if one does. One
call handles both cases. `updatedAt` bumps every time you call
this, even if the values are unchanged.
Any `modelParams` fields the adapter doesn't support (like
`top_k` on OpenAI) are quietly dropped before saving. The
response echoes what was actually kept — compare the response to
your request if you want to see which fields were dropped.
Your `provider` and `adapter` need to match an existing LLM API
key in your project. If they don't, the request returns `404`.
Param
Type
Required
Description
provider
string
true
The provider name as stored on your LLM API key (for example `openai-prod`, `bedrock-us-east-1`).
adapter
LlmAdapter
true
The adapter to use with the model (for example `openai`, `anthropic`, `bedrock`).
model
string
true
The model name for the chosen adapter (for example `gpt-4o-mini`, `claude-3-5-sonnet-20240620`).
modelParams
DefaultLlmModelParams | null
false
Optional. If you leave this out (or pass `null`), it's
saved as `null`. Any fields the target adapter doesn't
support are quietly dropped; the response echoes what was
kept.
Param
Type
Required
Description
provider
str
true
The provider name as stored on your LLM API key (for example `openai-prod`, `bedrock-us-east-1`).
adapter
LlmAdapter
true
The adapter to use with the model (for example `openai`, `anthropic`, `bedrock`).
model
str
true
The model name for the chosen adapter (for example `gpt-4o-mini`, `claude-3-5-sonnet-20240620`).
model_params
Optional[object]
false
Optional. If you leave this out (or pass `null`), it's
saved as `null`. Any fields the target adapter doesn't
support are quietly dropped; the response echoes what was
kept.
Param
Type
Required
Description
provider
String
true
The provider name as stored on your LLM API key (for example `openai-prod`, `bedrock-us-east-1`).
adapter
LlmAdapter
true
The adapter to use with the model (for example `openai`, `anthropic`, `bedrock`).
model
String
true
The model name for the chosen adapter (for example `gpt-4o-mini`, `claude-3-5-sonnet-20240620`).
modelParams
Object
false
Optional. If you leave this out (or pass `null`), it's
saved as `null`. Any fields the target adapter doesn't
support are quietly dropped; the response echoes what was
kept.
Param
Type
Required
Description
Provider
string
true
The provider name as stored on your LLM API key (for example `openai-prod`, `bedrock-us-east-1`).
Adapter
LlmAdapter
true
The adapter to use with the model (for example `openai`, `anthropic`, `bedrock`).
Model
string
true
The model name for the chosen adapter (for example `gpt-4o-mini`, `claude-3-5-sonnet-20240620`).
ModelParams
interface{}
false
Optional. If you leave this out (or pass `null`), it's
saved as `null`. Any fields the target adapter doesn't
support are quietly dropped; the response echoes what was
kept.
Removes the default.
**Heads up:** any eval templates that relied on the default
(templates without their own `provider` and `model`) get marked
`INACTIVE` at the same time. Evaluator runs scheduled from those
templates stop firing until you either set a new default or
point each template at a specific model.
Safe to call more than once. If no default is set, the response
comes back with `alreadyDeleted: true` instead of an error —
handy for telling "you just unset it" apart from "it was
already gone" when retrying.
This method takes no parameters.
This method takes no parameters.
This method takes no parameters.
This method takes no parameters.
Clearing the default also marks any eval-template jobs that depend on it as INACTIVE. Set a new default before re-enabling those jobs.
const result = await client.defaultLlmModel.delete();
// 1. Set up the clientimport { AISDK, type LlmAdapter } from '@browserstack/ai-sdk';const publicKey = process.env.AISDK_PUBLIC_KEY!;const secretKey = process.env.AISDK_SECRET_KEY!;const client = new AISDK({ publicKey, secretKey,});// 2. Per-run variablesconst provider = 'openai-prod';const adapter: LlmAdapter = 'openai';const model = 'gpt-4o-mini';// 3. Get the current defaultconst defaultLlmModel = await client.defaultLlmModel.get();// 4. Set the defaultconst updatedDefault = await client.defaultLlmModel.set({ provider, adapter, model,});// 5. Clear the defaultconst result = await client.defaultLlmModel.delete();
# 1. Set up the clientimport osfrom browserstack_ai_sdk import AISDKclient = AISDK( public_key=os.environ["AISDK_PUBLIC_KEY"], secret_key=os.environ["AISDK_SECRET_KEY"],)# 2. Per-run variablesprovider = "openai-prod"adapter = "openai"model = "gpt-4o-mini"# 3. Get the current defaultdefault_model = client.default_llm_model.get()# 4. Set the defaultdefault_model = client.default_llm_model.set( provider=provider, adapter=adapter, model=model,)# 5. Clear the defaultclient.default_llm_model.delete()
SetDefaultLlmModelInput body = new SetDefaultLlmModelInput();body.provider = provider;body.adapter = adapter;body.model = model;DefaultLlmModelConfig updated = client.set(body);
DeleteDefaultLlmModelResponse result = client.delete();
// 1. Set up the SDKimport com.browserstack.aisdk.AISDK;import com.browserstack.aisdk.clients.default_llm_model.DefaultLlmModel;import com.browserstack.aisdk.clients.default_llm_model.DefaultLlmModelConfig;import com.browserstack.aisdk.clients.default_llm_model.DeleteDefaultLlmModelResponse;import com.browserstack.aisdk.clients.default_llm_model.LlmAdapter;import com.browserstack.aisdk.clients.default_llm_model.SetDefaultLlmModelInput;AISDK sdk = AISDK.builder() .publicKey(System.getenv("BROWSERSTACK_PUBLIC_KEY")) .secretKey(System.getenv("BROWSERSTACK_SECRET_KEY")) .build();DefaultLlmModel defaultLlmModel = sdk.defaultLlmModel();// 2. Per-run variablesString provider = "openai-prod";LlmAdapter adapter = LlmAdapter.OPENAI;String model = "gpt-4o-mini";// 3. Get the current defaultDefaultLlmModelConfig row = client.get();// 4. Set the defaultSetDefaultLlmModelInput body = new SetDefaultLlmModelInput();body.provider = provider;body.adapter = adapter;body.model = model;DefaultLlmModelConfig updated = client.set(body);// 5. Clear the defaultDeleteDefaultLlmModelResponse result = client.delete();