Launch Week 3: Five days of launches

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 which model the project uses for the type you ask for. PLATFORM and SIMULATION fall back to the organization's default when the project has no override of its own; EVALUATION is always project scoped. Reading never creates configuration.

from confident_ai import ConfidentAI

client = ConfidentAI()

project = client.project(project_id="<PROJECT-ID>")
result = project.get_model(type="PLATFORM")

For async mode, call a_get_model and await it as shown below:

result = await project.a_get_model(...)

Parameters

ParameterTypeDescription
typeLiteral['EVALUATION', 'PLATFORM', 'SIMULATION', 'TEXT_TO_SPEECH', 'SPEECH_TO_TEXT', 'DECISION', 'SPEECH_TO_SPEECH']Required. Which of the project's models to read.

Returns

This method returns an object of type ProjectModel.

Update Evaluation Project Model

Sets one of the project's models, selected by the modelType path segment; decision configures the model used by JEVAL metrics. The provider's credential must already be configured on the project or organization, and a provider blocked by the organization's model provider policy is rejected. CONFIDENT_AI needs no credential and stores a null model name.

The model to run as the project's evaluation model. It takes no maxInputTokens, which is rejected on this path.

from confident_ai import ConfidentAI
from confident_ai.common import ModelProvider
from confident_ai.projects import UpdateEvaluationProjectModelRequest

client = ConfidentAI()

project = client.project(project_id="<PROJECT-ID>")
result = project.update_model(
    model_type="platform",
    model_config=UpdateEvaluationProjectModelRequest(
        provider=ModelProvider.OPEN_AI,
        name="gemini-2.0-flash",
        max_concurrency=5
    ),
)

For async mode, call a_update_model and await it as shown below:

result = await project.a_update_model(...)

Parameters

ParameterTypeDescription
model_typestrRequired. Which of the project's models to act on.
model_configUpdateProjectModelRequestRequired. The model to run for the type named in the path. The accepted shape is determined by modelType: decision accepts only provider and name, evaluation also accepts max concurrency, and platform, simulation, and speech models also accept max input tokens. This replaces the whole configuration rather than patching it. CUSTOM is rejected. Pass one of UpdateEvaluationProjectModelRequest, UpdateDecisionProjectModelRequest, UpdatePlatformProjectModelRequest. See UpdateProjectModelRequest.

Returns

This method returns an object of type UpdateProjectModelResult.

Update Decision Project Model

Sets one of the project's models, selected by the modelType path segment; decision configures the model used by JEVAL metrics. The provider's credential must already be configured on the project or organization, and a provider blocked by the organization's model provider policy is rejected. CONFIDENT_AI needs no credential and stores a null model name.

The project-scoped decision model used by JEVAL metrics. Concurrency and input-token limits are not accepted.

from confident_ai import ConfidentAI
from confident_ai.common import ModelProvider
from confident_ai.projects import UpdateDecisionProjectModelRequest

client = ConfidentAI()

project = client.project(project_id="<PROJECT-ID>")
result = project.update_model(
    model_type="platform",
    model_config=UpdateDecisionProjectModelRequest(
        provider=ModelProvider.OPEN_AI,
        name="jev-latest"
    ),
)

For async mode, call a_update_model and await it as shown below:

result = await project.a_update_model(...)

Parameters

ParameterTypeDescription
model_typestrRequired. Which of the project's models to act on.
model_configUpdateProjectModelRequestRequired. The model to run for the type named in the path. The accepted shape is determined by modelType: decision accepts only provider and name, evaluation also accepts max concurrency, and platform, simulation, and speech models also accept max input tokens. This replaces the whole configuration rather than patching it. CUSTOM is rejected. Pass one of UpdateEvaluationProjectModelRequest, UpdateDecisionProjectModelRequest, UpdatePlatformProjectModelRequest. See UpdateProjectModelRequest.

Returns

This method returns an object of type UpdateProjectModelResult.

Update Platform Project Model

Sets one of the project's models, selected by the modelType path segment; decision configures the model used by JEVAL metrics. The provider's credential must already be configured on the project or organization, and a provider blocked by the organization's model provider policy is rejected. CONFIDENT_AI needs no credential and stores a null model name.

The model to run for platform, simulation, or speech model types.

from confident_ai import ConfidentAI
from confident_ai.common import ModelProvider
from confident_ai.projects import UpdatePlatformProjectModelRequest

client = ConfidentAI()

