Apothic Client Liv Reference
Reference for the liv decorator, LivConfig, cache modes, and target-context-aware generated function materialization.
Last updated: 4/21/2026
API Version: v0.1.0
apothic-clientapireferenceliv
Apothic Client Liv Reference
liv is the optional generated-code layer in apothic-client.
The current supported deploy mode is freeze, which means generation happens before deploy and the frozen result is what the runtime executes.
@apothic.liv(...)
@apothic.liv(
*,
client: Any | None = None,
model: str | None = None,
base_url: str | None = None,
api_key: str | None = None,
timeout: float | None = None,
temperature: float | None = None,
self_debug: bool | int | None = None,
max_repair_attempts: int | None = None,
sandbox: bool | None = None,
allowed_modules: tuple[str, ...] | None = None,
tools: tuple[Callable[..., Any], ...] = (),
examples: tuple[tuple[tuple[Any, ...], dict[str, Any]], ...] = (),
mode: str = "freeze",
cache: str = "account",
cache_namespace: str | None = None,
prompt_salt: str | None = None,
force_regenerate: bool = False,
target_context: Mapping[str, Any] | None = None,
)
LivConfig
LivConfig(
client: Any | None = None,
model: str | None = None,
base_url: str | None = None,
api_key: str | None = None,
timeout: float | None = None,
temperature: float | None = None,
self_debug: bool | int | None = None,
max_repair_attempts: int | None = None,
sandbox: bool | None = None,
allowed_modules: tuple[str, ...] | None = None,
tools: tuple[Callable[..., Any], ...] = (),
examples: tuple[tuple[tuple[Any, ...], dict[str, Any]], ...] = (),
mode: str = "freeze",
cache: str = "account",
cache_namespace: str | None = None,
prompt_salt: str | None = None,
force_regenerate: bool = False,
target_context: Mapping[str, Any] | None = None,
)
Use it via a resource decorator:
@app.function(liv=apothic.LivConfig(...))
def my_fn(...):
raise NotImplementedError
Supported resource types
Current public support:
@app.function(...)@app.endpoint(...)
Cache modes
Current cache mode values:
memoryaccountappcustom
Important options
Examples
examples: tuple[tuple[tuple[Any, ...], dict[str, Any]], ...] = ()
self_debug
self_debug: bool | int | None = None
allowed_modules
allowed_modules: tuple[str, ...] | None = None
target_context
target_context: Mapping[str, Any] | None = None
Materialization model
At deploy time, liv folds the declared execution context into the generation identity. That includes:
- function kind
- CPU, memory, GPU, timeout, concurrency, and batching settings
offer_filters,disk_gb, andservice_startup_timeout_s- image base, pip dependencies, apt packages, environment variables, commands, and build-context mounts
- volumes
- secret names
- schedule metadata when present
