aip_sdk.sut
SUT (System Under Test) Registry SDK.
aip_sdk.sut.Adapter
aip_sdk.sut.Adapter(data: dict[str, Any], sut_id: str, client: APIClient)
JSONPath-based adapter for mapping raw SUT response to GDI schema.
Attributes
idstr: Adapter IDconnection_idstr: Parent connection IDtemplate_namestr | None: Name of built-in template (if used)mapping_configdict[str, Any]: JSONPath mappings dictcreated_atdatetime | None: When this adapter was created
aip_sdk.sut.Adapter.connection_id
aip_sdk.sut.Adapter.connection_id: str = data['connection_id']
No docstring is defined in the source.
aip_sdk.sut.Adapter.created_at
aip_sdk.sut.Adapter.created_at: datetime | None = parse_dt(data['created_at'])
No docstring is defined in the source.
aip_sdk.sut.Adapter.id
aip_sdk.sut.Adapter.id: str = data['id']
No docstring is defined in the source.
aip_sdk.sut.Adapter.mapping_config
aip_sdk.sut.Adapter.mapping_config: dict[str, Any] = data.get('mapping_config', {})
No docstring is defined in the source.
aip_sdk.sut.Adapter.template_name
aip_sdk.sut.Adapter.template_name: str | None = data.get('template_name')
No docstring is defined in the source.
aip_sdk.sut.Adapter.validate
aip_sdk.sut.Adapter.validate(sample_payload: list[Any] | dict[str, Any]) -> AdapterValidateResult
Validate the adapter's JSONPath mappings against a sample SUT response.
Parameters
sample_payloadlist[Any] | dict[str, Any]: A raw SUT response to test mappings against, exactly as the endpoint returns it — including the top-level array a CV endpoint returns, which needs no wrapping
Returns
AdapterValidateResult: AdapterValidateResult with mapped output and any errors. A payload theAdapterValidateResult: connection's protocol cannot assemble comes back withvalidfalse andAdapterValidateResult: the reason inerrors, not as an exception.
Examples
>>> adapter = conn.get_adapter()
>>> sample = {"choices": [{"message": {"content": "Hello"}}]}
>>> result = adapter.validate(sample)
>>> if result.valid:
... print(f"Mapped output: {result.mapped}")
... else:
... print(f"Errors: {result.errors}")
A classification SUT returns its scores as a bare array:
>>> result = adapter.validate([{"label": "cat", "score": 0.9}, {"label": "dog", "score": 0.1}])
>>> print(result.mapped["predictions"])
aip_sdk.sut.AdapterValidateResult
aip_sdk.sut.AdapterValidateResult(valid: bool, mapped: dict[str, Any], errors: list[str])
Result from validating an adapter's JSONPath mappings.
Attributes
validbool: Whether all mappings resolved successfullymappeddict[str, Any]: The mapped output dictionaryerrorslist[str]: List of validation error messages
aip_sdk.sut.AdapterValidateResult.errors
aip_sdk.sut.AdapterValidateResult.errors: list[str]
No docstring is defined in the source.
aip_sdk.sut.AdapterValidateResult.mapped
aip_sdk.sut.AdapterValidateResult.mapped: dict[str, Any]
No docstring is defined in the source.
aip_sdk.sut.AdapterValidateResult.valid
aip_sdk.sut.AdapterValidateResult.valid: bool
No docstring is defined in the source.
aip_sdk.sut.Connection
aip_sdk.sut.Connection(data: dict[str, Any], client: APIClient)
A connection to a SUT (specific environment).
Attributes
idstr: Connection IDsut_idstr: Parent SUT IDlabelstr: Environment label (e.g., "staging", "prod")base_urlstr: SUT endpoint base URLauth_typestr: Authentication method ("none", "bearer", "api_key", "basic")auth_header_namestr | None: Header name for auth (e.g., "Authorization")model_paramsdict[str, Any]: Static parameters passed to the selected SUT protocolsut_protocolstr | None: Invocation protocol, e.g. "openai_chat", "huggingface_object_detection", or "rag_api"gdi_schemastr | None: GDI dataset schema this connection produces (e.g. "gdi_text_v1")task_typestr | None: Task discriminator for task-scoped schemas, e.g. "detection" for gdi_image_v1sut_streamingbool: When True, responses are streamed so evaluation captures true time-to-first-byte rather than total round-trip. Recommended for long-running SUTs (video, agentic/trajectory, large RAG); off by default.created_atdatetime | None: When this connection was created
aip_sdk.sut.Connection.auth_header_name
aip_sdk.sut.Connection.auth_header_name: str | None = data.get('auth_header_name')
No docstring is defined in the source.
aip_sdk.sut.Connection.auth_type
aip_sdk.sut.Connection.auth_type: str = data['auth_type']
No docstring is defined in the source.
aip_sdk.sut.Connection.base_url
aip_sdk.sut.Connection.base_url: str = data['base_url']
No docstring is defined in the source.
aip_sdk.sut.Connection.created_at
aip_sdk.sut.Connection.created_at: datetime | None = parse_dt(data['created_at'])
No docstring is defined in the source.
aip_sdk.sut.Connection.delete
aip_sdk.sut.Connection.delete() -> None
Remove this connection from the SUT.
Raises
NotFoundError: If the connection no longer exists, or the SUT belongs to a workspace the caller is not a member of.ForbiddenError: If the caller is not an editor or admin of the SUT's workspace. A platform admin must be a member of that workspace too.
aip_sdk.sut.Connection.gdi_schema
aip_sdk.sut.Connection.gdi_schema: str | None = data.get('gdi_schema')
No docstring is defined in the source.
aip_sdk.sut.Connection.get_adapter
aip_sdk.sut.Connection.get_adapter() -> Adapter
Get the current response parser adapter for this connection.
Returns
Adapter: Adapter instance
Raises
NotFoundError: If no adapter is configured for this connection
aip_sdk.sut.Connection.id
aip_sdk.sut.Connection.id: str = data['id']
No docstring is defined in the source.
aip_sdk.sut.Connection.label
aip_sdk.sut.Connection.label: str = data['label']
No docstring is defined in the source.
aip_sdk.sut.Connection.model_params
aip_sdk.sut.Connection.model_params: dict[str, Any] = data.get('model_params') or {}
No docstring is defined in the source.
aip_sdk.sut.Connection.set_adapter
aip_sdk.sut.Connection.set_adapter(mapping_config: dict[str, str], template_name: str | None = None) -> Adapter
Set or replace the response parser adapter for this connection.
Parameters
mapping_configdict[str, str]: JSONPath mappings from SUT response to GDI schema Example: {"sut_response": "$.choices[0].message.content"}template_namestr | None: Optional built-in template to use as base ("openai_chat", "cv_detection", "cv_classification", "rag_api")
Returns
Adapter: Adapter instance
Raises
NotFoundError: If the connection no longer exists, or the SUT belongs to a workspace the caller is not a member of.ForbiddenError: If the caller is not an editor or admin of the SUT's workspace. A platform admin must be a member of that workspace too.
Examples
>>> conn = sut.add_connection(...)
>>> adapter = conn.set_adapter(
... template_name="openai_chat",
... mapping_config={
... "sut_response": "$.choices[0].message.content",
... "usage_prompt_tokens": "$.usage.prompt_tokens",
... },
... )
aip_sdk.sut.Connection.sut_id
aip_sdk.sut.Connection.sut_id: str = data['sut_id']
No docstring is defined in the source.
aip_sdk.sut.Connection.sut_protocol
aip_sdk.sut.Connection.sut_protocol: str | None = data.get('sut_protocol')
No docstring is defined in the source.
aip_sdk.sut.Connection.sut_streaming
aip_sdk.sut.Connection.sut_streaming: bool = data.get('sut_streaming', False)
No docstring is defined in the source.
aip_sdk.sut.Connection.task_type
aip_sdk.sut.Connection.task_type: str | None = data.get('task_type')
No docstring is defined in the source.
aip_sdk.sut.Connection.test
aip_sdk.sut.Connection.test() -> ConnectionTestResult
Test this connection by firing a request using the project's golden dataset.
Returns
ConnectionTestResult: ConnectionTestResult with success status and raw SUT response
Examples
>>> conn = sut.add_connection(...)
>>> result = conn.test()
>>> if result.success:
... print(f"SUT responded in {result.duration_ms}ms")
... print(f"Raw response: {result.raw_response}")
aip_sdk.sut.Connection.update
aip_sdk.sut.Connection.update(label: str | None = None, base_url: str | None = None, auth_type: str | None = None, auth_header_name: str | None = None, auth_header_value: str | None = None, model_params: dict[str, Any] | None = None, sut_protocol: str | None = None, gdi_schema: str | None = None, task_type: str | None = None, sut_streaming: bool | None = None) -> Connection
Update this connection's configuration.
Parameters
labelstr | None: New environment label; unique among this SUT's connectionsbase_urlstr | None: New endpoint URLauth_typestr | None: New auth methodauth_header_namestr | None: New auth header nameauth_header_valuestr | None: New credential (plaintext, encrypted at rest)model_paramsdict[str, Any] | None: New static protocol parameterssut_protocolstr | None: New invocation protocolgdi_schemastr | None: New compatible dataset format (e.g. "gdi_text_v1")task_typestr | None: New task discriminator for task-scoped schemassut_streamingbool | None: Toggle response streaming for true time-to-first-byte capture. None leaves the current setting unchanged.
Returns
Connection: Updated Connection instance
Raises
DuplicateConnectionError: If another connection on this SUT is already labelledlabel.NotFoundError: If the connection no longer exists, or the SUT belongs to a workspace the caller is not a member of.ForbiddenError: If the caller is not an editor or admin of the SUT's workspace. A platform admin must be a member of that workspace too.AuthError: If credentials are missing or invalid.APIError: If the update otherwise fails.
aip_sdk.sut.ConnectionTestResult
aip_sdk.sut.ConnectionTestResult(success: bool, status_code: int | None, raw_response: Any | None, error: str | None, duration_ms: float | None, reachability: str | None = None, reason: str | None = None)
Result from testing a SUT connection.
Attributes
successbool: Whether the test request succeededstatus_codeint | None: HTTP status code from the SUT responsereachabilitystr | None: Outcome classification (e.g. "ok", "auth_failed", "endpoint_misconfigured", "payload_rejected", "unreachable")reasonstr | None: Human-readable explanation of the outcomeraw_responseAny | None: The raw SUT response bodyerrorstr | None: Error message if test failedduration_msfloat | None: Request duration in milliseconds
aip_sdk.sut.ConnectionTestResult.duration_ms
aip_sdk.sut.ConnectionTestResult.duration_ms: float | None
No docstring is defined in the source.
aip_sdk.sut.ConnectionTestResult.error
aip_sdk.sut.ConnectionTestResult.error: str | None
No docstring is defined in the source.
aip_sdk.sut.ConnectionTestResult.raw_response
aip_sdk.sut.ConnectionTestResult.raw_response: Any | None
No docstring is defined in the source.
aip_sdk.sut.ConnectionTestResult.reachability
aip_sdk.sut.ConnectionTestResult.reachability: str | None = None
No docstring is defined in the source.
aip_sdk.sut.ConnectionTestResult.reason
aip_sdk.sut.ConnectionTestResult.reason: str | None = None
No docstring is defined in the source.
aip_sdk.sut.ConnectionTestResult.status_code
aip_sdk.sut.ConnectionTestResult.status_code: int | None
No docstring is defined in the source.
aip_sdk.sut.ConnectionTestResult.success
aip_sdk.sut.ConnectionTestResult.success: bool
No docstring is defined in the source.
aip_sdk.sut.Sut
aip_sdk.sut.Sut
SUT Registry top-level access.
Examples
>>> import aip_sdk as aip
>>> aip.init(base_url, api_key=api_key)
>>> sut = aip.Sut.register(name="my-gpt4", version="2024-01", project_id=project.id)
>>> conn = sut.add_connection(
... base_url="https://api.openai.com/v1/chat/completions",
... auth_type="bearer",
... auth_header_name="Authorization",
... auth_header_value="sk-...",
... gdi_schema="gdi_text_v1",
... )
>>> result = conn.test()
>>> print(f"Success: {result.success}, Duration: {result.duration_ms}ms")
>>> adapter = conn.set_adapter(
... template_name="openai_chat", mapping_config={"sut_response": "$.choices[0].message.content"}
... )
>>> sample = {"choices": [{"message": {"content": "Hello"}}]}
>>> validation = adapter.validate(sample)
>>> print(validation.mapped) # {"sut_response": "Hello"}
aip_sdk.sut.Sut.aget
async aip_sdk.sut.Sut.aget(sut_id: str, client: AsyncAPIClient | None = None) -> SutInstance
Async variant of get().
Parameters
sut_idstr: SUT registration IDclientAsyncAPIClient | None: Optional async API client
Returns
SutInstance: SutInstance
Raises
SutNotFoundError: If SUT doesn't exist
aip_sdk.sut.Sut.aget_or_register
async aip_sdk.sut.Sut.aget_or_register(name: str, version: str = '1.0', owner: str | None = None, project_id: str | None = None, workspace_id: str | None = None, client: AsyncAPIClient | None = None) -> tuple[SutInstance, bool]
Async variant of get_or_register().
Parameters
namestr: SUT name to look up or register.versionstr: Version string (used only when registering).ownerstr | None: Owner identifier (used only when registering).project_idstr | None: Scope the registration to this project. The lookup widens to this project's workspace when it has one, else stays project-scoped — matching the API's own uniqueness rule.workspace_idstr | None: Scope the lookup and registration to this workspace when noproject_idis given. Falls back to the client config'sworkspace_id. Scoping the lookup matters because the backend allows duplicate SUT names across workspaces — without it a same-named SUT in another workspace could be returned, or aDuplicateSutErrorraised for one that already exists here.clientAsyncAPIClient | None: Optional async API client.
Returns
SutInstance:(sut, created)— the SutInstance andTruewhen freshlybool: registered,Falsewhen an existing SUT was found.
Raises
InvalidArgumentError: If bothproject_idandworkspace_idare given — a project already determines its workspace.NoWorkspaceSelectedError: If no workspace is passed and none is configured for the session.
aip_sdk.sut.Sut.alist
async aip_sdk.sut.Sut.alist(project_id: str | None = None, workspace_id: str | None = None, page: int = 1, per_page: int = 100, client: AsyncAPIClient | None = None, *, all_workspaces: bool = False) -> list[SutInstance]
Async variant of list().
Reads your session's workspace unless you name one, and raises if none is set.
Pass all_workspaces=True to read across every workspace you can access.
Parameters
project_idstr | None: Scope the listing to this project, which determines its workspace. Not combinable withworkspace_id.workspace_idstr | None: Filter by workspace (matches SUTs scoped to the workspace directly or via a project in it)pageint: Page number (1-indexed)per_pageint: Results per pageclientAsyncAPIClient | None: Optional async API clientall_workspacesbool: Read across every workspace you can access.
Returns
list[SutInstance]: List of SutInstance objects
Raises
ForbiddenError: Ifworkspace_idnames a workspace the caller cannot access.InvalidArgumentError: Ifworkspace_idis combined withall_workspaces, or withproject_id— a project already determines its workspace.NoWorkspaceSelectedError: No workspace was passed, none is configured for the session, andall_workspaceswas not set.
aip_sdk.sut.Sut.aregister
async aip_sdk.sut.Sut.aregister(name: str, version: str = '1.0', owner: str | None = None, project_id: str | None = None, workspace_id: str | None = None, client: AsyncAPIClient | None = None) -> SutInstance
Async variant of register().
Parameters
namestr: SUT nameversionstr: Version identifierownerstr | None: Owner/team identifierproject_idstr | None: Associated project IDworkspace_idstr | None: Workspace to scope the SUT to. Pass this orproject_id, not both — a project-scoped SUT inherits its workspace from the project. Falls back to the client config'sworkspace_id; with neither, the registration is refused rather than creating a SUT no non-admin caller can see.clientAsyncAPIClient | None: Optional async API client
Returns
SutInstance: SutInstance (with a sync client for subsequent instance method calls)
Raises
InvalidArgumentError: If bothproject_idandworkspace_idare given — a project already determines its workspace.NoWorkspaceSelectedError: If no workspace is passed and none is configured for the session.DuplicateSutError: If a SUT with this name already exists.
aip_sdk.sut.Sut.get
aip_sdk.sut.Sut.get(sut_id: str, client: APIClient | None = None) -> SutInstance
Fetch a registered SUT by ID.
Parameters
sut_idstr: SUT registration IDclientAPIClient | None: Optional API client
Returns
SutInstance: SutInstance
Raises
SutNotFoundError: If SUT doesn't exist
aip_sdk.sut.Sut.get_or_register
aip_sdk.sut.Sut.get_or_register(name: str, version: str = '1.0', owner: str | None = None, project_id: str | None = None, workspace_id: str | None = None, client: APIClient | None = None) -> tuple[SutInstance, bool]
Get an existing SUT by name or register it.
Parameters
namestr: SUT name to look up or register.versionstr: Version string (used only when registering).ownerstr | None: Owner identifier (used only when registering).project_idstr | None: Scope the registration to this project. The lookup widens to this project's workspace when it has one, else stays project-scoped — matching the API's own uniqueness rule.workspace_idstr | None: Scope the lookup and registration to this workspace when noproject_idis given. Falls back to the client config'sworkspace_id. Scoping the lookup matters because the backend allows duplicate SUT names across workspaces — without it a same-named SUT in another workspace could be returned, or aDuplicateSutErrorraised for one that already exists here.clientAPIClient | None: Optional API client.
Returns
SutInstance:(sut, created)— the SutInstance andTruewhen freshlybool: registered,Falsewhen an existing SUT was found.
Raises
InvalidArgumentError: If bothproject_idandworkspace_idare given — a project already determines its workspace.NoWorkspaceSelectedError: If no workspace is passed and none is configured for the session.
Example:
sut, created = aip.Sut.get_or_register(
name="my-detector-v1",
version="1.0",
project_id=project.id,
)
print("Registered" if created else "Reusing", sut.id)
aip_sdk.sut.Sut.list
aip_sdk.sut.Sut.list(project_id: str | None = None, workspace_id: str | None = None, page: int = 1, per_page: int = 100, client: APIClient | None = None, *, all_workspaces: bool = False) -> list[SutInstance]
List registered SUTs.
Reads your session's workspace unless you name one, and raises if none is set.
Pass all_workspaces=True to read across every workspace you can access.
Parameters
project_idstr | None: Scope the listing to this project, which determines its workspace. Not combinable withworkspace_id.workspace_idstr | None: Filter by workspace (matches SUTs scoped to the workspace directly or via a project in it)pageint: Page number (1-indexed)per_pageint: Results per pageclientAPIClient | None: Optional API clientall_workspacesbool: Read across every workspace you can access.
Returns
list[SutInstance]: List of SutInstance objects
Raises
ForbiddenError: Ifworkspace_idnames a workspace the caller cannot access.InvalidArgumentError: Ifworkspace_idis combined withall_workspaces, or withproject_id— a project already determines its workspace.NoWorkspaceSelectedError: No workspace was passed, none is configured for the session, andall_workspaceswas not set.
aip_sdk.sut.Sut.register
aip_sdk.sut.Sut.register(name: str, version: str = '1.0', owner: str | None = None, project_id: str | None = None, workspace_id: str | None = None, client: APIClient | None = None) -> SutInstance
Register a new System Under Test.
Parameters
namestr: SUT nameversionstr: Version identifierownerstr | None: Owner/team identifierproject_idstr | None: Associated project IDworkspace_idstr | None: Workspace to scope the SUT to. Pass this orproject_id, not both — a project-scoped SUT inherits its workspace from the project. Falls back to the client config'sworkspace_id; with neither, the registration is refused rather than creating a SUT no non-admin caller can see.clientAPIClient | None: Optional API client
Returns
SutInstance: SutInstance
Raises
InvalidArgumentError: If bothproject_idandworkspace_idare given — a project already determines its workspace.NoWorkspaceSelectedError: If no workspace is passed and none is configured for the session.DuplicateSutError: If a SUT with this name already exists.
Examples
>>> sut = aip.Sut.register(name="production-gpt4", version="2024-01-15", project_id=project.id)
aip_sdk.sut.Sut.templates
aip_sdk.sut.Sut.templates(client: APIClient | None = None) -> dict[str, Any]
List all built-in adapter templates.
Returns
dict[str, Any]: Dict of template name → template config. Each entry includes:dict[str, Any]: -description: human-readable descriptiondict[str, Any]: -sut_protocol: invocation protocol identifierdict[str, Any]: -gdi_schema: expected GDI dataset schemadict[str, Any]: -model_params: default model params for this templatedict[str, Any]: -params_schema: JSON Schema dict for valid model_params (if the builder declares one), suitable for validation or UI renderingdict[str, Any]: -mapping_config: default JSONPath response mappings
Examples
>>> templates = aip.Sut.templates()
>>> print(templates["openai_chat"]["mapping_config"])
>>> print(templates["openai_chat"]["params_schema"])
aip_sdk.sut.SutInstance
aip_sdk.sut.SutInstance(data: dict[str, Any], client: APIClient)
A registered System Under Test.
Attributes
idstr: SUT registration IDnamestr: SUT nameversionstr: SUT version stringownerstr | None: Owner/team identifierproject_idstr | None: Associated project IDcreated_atdatetime | None: When this SUT was registeredupdated_atdatetime | None: Last update timestamp
aip_sdk.sut.SutInstance.add_connection
aip_sdk.sut.SutInstance.add_connection(base_url: str, label: str = 'default', auth_type: str = 'none', auth_header_name: str | None = None, auth_header_value: str | None = None, model_params: dict[str, Any] | None = None, sut_protocol: str | None = None, gdi_schema: str | None = None, task_type: str | None = None, sut_streaming: bool = False) -> Connection
Add a new connection to this SUT.
Parameters
base_urlstr: SUT endpoint URLlabelstr: Environment label (e.g., "staging", "prod"); unique among this SUT's connectionsauth_typestr: Authentication method ("none", "bearer", "api_key", "basic")auth_header_namestr | None: Header name for auth credentialsauth_header_valuestr | None: Plaintext credential (encrypted at rest by platform)model_paramsdict[str, Any] | None: Static parameters passed to the selected SUT protocolsut_protocolstr | None: Invocation protocol, e.g. "openai_chat", "huggingface_object_detection", or "rag_api"gdi_schemastr | None: Compatible dataset format (e.g. "gdi_text_v1", "gdi_image_v1")task_typestr | None: Task discriminator for task-scoped schemas, e.g. "detection" for gdi_image_v1sut_streamingbool: Stream the SUT response so evaluation records true time-to-first-byte instead of total round-trip. Recommended for long-running SUTs (video, agentic/trajectory, large RAG). Off by default.
Returns
Connection: Connection instance
Raises
DuplicateConnectionError: If this SUT already has a connection labelledlabel.NotFoundError: If the SUT no longer exists.AuthError: If credentials are missing or invalid.APIError: If the platform otherwise rejects the connection.
Examples
>>> sut = aip.Sut.register("my-llm")
>>> conn = sut.add_connection(
... base_url="https://api.openai.com/v1/chat/completions",
... label="prod",
... auth_type="bearer",
... auth_header_name="Authorization",
... auth_header_value="sk-...",
... model_params={"model": "gpt-4o"},
... sut_protocol="openai_chat",
... gdi_schema="gdi_text_v1",
... sut_streaming=True,
... )
aip_sdk.sut.SutInstance.connection_count
aip_sdk.sut.SutInstance.connection_count: int = data.get('connection_count', 0)
No docstring is defined in the source.
aip_sdk.sut.SutInstance.connections
aip_sdk.sut.SutInstance.connections() -> list[Connection]
List all connections for this SUT.
Returns
list[Connection]: List of Connection instances
aip_sdk.sut.SutInstance.created_at
aip_sdk.sut.SutInstance.created_at: datetime | None = parse_dt(data['created_at'])
No docstring is defined in the source.
aip_sdk.sut.SutInstance.delete
aip_sdk.sut.SutInstance.delete() -> None
Delete this SUT registration.
Cascades to all connections and their adapters.
Raises
NotFoundError: If the SUT no longer exists, or belongs to a workspace the caller is not a member of.ForbiddenError: If the caller is not an editor or admin of the SUT's workspace. A platform admin must be a member of that workspace too.
aip_sdk.sut.SutInstance.id
aip_sdk.sut.SutInstance.id: str = data['id']
No docstring is defined in the source.
aip_sdk.sut.SutInstance.name
aip_sdk.sut.SutInstance.name: str = data['name']
No docstring is defined in the source.
aip_sdk.sut.SutInstance.owner
aip_sdk.sut.SutInstance.owner: str | None = data.get('owner')
No docstring is defined in the source.
aip_sdk.sut.SutInstance.project_id
aip_sdk.sut.SutInstance.project_id: str | None = data.get('project_id')
No docstring is defined in the source.
aip_sdk.sut.SutInstance.runs
aip_sdk.sut.SutInstance.runs(page: int = 1, per_page: int = 20) -> dict[str, Any]
List evaluation runs that used this SUT.
Parameters
pageint: Page number (1-indexed)per_pageint: Results per page
Returns
dict[str, Any]: Paginated response with run records
aip_sdk.sut.SutInstance.update
aip_sdk.sut.SutInstance.update(name: str | None = None, version: str | None = None, owner: str | None = None) -> SutInstance
Update this SUT's metadata.
Parameters
namestr | None: New SUT nameversionstr | None: New version stringownerstr | None: New owner identifier
Returns
SutInstance: Updated SutInstance
Raises
NotFoundError: If the SUT no longer exists, or belongs to a workspace the caller is not a member of.ForbiddenError: If the caller is not an editor or admin of the SUT's workspace. A platform admin must be a member of that workspace too.
aip_sdk.sut.SutInstance.updated_at
aip_sdk.sut.SutInstance.updated_at: datetime | None = parse_dt(data['updated_at'])
No docstring is defined in the source.
aip_sdk.sut.SutInstance.version
aip_sdk.sut.SutInstance.version: str = data['version']
No docstring is defined in the source.
aip_sdk.sut.aregister
async aip_sdk.sut.aregister(name: str, endpoint: str, project_id: str, *, label: str = 'default', version: str = '1.0', owner: str | None = None, auth_type: str = 'none', auth_header_name: str | None = None, auth_header_value: str | None = None, model_params: dict[str, Any] | None = None, sut_protocol: str | None = None, gdi_schema: str | None = None, task_type: str | None = None, sut_streaming: bool = False, client: AsyncAPIClient | None = None) -> SutInstance
Async convenience: register a SUT and add its first connection in a single call.
Drop-in async counterpart to the module-level register(). Suitable for
use in notebooks and asyncio workflows without blocking the event loop.
Parameters
namestr: SUT name.endpointstr: SUT base URL (must be a valid HTTP/HTTPS URL).project_idstr: Project to register the SUT under.labelstr: Connection environment label (default:"default").versionstr: SUT version string (default:"1.0").ownerstr | None: Owner/team identifier.auth_typestr: Connection auth method.auth_header_namestr | None: Auth header name.auth_header_valuestr | None: Plaintext credential.model_paramsdict[str, Any] | None: Static SUT protocol parameters.sut_protocolstr | None: Invocation protocol.gdi_schemastr | None: GDI dataset schema.task_typestr | None: Task discriminator for task-scoped schemas.sut_streamingbool: Stream the SUT response so evaluation records true time-to-first-byte instead of total round-trip. Off by default.clientAsyncAPIClient | None: Optional pre-configured async API client.
Returns
SutInstance: class:SutInstance— same shape as the sync variant.
Raises
AuthError: If no credentials are configured.DuplicateSutError: If a SUT with this name already exists.InvalidArgumentError: Ifendpointis not a valid HTTP(S) URL.APIError: If connection setup fails after the SUT is registered.
Example:
sut = await aip.sut.aregister(
name="my-model",
endpoint="https://api.openai.com/v1/chat/completions",
project_id="proj-abc123",
)
aip_sdk.sut.get_sut
aip_sdk.sut.get_sut(sut_id: str, client: APIClient | None = None) -> SutInstance
Get a registered SUT by ID.
Parameters
sut_idstr: SUT registration ID.clientAPIClient | None: Optional API client.
Returns
SutInstance: SutInstance with full details.
Raises
SutNotFoundError: If the SUT does not exist.AuthError: If credentials are missing or invalid.
Examples:
sut = aip.get_sut("sut_abc123")
aip_sdk.sut.list_suts
aip_sdk.sut.list_suts(project_id: str | None = None, page: int = 1, per_page: int = 100, client: APIClient | None = None, *, workspace_id: str | None = None, all_workspaces: bool = False) -> list[SutInstance]
List registered SUTs.
Reads your session's workspace unless you name one, and raises if none is set.
Pass all_workspaces=True to read across every workspace you can access.
Parameters
project_idstr | None: Scope the listing to this project, which determines its workspace. Not combinable withworkspace_id.pageint: Page number (1-based).per_pageint: Items per page (max 100).clientAPIClient | None: Optional API client.workspace_idstr | None: Return only SUTs in this workspace.all_workspacesbool: Read across every workspace you can access.
Returns
list[SutInstance]: List of SutInstance objects.
Raises
AuthError: If credentials are missing or invalid.ForbiddenError: Ifworkspace_idnames a workspace you cannot access.InvalidArgumentError: If bothworkspace_idandall_workspacesare given.NoWorkspaceSelectedError: No workspace was passed, none is configured for the session, andall_workspaceswas not set.
Examples:
suts = aip.list_suts()
suts = aip.list_suts(project_id="proj_123")
aip_sdk.sut.register
aip_sdk.sut.register(name: str, endpoint: str, project_id: str, *, label: str = 'default', version: str = '1.0', owner: str | None = None, auth_type: str = 'none', auth_header_name: str | None = None, auth_header_value: str | None = None, model_params: dict[str, Any] | None = None, sut_protocol: str | None = None, gdi_schema: str | None = None, task_type: str | None = None, sut_streaming: bool = False, client: APIClient | None = None) -> SutInstance
Register a SUT and add its first connection in a single call.
This is the recommended entry point for new integrations. It collapses
Sut.register() + SutInstance.add_connection() into one call.
Use the two-step API (Sut.register() then SutInstance.add_connection())
when you need fine-grained control over auth_type, request_template, or gdi_schema.
Parameters
namestr: SUT name.endpointstr: SUT base URL (must be a valid HTTP/HTTPS URL).project_idstr: Project to register the SUT under.labelstr: Connection environment label (default:"default").versionstr: SUT version string (default:"1.0").ownerstr | None: Owner/team identifier.auth_typestr: Connection auth method ("none","bearer","api_key","basic").auth_header_namestr | None: Auth header name (e.g."Authorization").auth_header_valuestr | None: Plaintext credential, encrypted at rest by the platform.model_paramsdict[str, Any] | None: Static parameters forwarded to the SUT protocol on every call.sut_protocolstr | None: Invocation protocol ("openai_chat","rag_api", …).gdi_schemastr | None: GDI dataset schema ("gdi_text_v1","gdi_image_v1", …).task_typestr | None: Task discriminator for task-scoped schemas, e.g."detection"forgdi_image_v1.sut_streamingbool: Stream the SUT response so evaluation records true time-to-first-byte instead of total round-trip. Recommended for long-running SUTs (video, agentic/trajectory, large RAG). Off by default.clientAPIClient | None: Optional pre-configured API client.
Returns
SutInstance: class:SutInstancewithid,name,version,project_id.SutInstance: The added connection is accessible viasut.connections().
Raises
AuthError: If no credentials are configured.DuplicateSutError: If a SUT with this name already exists — useSut.get_or_register()for idempotent creation.InvalidArgumentError: Ifendpointis not a valid HTTP(S) URL.APIError: If connection setup fails after the SUT is registered.
Example:
import aip_sdk as aip
aip.init("https://aip.example.com", api_key="...")
sut = aip.sut.register(
name="my-model",
endpoint="https://api.openai.com/v1/chat/completions",
project_id="proj-abc123",
auth_type="bearer",
auth_header_value="sk-...",
sut_protocol="openai_chat",
gdi_schema="gdi_text_v1",
)
print(sut.id, sut.name)