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_DEFAULT_MODEL_ENV= _config_env.KITARU_DEFAULT_MODEL_ENVattributeKITARU_CONFIG_PATH_ENV= _config_env.KITARU_CONFIG_PATH_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.KitaruConfigattributeResolvedExecutionConfig= _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.ResolvedModelSelectionattributeStackInfo= _config_stacks.StackInfoattributeStackType= _config_stacks.StackTypeattributeCloudProvider= _config_stacks.CloudProviderattributeKubernetesStackSpec= _config_stacks.KubernetesStackSpecattributeVertexStackSpec= _config_stacks.VertexStackSpecattributeSagemakerStackSpec= _config_stacks.SagemakerStackSpecattributeAzureMLStackSpec= _config_stacks.AzureMLStackSpecattributeRemoteStackSpec= _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_specfunc_read_global_execution_config() -> KitaruConfigRead execution defaults from global user config/runtime state.
Returns
kitaru.config.KitaruConfigfunc_read_global_connection_config() -> KitaruConfigRead connection defaults from global user config/runtime state.
Only reads server_url and auth_token from ZenML's persisted
store configuration. Project is intentionally omitted here — it is
only populated by explicit overrides (env var or runtime configure).
Returns
kitaru.config.KitaruConfigfuncresolve_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_connection_config(*, explicit=None, validate_for_use=False) -> ResolvedConnectionConfigResolve connection configuration with connection-specific precedence.
Precedence (lowest to highest):
- Global ZenML-backed defaults (server_url, auth_token only)
- Environment variable overrides (KITARU_SERVER_URL, etc.)
- Runtime overrides from
kitaru.configure(project=...) - Explicit argument passed by the caller
paramexplicitKitaruConfig | None= Noneparamvalidate_for_usebool= FalseReturns
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
Nonefunc_kitaru_config_dir() -> PathReturn the Kitaru-owned global config directory.
Returns
pathlib.Pathfunc_kitaru_global_config_path() -> PathReturn the path to Kitaru's global config file.
Returns
pathlib.Pathfunc_parse_kitaru_config_file(config_path) -> _KitaruGlobalConfig | NoneParse a Kitaru global config file, returning None if absent.
paramconfig_pathPathReturns
kitaru.config._KitaruGlobalConfig | Nonefunc_read_kitaru_global_config() -> _KitaruGlobalConfigRead Kitaru global config from disk.
Returns
kitaru.config._KitaruGlobalConfigParsed Kitaru global config.
func_write_kitaru_global_config(config) -> NoneWrite Kitaru global config to disk.
paramconfig_KitaruGlobalConfigReturns
Nonefunc_read_kitaru_global_config_for_update() -> _KitaruGlobalConfigRead global config for mutation, recovering from malformed files.
Returns
kitaru.config._KitaruGlobalConfigfunc_update_kitaru_global_config(mutator) -> _KitaruGlobalConfigApply an in-place mutation and persist the resulting global config.
parammutatorCallable[[_KitaruGlobalConfig], None]Returns
kitaru.config._KitaruGlobalConfigfunc_read_log_store_env_override() -> ResolvedLogStore | NoneParse an optional log-store override from environment variables.
Returns
kitaru.config.ResolvedLogStore | Nonefunc_resolved_log_store_from_override(override, *, source) -> ResolvedLogStoreConvert a persisted/env override into a resolved log-store view.
paramoverrideLogStoreOverrideparamsourceLiteral['environment', 'global user config']Returns
kitaru.config.ResolvedLogStorefuncresolve_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.ResolvedLogStorefunc_read_model_registry_config() -> ModelRegistryConfigRead the local model registry from global config.
Returns
kitaru.config.ModelRegistryConfigfuncregister_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 LiteLLM model.
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.StackInfofunc_list_stack_entries() -> list[_StackListEntry]List stacks with active + managed metadata for structured output.
Returns
list[kitaru.config._StackListEntry]func_show_stack_operation(name_or_id) -> StackDetailsInspect one stack and translate its component metadata for CLI display.
paramname_or_idstrReturns
kitaru.config.StackDetailsfunc_create_kubernetes_stack_operation(name, *, spec, activate=True, labels=None, component_overrides=None) -> _StackCreateResultCreate a Kubernetes-backed stack via ZenML's one-shot stack API.
paramnamestrparamspecKubernetesStackSpecparamactivatebool= Trueparamlabelsdict[str, str] | None= Noneparamcomponent_overridesStackComponentConfigOverrides | None= NoneReturns
kitaru.config._StackCreateResultfunc_create_vertex_stack_operation(name, *, spec, activate=True, labels=None, component_overrides=None) -> _StackCreateResultCreate a Vertex AI stack via ZenML's one-shot stack API.
paramnamestrparamspecVertexStackSpecparamactivatebool= Trueparamlabelsdict[str, str] | None= Noneparamcomponent_overridesStackComponentConfigOverrides | None= NoneReturns
kitaru.config._StackCreateResultfunc_create_sagemaker_stack_operation(name, *, spec, activate=True, labels=None, component_overrides=None) -> _StackCreateResultCreate a SageMaker stack via ZenML's one-shot stack API.
paramnamestrparamspecSagemakerStackSpecparamactivatebool= Trueparamlabelsdict[str, str] | None= Noneparamcomponent_overridesStackComponentConfigOverrides | None= NoneReturns
kitaru.config._StackCreateResultfunc_create_azureml_stack_operation(name, *, spec, activate=True, labels=None, component_overrides=None) -> _StackCreateResultCreate an AzureML stack via ZenML's one-shot stack API.
paramnamestrparamspecAzureMLStackSpecparamactivatebool= Trueparamlabelsdict[str, str] | None= Noneparamcomponent_overridesStackComponentConfigOverrides | None= NoneReturns
kitaru.config._StackCreateResultfunc_create_stack_operation(name, *, stack_type=StackType.LOCAL, activate=True, labels=None, remote_spec=None, component_overrides=None) -> _StackCreateResultCreate a stack by dispatching to the requested stack type flow.
paramnamestrparamstack_typeStackType= StackType.LOCALparamactivatebool= Trueparamlabelsdict[str, str] | None= Noneparamremote_specRemoteStackSpec | None= Noneparamcomponent_overridesStackComponentConfigOverrides | None= NoneReturns
kitaru.config._StackCreateResultfunc_create_local_stack_operation(name, *, activate=True, labels=None, component_overrides=None) -> _StackCreateResultCreate a new local stack and return structured operation details.
paramnamestrparamactivatebool= Trueparamlabelsdict[str, str] | None= Noneparamcomponent_overridesStackComponentConfigOverrides | None= NoneReturns
kitaru.config._StackCreateResultfunc_delete_stack_operation(name_or_id, *, recursive=False, force=False) -> _StackDeleteResultDelete a stack and return structured operation details.
paramname_or_idstrparamrecursivebool= Falseparamforcebool= FalseReturns
kitaru.config._StackDeleteResultfunclist_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.
func_suppress_zenml_cli_messages() -> Iterator[None]Silence ZenML success/progress chatter while Kitaru reuses its helpers.
This keeps the user-facing CLI output in Kitaru terms while still using ZenML's connection/authentication machinery underneath.
Returns
collections.abc.Iterator[None]func_login_to_server_target(server, *, api_key=None, refresh=False, project=None, verify_ssl=True, 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.
paramverify_sslbool | str= TrueTLS verification mode or CA bundle path.
paramcloud_api_urlstr | None= NoneOptional managed-cloud API URL used for staging or custom control planes.
paramtimeoutint | None= NoneOptional connection timeout forwarded when supported by the underlying runtime.
Returns
Nonefuncconfigure(*, stack=_UNSET, image=_UNSET, cache=_UNSET, retries=_UNSET, project=_UNSET) -> KitaruConfigSet process-local runtime defaults.
Execution-level fields (stack, image, cache, retries)
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.
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