project = client.project(project_id="<PROJECT-ID>")
result = project.update_model(
    model_type="platform",
    model_config=UpdatePlatformProjectModelRequest(
        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 project.a_update_model(...)

Parameters

ParameterTypeDescription
model_typestrRequired. Which of the project's models to act on.
model_configUpdateProjectModelRequestRequired. The model to run for the type named in the path. The accepted shape is determined by modelType: decision accepts only provider and name, evaluation also accepts max concurrency, and platform, simulation, and speech models also accept max input tokens. This replaces the whole configuration rather than patching it. CUSTOM is rejected. Pass one of UpdateEvaluationProjectModelRequest, UpdateDecisionProjectModelRequest, UpdatePlatformProjectModelRequest. See UpdateProjectModelRequest.

Returns

This method returns an object of type UpdateProjectModelResult.

Delete Model

Removes a project model override and falls back to the organization's default. Evaluation and decision models cannot be cleared. Idempotent when no override exists.

from confident_ai import ConfidentAI

client = ConfidentAI()

project = client.project(project_id="<PROJECT-ID>")
result = project.delete_model(model_type="platform")

For async mode, call a_delete_model and await it as shown below:

result = await project.a_delete_model(...)

Parameters

ParameterTypeDescription
model_typestrRequired. Which of the project's models to act on.

Returns

This method returns an object of type ClearProjectModelResult.

Methods (Stateless)

These methods take every argument themselves, so a caller reaches them through client.projects without opening a Project first.

Get Model

Returns which model the project uses for the type you ask for. PLATFORM and SIMULATION fall back to the organization's default when the project has no override of its own; EVALUATION is always project scoped. Reading never creates configuration.

from confident_ai import ConfidentAI

client = ConfidentAI()

result = client.projects.get_model(
    project_id="<PROJECT-ID>",
    type="PLATFORM",
)

For async mode, call a_get_model and await it as shown below:

result = await client.projects.a_get_model(...)

Parameters

ParameterTypeDescription
project_idstrRequired. The id of the project, which must belong to the organization your API key is scoped to.
typeLiteral['EVALUATION', 'PLATFORM', 'SIMULATION', 'TEXT_TO_SPEECH', 'SPEECH_TO_TEXT', 'DECISION', 'SPEECH_TO_SPEECH']Required. Which of the project's models to read.

Returns

This method returns an object of type ProjectModel.

Update Evaluation Project Model

Sets one of the project's models, selected by the modelType path segment; decision configures the model used by JEVAL metrics. The provider's credential must already be configured on the project or organization, and a provider blocked by the organization's model provider policy is rejected. CONFIDENT_AI needs no credential and stores a null model name.

The model to run as the project's evaluation model. It takes no maxInputTokens, which is rejected on this path.

from confident_ai import ConfidentAI
from confident_ai.common import ModelProvider
from confident_ai.projects import UpdateEvaluationProjectModelRequest

client = ConfidentAI()

result = client.projects.update_model(
    project_id="<PROJECT-ID>",
    model_type="platform",
    model_config=UpdateEvaluationProjectModelRequest(
        provider=ModelProvider.OPEN_AI,
        name="gemini-2.0-flash",
        max_concurrency=5
    ),
)

For async mode, call a_update_model and await it as shown below:

result = await client.projects.a_update_model(...)

Parameters

ParameterTypeDescription
project_idstrRequired. The id of the project, which must belong to the organization your API key is scoped to.
model_typestrRequired. Which of the project's models to act on.
model_configUpdateProjectModelRequestRequired. The model to run for the type named in the path. The accepted shape is determined by modelType: decision accepts only provider and name, evaluation also accepts max concurrency, and platform, simulation, and speech models also accept max input tokens. This replaces the whole configuration rather than patching it. CUSTOM is rejected. Pass one of UpdateEvaluationProjectModelRequest, UpdateDecisionProjectModelRequest, UpdatePlatformProjectModelRequest. See UpdateProjectModelRequest.

Returns

This method returns an object of type UpdateProjectModelResult.

Update Decision Project Model

Sets one of the project's models, selected by the modelType path segment; decision configures the model used by JEVAL metrics. The provider's credential must already be configured on the project or organization, and a provider blocked by the organization's model provider policy is rejected. CONFIDENT_AI needs no credential and stores a null model name.

The project-scoped decision model used by JEVAL metrics. Concurrency and input-token limits are not accepted.

from confident_ai import ConfidentAI
from confident_ai.common import ModelProvider
from confident_ai.projects import UpdateDecisionProjectModelRequest

client = ConfidentAI()

result = client.projects.update_model(
    project_id="<PROJECT-ID>",
    model_type="platform",
    model_config=UpdateDecisionProjectModelRequest(
        provider=ModelProvider.OPEN_AI,
        name="jev-latest"
    ),
)

For async mode, call a_update_model and await it as shown below:

result = await client.projects.a_update_model(...)

Parameters

ParameterTypeDescription
project_idstrRequired. The id of the project, which must belong to the organization your API key is scoped to.
model_typestrRequired. Which of the project's models to act on.
model_configUpdateProjectModelRequestRequired. The model to run for the type named in the path. The accepted shape is determined by modelType: decision accepts only provider and name, evaluation also accepts max concurrency, and platform, simulation, and speech models also accept max input tokens. This replaces the whole configuration rather than patching it. CUSTOM is rejected. Pass one of UpdateEvaluationProjectModelRequest, UpdateDecisionProjectModelRequest, UpdatePlatformProjectModelRequest. See UpdateProjectModelRequest.

Returns

This method returns an object of type UpdateProjectModelResult.

Update Platform Project Model

Sets one of the project's models, selected by the modelType path segment; decision configures the model used by JEVAL metrics. The provider's credential must already be configured on the project or organization, and a provider blocked by the organization's model provider policy is rejected. CONFIDENT_AI needs no credential and stores a null model name.

The model to run for platform, simulation, or speech model types.

from confident_ai import ConfidentAI
from confident_ai.common import ModelProvider
from confident_ai.projects import UpdatePlatformProjectModelRequest

client = ConfidentAI()

result = client.projects.update_model(
    project_id="<PROJECT-ID>",
    model_type="platform",
    model_config=UpdatePlatformProjectModelRequest(
        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.projects.a_update_model(...)

Parameters

ParameterTypeDescription
project_idstrRequired. The id of the project, which must belong to the organization your API key is scoped to.
model_typestrRequired. Which of the project's models to act on.
model_configUpdateProjectModelRequestRequired. The model to run for the type named in the path. The accepted shape is determined by modelType: decision accepts only provider and name, evaluation also accepts max concurrency, and platform, simulation, and speech models also accept max input tokens. This replaces the whole configuration rather than patching it. CUSTOM is rejected. Pass one of UpdateEvaluationProjectModelRequest, UpdateDecisionProjectModelRequest, UpdatePlatformProjectModelRequest. See UpdateProjectModelRequest.

Returns

This method returns an object of type UpdateProjectModelResult.

Delete Model

Removes a project model override and falls back to the organization's default. Evaluation and decision models cannot be cleared. Idempotent when no override exists.

from confident_ai import ConfidentAI

client = ConfidentAI()

result = client.projects.delete_model(
    project_id="<PROJECT-ID>",
    model_type="platform",
)

For async mode, call a_delete_model and await it as shown below:

result = await client.projects.a_delete_model(...)

Parameters

ParameterTypeDescription
project_idstrRequired. The id of the project, which must belong to the organization your API key is scoped to.
model_typestrRequired. Which of the project's models to act on.

Returns

This method returns an object of type ClearProjectModelResult.

Types

ClearProjectModelResult

Confirmation that the project no longer overrides this model type. source is always organization, since the project now follows the organization's default.

class ClearProjectModelResult:
    source: ModelSource

sourceModelSourceRequired

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

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>"

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"

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

ModelSource

Where the model in effect for a project comes from: project when the model is project scoped or has a project override, and organization when it follows the organization's default.

class ModelSource(Enum):
    PROJECT = "project"
    ORGANIZATION = "organization"

PROJECT · ORGANIZATION

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"

EVALUATION · PLATFORM · GENERATION · SIMULATION · TEXT_TO_SPEECH · SPEECH_TO_TEXT · DECISION · SPEECH_TO_SPEECH

ProjectModel

The model the project actually runs for one type, whether that is its own override or the organization's default.

class ProjectModel:
    model: Optional[Model]
    source: ModelSource

modelOptional[Model]Required

The model in effect for the project, or null when nothing has been configured for that type — which for PLATFORM and SIMULATION means neither the project nor the organization has set one.

See Model.

sourceModelSourceRequired

UpdateProjectModelRequest

The model to run for the type named in the path. The accepted shape is determined by modelType: decision accepts only provider and name, evaluation also accepts max concurrency, and platform, simulation, and speech models also accept max input tokens. This replaces the whole configuration rather than patching it. CUSTOM is rejected.

UpdateProjectModelRequest = Union[
    UpdateEvaluationProjectModelRequest,
    UpdateDecisionProjectModelRequest,
    UpdatePlatformProjectModelRequest,
]

A UpdateProjectModelRequest is one of the shapes below. Send the fields of one of them, never a mix of both.

The model to run as the project's evaluation model. It takes no maxInputTokens, which is rejected on this path.

class UpdateEvaluationProjectModelRequest:
    provider: ModelProvider
    name: Optional[str] = None
    max_concurrency: Optional[int] = Field(default=None, alias="maxConcurrency")

providerModelProviderRequired

nameOptional[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.

Example: "gemini-2.0-flash"

max_concurrencyOptional[int]

How many calls Confident AI may make to this model at once. Omit it or send null for no limit of its own.

Example: 5

UpdateProjectModelResult

The project's model as it now stands. source is returned for the platform and simulation models, where the write creates a project override and so answers which scope now wins; the evaluation model is always project scoped and omits it.

class UpdateProjectModelResult:
    model: Model
    source: Optional[ModelSource] = None

modelModelRequired

See Model.

sourceOptional[ModelSource]

Building a production pipeline?Design a scalable API workflow for evals, datasets, traces, and promptsTalk to an engineer

Last updated on

Built byConfident AI