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
  • RemoteGraph
⌘I

LangChain Assistant

Ask a question to get started

Enter to send•Shift+Enter new line

Menu

OverviewClientAsyncClientRun HelpersRun TreesEvaluationSchemasUtilitiesWrappersAnonymizerTestingExpect APIMiddlewarePytest PluginDeployment SDKRemoteGraph
Language
Theme
Pythonlangsmithsandbox_clientSandboxClientcreate_template
Method●Since v0.6

create_template

Create a new SandboxTemplate.

Only the container image, resource limits, and volume mounts can be configured. All other container details are handled by the server.

Copy
create_template(
  self,
  name: str,
  image: str,
  *,
  cpu: str = '500m',
  memory: str = '512Mi',
  storage: Optional[str] = None,
  volume_mounts: Optional[list[VolumeMountSpec]] = None
) -> SandboxTemplate

Parameters

NameTypeDescription
name*str

Template name.

image*str

Container image (e.g., "python:3.12-slim").

cpustr
Default:'500m'

CPU limit (e.g., "500m", "1", "2"). Default: "500m".

memorystr
Default:'512Mi'

Memory limit (e.g., "256Mi", "1Gi"). Default: "512Mi".

storageOptional[str]
Default:None

Ephemeral storage limit (e.g., "1Gi"). Optional.

volume_mountsOptional[list[VolumeMountSpec]]
Default:None

List of volumes to mount in the sandbox. Optional.

View source on GitHub