Models
Overview
The Confident AI SDK exposes every Model method on the platform. This page documents how to call these methods in all supported languages. See the introduction to install the SDK and set your API key.
Methods
Get Model
Returns one of your organization's default models, selected by the required type query parameter. Each default applies to every project with no override of its own; read a single project's effective model with the project models endpoint. Reading never creates configuration, so this answers with null until the organization sets one.
from confident_ai import ConfidentAI
client = ConfidentAI()
result = client.organization.get_model(type="PLATFORM")For async mode, call a_get_model and await it as shown below:
result = await client.organization.a_get_model(...)Parameters
| Parameter | Type | Description |
|---|---|---|
type | Literal['PLATFORM', 'SIMULATION'] | Required. Which of the organization's models to read. The organization has no evaluation model of its own; that one is always configured per project. |
import { ConfidentAI } from "confident-ai";
const client = new ConfidentAI();
const result = await client.organization.getModel({ type: "PLATFORM" });Parameters
| Parameter | Type | Description |
|---|---|---|
type | "PLATFORM" | "SIMULATION" | Required. Which of the organization's models to read. The organization has no evaluation model of its own; that one is always configured per project. |
Returns
This method returns an object of type Model.
Update Model
Sets one of your organization's default models, selected by the modelType path segment. Each applies to every project that has no override of its own for that type. The provider's credential must already be configured on the organization through the model credentials endpoint, and a provider your organization's model provider policy does not allow is rejected with 403. CONFIDENT_AI needs no credential and stores a null model name.
from confident_ai import ConfidentAI
from confident_ai.common import ModelProvider
client = ConfidentAI()
result = client.organization.update_model(
model_type="platform",
provider=ModelProvider.OPEN_AI,
name="gemini-2.0-flash",
max_concurrency=5,
max_input_tokens=128000,
)For async mode, call a_update_model and await it as shown below:
result = await client.organization.a_update_model(...)Parameters
| Parameter | Type | Description |
|---|---|---|
model_type | str | Required. Which of the organization's models to set. |
provider | ModelProvider | Required. See ModelProvider. |
name | Optional[str] | The model to call at that provider, for example gemini-2.0-flash. Omit it to fall back to the provider's default; it is ignored for CONFIDENT_AI, which always stores a null name. A Portkey model must be written as the saved integration slug, for example @openai-prod/gpt-4o. |
max_concurrency | Optional[int] | How many calls Confident AI may make to this model at once. Omit it or send null for no limit of its own. |
max_input_tokens | Optional[int] | How many input tokens Confident AI may send to this model per call. Omit it or send null for no limit of its own. |
import { ConfidentAI } from "confident-ai";
import { ModelProvider } from "confident-ai/common";
const client = new ConfidentAI();
const result = await client.organization.updateModel(
"platform",
ModelProvider.OPEN_AI,
{
name: "gemini-2.0-flash",
maxConcurrency: 5,
maxInputTokens: 128000
},
);Parameters
| Parameter | Type | Description |
|---|---|---|
modelType | string | Required. Which of the organization's models to set. |
provider | ModelProvider | Required. See ModelProvider. |
name | string | The model to call at that provider, for example gemini-2.0-flash. Omit it to fall back to the provider's default; it is ignored for CONFIDENT_AI, which always stores a null name. A Portkey model must be written as the saved integration slug, for example @openai-prod/gpt-4o. |
maxConcurrency | number | null | How many calls Confident AI may make to this model at once. Omit it or send null for no limit of its own. |
maxInputTokens | number | null | How many input tokens Confident AI may send to this model per call. Omit it or send null for no limit of its own. |
Returns
This method returns an object of type Model.
Types
Model
One model configuration: the provider and model Confident AI calls for a given purpose, with the limits it calls them under. A configuration belongs either to the organization (organizationId set) or to a single project (projectId set), never to both.
class Model:
id: str
type: ModelType
provider: Optional[ModelProvider]
name: Optional[str]
max_concurrency: Optional[int] = Field(alias="maxConcurrency")
max_input_tokens: Optional[int] = Field(alias="maxInputTokens")
project_id: Optional[str] = Field(alias="projectId")
organization_id: Optional[str] = Field(alias="organizationId")idstrRequired
The id of the model configuration, generated by Confident AI.
Example: "<MODEL-ID>"
typeModelTypeRequired
See ModelType.
providerOptional[ModelProvider]Required
The provider the model runs on, or null when your organization's model provider policy stopped allowing the configured provider and Confident AI cleared it.
See ModelProvider.
Example: "GEMINI"
nameOptional[str]Required
The model to call at that provider, or null when the provider's default is used. Always null for CONFIDENT_AI.
Example: "gemini-2.0-flash"
max_concurrencyOptional[int]Required
How many calls Confident AI makes to this model at once, or null for no limit of its own.
Example: 5
max_input_tokensOptional[int]Required
How many input tokens Confident AI sends to this model per call, or null for no limit of its own.
Example: 128000
project_idOptional[str]Required
The id of the project this configuration overrides the organization default for, or null when it is the organization default itself.
organization_idOptional[str]Required
The id of the organization this configuration is the default for, or null when it is a project override.
Example: "<ORGANIZATION-ID>"
interface Model {
id: string;
type: ModelType;
provider: ModelProvider | null;
name: string | null;
maxConcurrency: number | null;
maxInputTokens: number | null;
projectId: string | null;
organizationId: string | null;
}idstringRequired
The id of the model configuration, generated by Confident AI.
Example: "<MODEL-ID>"
typeModelTypeRequired
See ModelType.
providerModelProvider | nullRequired
The provider the model runs on, or null when your organization's model provider policy stopped allowing the configured provider and Confident AI cleared it.
See ModelProvider.
Example: "GEMINI"
namestring | nullRequired
The model to call at that provider, or null when the provider's default is used. Always null for CONFIDENT_AI.
Example: "gemini-2.0-flash"
maxConcurrencynumber | nullRequired
How many calls Confident AI makes to this model at once, or null for no limit of its own.
Example: 5
maxInputTokensnumber | nullRequired
How many input tokens Confident AI sends to this model per call, or null for no limit of its own.
Example: 128000
projectIdstring | nullRequired
The id of the project this configuration overrides the organization default for, or null when it is the organization default itself.
organizationIdstring | nullRequired
The id of the organization this configuration is the default for, or null when it is a project override.
Example: "<ORGANIZATION-ID>"
ModelProvider
This is the provider of the model.
class ModelProvider(Enum):
OPEN_AI = "OPEN_AI"
CUSTOM = "CUSTOM"
CONFIDENT_AI = "CONFIDENT_AI"
BEDROCK = "BEDROCK"
ANTHROPIC = "ANTHROPIC"
GEMINI = "GEMINI"
X_AI = "X_AI"
DEEPSEEK = "DEEPSEEK"
MOONSHOT_AI = "MOONSHOT_AI"
VERTEX_AI = "VERTEX_AI"
AZURE = "AZURE"
MISTRAL = "MISTRAL"
PERPLEXITY = "PERPLEXITY"
OPEN_ROUTER = "OPEN_ROUTER"
PORTKEY = "PORTKEY"
LITE_LLM = "LITE_LLM"
TRUE_FOUNDRY = "TRUE_FOUNDRY"
HUGGING_FACE = "HUGGING_FACE"
TYPE_SAFE = "TYPE_SAFE"
FAL = "FAL"enum ModelProvider {
OPEN_AI = "OPEN_AI",
CUSTOM = "CUSTOM",
CONFIDENT_AI = "CONFIDENT_AI",
BEDROCK = "BEDROCK",
ANTHROPIC = "ANTHROPIC",
GEMINI = "GEMINI",
X_AI = "X_AI",
DEEPSEEK = "DEEPSEEK",
MOONSHOT_AI = "MOONSHOT_AI",
VERTEX_AI = "VERTEX_AI",
AZURE = "AZURE",
MISTRAL = "MISTRAL",
PERPLEXITY = "PERPLEXITY",
OPEN_ROUTER = "OPEN_ROUTER",
PORTKEY = "PORTKEY",
LITE_LLM = "LITE_LLM",
TRUE_FOUNDRY = "TRUE_FOUNDRY",
HUGGING_FACE = "HUGGING_FACE",
TYPE_SAFE = "TYPE_SAFE",
FAL = "FAL",
}OPEN_AI · CUSTOM · CONFIDENT_AI · BEDROCK · ANTHROPIC · GEMINI · X_AI · DEEPSEEK · MOONSHOT_AI · VERTEX_AI · AZURE · MISTRAL · PERPLEXITY · OPEN_ROUTER · PORTKEY · LITE_LLM · TRUE_FOUNDRY · HUGGING_FACE · TYPE_SAFE · FAL
ModelType
What a configured model is used for. EVALUATION is the LLM judge that scores a project's metrics, PLATFORM is the model behind Confident AI's own AI features such as classification, summaries and report generation, and SIMULATION is the model that simulates user turns in conversation simulations. Those three are the only types the public API reads or writes.
class ModelType(Enum):
EVALUATION = "EVALUATION"
PLATFORM = "PLATFORM"
GENERATION = "GENERATION"
SIMULATION = "SIMULATION"
TEXT_TO_SPEECH = "TEXT_TO_SPEECH"
SPEECH_TO_TEXT = "SPEECH_TO_TEXT"
DECISION = "DECISION"
SPEECH_TO_SPEECH = "SPEECH_TO_SPEECH"enum ModelType {
EVALUATION = "EVALUATION",
PLATFORM = "PLATFORM",
GENERATION = "GENERATION",
SIMULATION = "SIMULATION",
TEXT_TO_SPEECH = "TEXT_TO_SPEECH",
SPEECH_TO_TEXT = "SPEECH_TO_TEXT",
DECISION = "DECISION",
SPEECH_TO_SPEECH = "SPEECH_TO_SPEECH",
}EVALUATION · PLATFORM · GENERATION · SIMULATION · TEXT_TO_SPEECH · SPEECH_TO_TEXT · DECISION · SPEECH_TO_SPEECH
Last updated on