config
Configuration and connection management.
This module contains:
- global config helpers for runtime log-store settings
- stack-selection helpers
- runtime configuration via
kitaru.configure(...) - config precedence resolution for execution and connection settings
attributezenml_cli_utils= importlib.import_module('zenml.cli.utils')attributeKITARU_ANALYTICS_OPT_IN_ENV= _kitaru_env.KITARU_ANALYTICS_OPT_IN_ENVattributeKITARU_AUTH_TOKEN_ENV= _kitaru_env.KITARU_AUTH_TOKEN_ENVattributeKITARU_DEBUG_ENV= _kitaru_env.KITARU_DEBUG_ENVattributeKITARU_PROJECT_ENV= _kitaru_env.KITARU_PROJECT_ENVattributeKITARU_SERVER_URL_ENV= _kitaru_env.KITARU_SERVER_URL_ENVattributeKITARU_LOG_STORE_BACKEND_ENV= _config_env.KITARU_LOG_STORE_BACKEND_ENVattributeKITARU_LOG_STORE_ENDPOINT_ENV= _config_env.KITARU_LOG_STORE_ENDPOINT_ENVattributeKITARU_LOG_STORE_API_KEY_ENV= _config_env.KITARU_LOG_STORE_API_KEY_ENVattributeKITARU_STACK_ENV= _config_env.KITARU_STACK_ENVattributeKITARU_CACHE_ENV= _config_env.KITARU_CACHE_ENVattributeKITARU_RETRIES_ENV= _config_env.KITARU_RETRIES_ENVattributeKITARU_IMAGE_ENV= _config_env.KITARU_IMAGE_ENVattributeKITARU_LLM_ESTIMATED_COSTS_ENV= _config_env.KITARU_LLM_ESTIMATED_COSTS_ENVattributeKITARU_DEFAULT_MODEL_ENV= _config_env.KITARU_DEFAULT_MODEL_ENVattributeKITARU_CONFIG_PATH_ENV= _config_env.KITARU_CONFIG_PATH_ENVattributeKITARU_UI_URL_ENV= _config_env.KITARU_UI_URL_ENVattributeKITARU_MODEL_REGISTRY_ENV= _kitaru_env.KITARU_MODEL_REGISTRY_ENVattributeZENML_CONFIG_PATH_ENV= _ZENML_CONFIG_PATH_ENVattributeZENML_STORE_API_KEY_ENV= _ZENML_STORE_API_KEY_ENVattributeZENML_STORE_URL_ENV= _ZENML_STORE_URL_ENVattributeFROZEN_EXECUTION_SPEC_METADATA_KEY= _config_execution_spec.FROZEN_EXECUTION_SPEC_METADATA_KEYattributeImageSettings= _config_images.ImageSettingsattributeImageInput= _config_images.ImageInputattributeKitaruConfig= _config_core.KitaruConfigattributeLLMEstimatedCostsPolicy= _config_core.LLMEstimatedCostsPolicyattributeResolvedExecutionConfig= _config_core.ResolvedExecutionConfigattributeResolvedConnectionConfig= _config_core.ResolvedConnectionConfigattributeActiveEnvironmentVariable= _config_core.ActiveEnvironmentVariableattributeFrozenExecutionSpec= _config_execution_spec.FrozenExecutionSpecattributeLogStoreOverride= _config_log_store.LogStoreOverrideattributeResolvedLogStore= _config_log_store.ResolvedLogStoreattributeActiveStackLogStore= _config_log_store.ActiveStackLogStoreattributeModelAliasConfig= _config_models.ModelAliasConfigattributeModelRegistryConfig= _config_models.ModelRegistryConfigattributeModelAliasEntry= _config_models.ModelAliasEntryattributeResolvedModelSelection= _config_models.ResolvedModelSelectionattributeProjectInfo= _config_projects.ProjectInfoattributeProjectCreateResult= _config_projects.ProjectCreateResultattributeProjectDeleteResult= _config_projects.ProjectDeleteResultattributeSandboxCommandResult= _config_sandbox.SandboxCommandResultattributeStackInfo= _config_stacks.StackInfoattributeStackType= _config_stacks.StackTypeattributeCloudProvider= _config_stacks.CloudProviderattributeKubernetesStackSpec= _config_stacks.KubernetesStackSpecattributeVertexStackSpec= _config_stacks.VertexStackSpecattributeSagemakerStackSpec= _config_stacks.SagemakerStackSpecattributeAzureMLStackSpec= _config_stacks.AzureMLStackSpecattributeModalStackSpec= _config_stacks.ModalStackSpecattributeRemoteStackSpec= _config_stacks.RemoteStackSpecattributeStackComponentConfigOverrides= _config_stacks.StackComponentConfigOverridesattributeStackComponentDetails= _config_stacks.StackComponentDetailsattributeStackDetails= _config_stacks.StackDetailsattributeimage_settings_to_docker_settings= _config_images.image_settings_to_docker_settingsattributebuild_frozen_execution_spec= _config_execution_spec.build_frozen_execution_specattributeDEFAULT_SANDBOX_COMMAND_MAX_CHARS= _config_sandbox.DEFAULT_SANDBOX_COMMAND_MAX_CHARSattributecurrent_project= _config_projects.current_projectattributelist_projects= _config_projects.list_projectsattributeget_project= _config_projects.get_projectattributecreate_project= _config_projects.create_projectattributedelete_project= _config_projects.delete_projectattributeuse_project= _config_projects.use_projectfuncresolve_execution_config(*, decorator_overrides=None, invocation_overrides=None, start_dir=None) -> ResolvedExecutionConfigResolve execution configuration according to Phase 10 precedence.
paramdecorator_overridesKitaruConfig | None= Noneparaminvocation_overridesKitaruConfig | None= Noneparamstart_dirPath | None= NoneReturns
kitaru.config.ResolvedExecutionConfigfuncresolve_llm_estimated_cost_policy(*, start_dir=None) -> LLMEstimatedCostsPolicyResolve direct kitaru.llm() estimated-cost policy.
Direct LLM calls use the execution-config precedence chain entries that can
exist at call time: project config, environment variables, then runtime
kitaru.configure(...) overrides. The default is "auto".
paramstart_dirPath | None= NoneReturns
kitaru.config.LLMEstimatedCostsPolicyfuncresolve_connection_config(*, explicit=None, validate_for_use=False, require_project=True) -> ResolvedConnectionConfigResolve connection configuration with connection-specific precedence.
Precedence (lowest to highest):
- Persisted ZenML-backed defaults (server_url, auth_token, active project)
- Direct ZenML compatibility environment variables
- Public Kitaru environment variables
- Runtime overrides from
kitaru.configure(project=...) - Explicit argument passed by the caller
paramexplicitKitaruConfig | None= Noneparamvalidate_for_usebool= Falseparamrequire_projectbool= TrueReturns
kitaru.config.ResolvedConnectionConfigfuncpersist_frozen_execution_spec(*, run_id, frozen_execution_spec) -> NonePersist a frozen execution spec as pipeline-run metadata.
paramrun_idUUID | strparamfrozen_execution_specFrozenExecutionSpecReturns
Nonefuncresolve_log_store() -> ResolvedLogStoreResolve the effective runtime log-store backend.
Returns
kitaru.config.ResolvedLogStorefuncactive_stack_log_store() -> ActiveStackLogStore | NoneReturn the runtime log-store backend from the active stack.
Returns
kitaru.config.ActiveStackLogStore | Nonefuncset_global_log_store(backend, *, endpoint, api_key=None) -> ResolvedLogStorePersist a global log-store override backend.
parambackendstrparamendpointstrparamapi_keystr | None= NoneReturns
kitaru.config.ResolvedLogStorefuncreset_global_log_store() -> ResolvedLogStoreClear the persisted global log-store override.
Returns
kitaru.config.ResolvedLogStorefuncregister_model_alias(alias, *, model, secret=None) -> ModelAliasEntryRegister or update a local model alias for kitaru.llm().
paramaliasstrparammodelstrparamsecretstr | None= NoneReturns
kitaru.config.ModelAliasEntryfunclist_model_aliases() -> list[ModelAliasEntry]List model aliases visible in the current process environment.
Returns
list[kitaru.config.ModelAliasEntry]funcresolve_model_selection(model) -> ResolvedModelSelectionResolve an explicit/default model input to a concrete model string.
parammodelstr | NoneReturns
kitaru.config.ResolvedModelSelectionfunclist_active_kitaru_environment_variables() -> list[ActiveEnvironmentVariable]Return the active public Kitaru environment variables in stable order.
Returns
list[kitaru.config.ActiveEnvironmentVariable]funccurrent_stack() -> StackInfoReturn the currently active stack.
The active stack is managed by the underlying runtime and persisted in the runtime's global user configuration.
Returns
kitaru.config.StackInfofuncclassify_stack_model_deployment_type(stack_model) -> _config_stacks._StackShowTypeClassify an already-hydrated stack into Kitaru's deployment taxonomy.
paramstack_modelobjectReturns
kitaru._config._stacks.kitaru._config._stacks._StackShowTypefuncclassify_stack_deployment_type(name_or_id=None) -> _config_stacks._StackShowTypeClassify a stack into Kitaru's low-cardinality deployment taxonomy.
paramname_or_idstr | None= NoneReturns
kitaru._config._stacks.kitaru._config._stacks._StackShowTypefuncrun_sandbox_command(command, *, cwd=None, env=None, max_chars=DEFAULT_SANDBOX_COMMAND_MAX_CHARS, timeout_seconds=None, cleanup='destroy') -> SandboxCommandResultExecute one command through the active stack's sandbox component.
paramcommandstr | Sequence[str]Command to execute, as a provider-interpreted string or an argv-style command list. For exact argument splitting, pass a sequence.
paramcwdstr | None= NoneOptional working directory inside the sandbox.
paramenvMapping[str, str] | None= NoneOptional environment variables for the command. These values are passed to the sandbox provider but are not included in the result.
parammax_charsint= DEFAULT_SANDBOX_COMMAND_MAX_CHARSMaximum characters to collect from each output stream.
paramtimeout_secondsfloat | None= NoneOptional application-owned timeout for command execution. If the command does not finish in time, Kitaru asks the process to stop, cleans up the session on a best-effort basis, and returns a structured timeout result.
paramcleanupLiteral['destroy', 'close']= 'destroy'Whether to destroy or close the fresh sandbox session after the command completes.
Returns
kitaru.config.SandboxCommandResultStructured command output and cleanup status.
funclist_stacks() -> list[StackInfo]List stacks visible to the current user and mark the active one.
Returns
list[kitaru.config.StackInfo]funccreate_stack(name, *, activate=True, labels=None) -> StackInfoCreate a new local stack and optionally activate it.
paramnamestrparamactivatebool= Trueparamlabelsdict[str, str] | None= NoneReturns
kitaru.config.StackInfofuncdelete_stack(name_or_id, *, recursive=False, force=False) -> NoneDelete a stack and optionally its components.
paramname_or_idstrparamrecursivebool= Falseparamforcebool= FalseReturns
Nonefuncuse_stack(name_or_id) -> StackInfoSet the active stack and return the resulting active stack info.
paramname_or_idstrStack name or stack ID.
Returns
kitaru.config.StackInfoInformation about the newly active stack.
funcconfigure(*, stack=_UNSET, image=_UNSET, cache=_UNSET, retries=_UNSET, llm_estimated_costs=_UNSET, project=_UNSET) -> KitaruConfigSet process-local runtime defaults.
Execution-level fields (stack, image, cache, retries,
llm_estimated_costs) update the execution precedence chain. The
project field updates the connection precedence chain and is intended
as an internal /
testing escape hatch — it is not a normal user-facing setting.
paramstackstr | None | object= _UNSETDefault stack name/ID override.
paramimageImageInput | None | object= _UNSETDefault image settings override.
paramcachebool | None | object= _UNSETDefault cache behavior override.
paramretriesint | None | object= _UNSETDefault retry-count override.
paramllm_estimated_costsstr | None | object= _UNSETEstimated-cost policy for direct kitaru.llm()
calls. Use "auto" to calculate estimates when possible, "off"
to disable calculation, or None to clear the runtime override.
paramprojectstr | None | object= _UNSETProject override (internal/testing). Set to None
to clear.
Returns
kitaru.config.KitaruConfigThe current runtime override layer after applying updates.
funcconnect(server_url, *, api_key=None, refresh=False, project=None, no_verify_ssl=False, ssl_ca_cert=None, cloud_api_url=None, timeout=None) -> NoneConnect to a Kitaru server.
Under the hood, this connects to a ZenML server and stores the resolved connection/auth state in ZenML's global user configuration.
paramserver_urlstrURL of the Kitaru server.
paramapi_keystr | None= NoneAPI key used to authenticate with the server.
paramrefreshbool= FalseForce a fresh authentication flow.
paramprojectstr | None= NoneProject name or ID to activate after connecting.
paramno_verify_sslbool= FalseDisable TLS certificate verification.
paramssl_ca_certstr | None= NonePath to a CA bundle used to verify the server.
paramcloud_api_urlstr | None= NoneOptional managed-cloud API URL used when the server URL points at a managed Kitaru deployment or staging environment.
paramtimeoutint | None= NoneOptional connection timeout forwarded when supported by the underlying runtime.
Returns
Nonefunclogin_to_server(server, *, api_key=None, refresh=False, project=None, no_verify_ssl=False, ssl_ca_cert=None, cloud_api_url=None, timeout=None) -> NoneConnect to a Kitaru server URL or managed workspace target.
paramserverstrKitaru server URL, workspace name, or workspace ID.
paramapi_keystr | None= NoneAPI key used to authenticate with the server.
paramrefreshbool= FalseForce a fresh authentication flow.
paramprojectstr | None= NoneProject name or ID to activate after connecting.
paramno_verify_sslbool= FalseDisable TLS certificate verification.
paramssl_ca_certstr | None= NonePath to a CA bundle used to verify the server.
paramcloud_api_urlstr | None= NoneOptional managed-cloud API URL used when connecting to staging or another non-default control plane.
paramtimeoutint | None= NoneOptional connection timeout forwarded when supported by the underlying runtime.
Returns
None