ArizeClient#
The main entry point for the Arize SDK.
- class ArizeClient(*, api_key: str | None = None, region: Region | None = None, api_host: str | None = None, api_scheme: str | None = None, otlp_host: str | None = None, otlp_scheme: str | None = None, flight_host: str | None = None, flight_port: int | None = None, flight_scheme: str | None = None, pyarrow_max_chunksize: int | None = None, request_verify: bool | None = None, stream_max_workers: int | None = None, stream_max_queue_bound: int | None = None, max_http_payload_size_mb: float | None = None, arize_directory: str | None = None, enable_caching: bool | None = None, single_host: str | None = None, single_port: int | None = None, base_domain: str | None = None, max_past_years: int | None = None)[source]#
Bases:
LazySubclientsMixinRoot client for the Arize SDK.
The ArizeClient provides access to all Arize platform services including datasets, experiments, ML models, projects, and spans. It uses
arize.config.SDKConfigurationinternally to manage configuration settings.All parameters are optional (except api_key which must be provided via argument or environment variable). For each parameter, values are resolved in this order:
Explicit value passed to constructor (highest priority)
Environment variable value (see SDKConfiguration for variable names)
Built-in default value (lowest priority)
Examples
Initialize with API key only (other settings use defaults):
>>> client = ArizeClient(api_key="your-api-key")
Initialize with custom endpoints:
>>> client = ArizeClient( ... api_key="your-api-key", ... api_host="custom.api.com", ... flight_port=8443, ... )
Initialize with region (overrides host/port settings):
>>> from arize.regions import Region >>> client = ArizeClient( ... api_key="your-api-key", region=Region.EU_WEST ... )
Initialize the Arize client with configuration parameters.
All parameters are optional and follow the precedence order documented in the class docstring: explicit argument > environment variable > default value.
- Parameters:
api_key (str | None) – Arize API key for authentication. Required - must be provided here or via ARIZE_API_KEY environment variable. Raises MissingAPIKeyError if not set.
region (Region | None) – Arize region (e.g., Region.US_CENTRAL, Region.EU_WEST). When specified, overrides individual host/port settings. ENV: ARIZE_REGION. Default: Region.UNSET.
api_host (str | None) – Custom API endpoint host. ENV: ARIZE_API_HOST. Default: “api.arize.com”.
api_scheme (str | None) – API endpoint scheme (http/https). ENV: ARIZE_API_SCHEME. Default: “https”.
otlp_host (str | None) – OTLP endpoint host. ENV: ARIZE_OTLP_HOST. Default: “otlp.arize.com”.
otlp_scheme (str | None) – OTLP endpoint scheme (http/https). ENV: ARIZE_OTLP_SCHEME. Default: “https”.
flight_host (str | None) – Apache Arrow Flight endpoint host. ENV: ARIZE_FLIGHT_HOST. Default: “flight.arize.com”.
flight_port (int | None) – Apache Arrow Flight endpoint port (1-65535). ENV: ARIZE_FLIGHT_PORT. Default: 443.
flight_scheme (str | None) – Apache Arrow Flight endpoint scheme. ENV: ARIZE_FLIGHT_SCHEME. Default: “grpc+tls”.
pyarrow_max_chunksize (int | None) – Maximum PyArrow chunk size (1 to MAX_CHUNKSIZE). ENV: ARIZE_MAX_CHUNKSIZE. Default: 10_000.
request_verify (bool | None) – Whether to verify SSL certificates. ENV: ARIZE_REQUEST_VERIFY. Default: True.
stream_max_workers (int | None) – Maximum worker threads for streaming (minimum: 1). ENV: ARIZE_STREAM_MAX_WORKERS. Default: 8.
stream_max_queue_bound (int | None) – Maximum queue size for streaming (minimum: 1). ENV: ARIZE_STREAM_MAX_QUEUE_BOUND. Default: 5000.
max_http_payload_size_mb (float | None) – Maximum HTTP payload size in MB (minimum: 1). ENV: ARIZE_MAX_HTTP_PAYLOAD_SIZE_MB. Default: 100.
arize_directory (str | None) – Directory for SDK files (cache, logs, etc.). ENV: ARIZE_DIRECTORY. Default: “~/.arize”.
enable_caching (bool | None) – Whether to enable local caching. ENV: ARIZE_ENABLE_CACHING. Default: True.
single_host (str | None) – Single host for all endpoints. When specified, overrides individual hosts. ENV: ARIZE_SINGLE_HOST. Default: None.
single_port (int | None) – Single port for all endpoints. When specified, overrides individual ports. ENV: ARIZE_SINGLE_PORT. Default: 0 (not set).
base_domain (str | None) – Base domain for generating endpoint hosts as api.<base_domain>, otlp.<base_domain>, flight.<base_domain>. Intended for Private Connect setups. When specified, overrides individual hosts. ENV: ARIZE_BASE_DOMAIN. Default: None.
max_past_years (int | None) – Maximum number of years in the past allowed for prediction timestamps. For on-prem deployments with custom retention policies, this can be increased. ENV: ARIZE_MAX_PAST_YEARS. Default: 5.
- Raises:
MissingAPIKeyError – If api_key is not provided via argument or environment variable.
MultipleEndpointOverridesError – If multiple endpoint override options (region, single_host/single_port, base_domain) are provided.
Notes
Values provided to this class override environment variables, which in turn override default values. See
arize.config.SDKConfigurationfor detailed parameter documentation.- clear_cache() None[source]#
Clear the local cache directory.
Removes all cached data from the SDK’s cache directory. This can be useful when troubleshooting caching issues or freeing up disk space. The cache directory is automatically recreated on subsequent operations that require caching.
- Raises:
NotADirectoryError – If the cache path exists but is not a directory.
- Return type:
None
Notes
This operation permanently deletes all cached data
If the cache directory doesn’t exist, a warning is logged but no error is raised
The cache directory location is configured via sdk_config.cache_dir
- property ai_integrations: AiIntegrationsClient#
Access the AI integrations client for managing LLM provider integrations (lazy-loaded).
- property annotation_configs: AnnotationConfigsClient#
Access the annotation configs client for config operations.
- property annotation_queues: AnnotationQueuesClient#
Access the annotation queues client for queue and record operations.
- property api_keys: ApiKeysClient#
Access the API keys client for API key operations (lazy-loaded).
- property datasets: DatasetsClient#
Access the datasets client for dataset operations (lazy-loaded).
- property evaluators: EvaluatorsClient#
Access the evaluators client for evaluator operations (lazy-loaded).
- property experiments: ExperimentsClient#
Access the experiments client for experiment operations (lazy-loaded).
- property ml: MLModelsClient#
Access the ML models client for ML model operations (lazy-loaded).
- property organizations: OrganizationsClient#
Access the organizations client for organization operations (lazy-loaded).
- property projects: ProjectsClient#
Access the projects client for project operations (lazy-loaded).
- property prompts: PromptsClient#
Access the prompts client for prompt management operations (lazy-loaded).
- property resource_restrictions: ResourceRestrictionsClient#
Access the resource restrictions client for restricting resources (lazy-loaded).
- property role_bindings: RoleBindingsClient#
Access the role bindings client for role binding operations (lazy-loaded).
- property roles: RolesClient#
Access the roles client for role management operations (lazy-loaded).
- property spaces: SpacesClient#
Access the spaces client for space operations (lazy-loaded).
- property spans: SpansClient#
Access the spans client for tracing and span operations (lazy-loaded).
- property tasks: TasksClient#
Access the tasks client for task and task run operations (lazy-loaded).
- property users: UsersClient#
Access the users client for user management operations (lazy-loaded).