LangChain Reference home pageLangChain ReferenceLangChain Reference
  • GitHub
  • Main Docs
Deep Agents
LangChain
LangGraph
Integrations
LangSmith
  • Overview
  • Client
  • AsyncClient
  • Run Helpers
  • Run Trees
  • Evaluation
  • Schemas
  • Utilities
  • Wrappers
  • Anonymizer
  • Testing
  • Expect API
  • Middleware
  • Pytest Plugin
  • Deployment SDK
⌘I

LangChain Assistant

Ask a question to get started

Enter to send•Shift+Enter new line

Menu

OverviewClientAsyncClientRun HelpersRun TreesEvaluationSchemasUtilitiesWrappersAnonymizerTestingExpect APIMiddlewarePytest PluginDeployment SDK
Language
Theme
Pythonlangsmithtypessandboxesbox_create_paramsBoxCreateParams
Class●Since v0.14

BoxCreateParams

Copy
BoxCreateParams()

Bases

TypedDict

Constructors

Attributes

View source on GitHub
constructor
__init__
NameType
access_delegationAccessDelegation
cpu_millicoresint
delete_after_stop_secondsint
env_varsDict[str, str]
fs_capacity_bytesint
idle_ttl_secondsint
labelsDict[str, str]
mem_bytesint
mount_configMountConfig
namestr
preserve_memory_on_stopbool
proxy_configProxyConfig
restore_memorybool
run_configRunConfig
snapshotstr
snapshot_idstr
snapshot_namestr
tag_value_idsSequenceNotStr[str]
vcpusint
attribute
access_delegation: AccessDelegation

AccessDelegation lets code inside the sandbox call the LangSmith API as you, with at most the permissions granted here. Omit for no access.

attribute
cpu_millicores: int

CPUMillicores optionally requests CPU at millicore granularity (e.g.

500 = 0.5 vCPU); takes precedence over VCPUs. Fractional (sub-vCPU) values are not available for every sandbox.

attribute
delete_after_stop_seconds: int
attribute
env_vars: Dict[str, str]
attribute
fs_capacity_bytes: int
attribute
idle_ttl_seconds: int
attribute
labels: Dict[str, str]

Labels are free-form key/value metadata persisted with the sandbox and returned on reads. Labels from the source snapshot are inherited unless overridden here.

attribute
mem_bytes: int

Memory for the sandbox, in bytes.

Memory is tied to CPU at 4 GiB per vCPU: omit it and it follows that ratio; set it and it must stay within 50% of the ratio for the requested CPU, so a 1 vCPU sandbox accepts 2-6 GiB. Setting memory without CPU derives the CPU from the same ratio. Maximum 64 GiB.

attribute
mount_config: MountConfig
attribute
name: str
attribute
preserve_memory_on_stop: bool

PreserveMemoryOnStop, when true, suspends the sandbox's memory on a voluntary stop (idle timeout or explicit stop) so the next start resumes from where it left off. Default false discards memory and keeps only the filesystem, so the next start is a cold boot. Restarts triggered by infrastructure maintenance always preserve memory regardless of this setting.

attribute
proxy_config: ProxyConfig
attribute
restore_memory: bool

RestoreMemory selects how the sandbox handles a snapshot's captured memory:

nil → if-present: resume from memory when the snapshot has it, else cold-boot (default). true → always: resume from memory; rejected if the snapshot has none. false → never: always cold-boot.

Applies to this request only.

attribute
run_config: RunConfig

RunConfig overrides the snapshot's run config for this sandbox: user and work_dir replace the snapshot's, env_vars merge over it. The result is what the sandbox boots with, and what a snapshot captured from it carries.

attribute
snapshot: str

Snapshot is a Docker-style name or name:tag reference to boot from.

A bare name resolves to name:latest.

attribute
snapshot_id: str
attribute
snapshot_name: str

SnapshotName is a synonym for Snapshot, accepted for compatibility with clients that predate it. Set one or the other.

attribute
tag_value_ids: SequenceNotStr[str]
attribute
vcpus: int