When a workflow is executed and tasks are scheduled, the machines needed to run the task are provisioned automatically and managed for the user until task completion. Tasks can be annotated with the resources they are expected to consume (eg. CPU, RAM, GPU) at runtime and these requests will be fullfilled during the scheduling process.
Prespecified Task Resource
The Latch SDK currently supports a set of prespecified task resource requests
represented as decorators:
small_task: 2 cpus, 4 gigs of memory, 0 gpus
medium_task: 32 cpus, 128 gigs of memory, 0 gpus
large_task: 96 cpus, 192 gig sof memory, 0 gpus
small_gpu_task: 8 cpus, 32 gigs of memory, 1 gpu (24 gigs of VRAM, 9,216 cuda cores)
large_gpu_task: 31 cpus, 120 gigs of memory, 1 gpu (24 gigs of VRAM, 9,216 cuda cores)
v100_x1_task: 16 cpus, 64 gigs of memory, 1 V100 gpu (16 gigs of VRAM, 5,120 cuda cores)
v100_x4_task: 64 cpus, 256 gigs of memory, 4 V100 gpus (64 gigs of VRAM, 20,480 cuda cores)
v100_x8_task: 128 cpus, 512 gigs of memory, 8 V100 gpus (128 gigs of VRAM, 40,960 cuda cores)
g6e_xlarge_task: 4 cpus, 32 gigs of memory, 1 L40s gpu
g6e_2xlarge_task: 8 cpus, 64 gigs of memory, 1 L40s gpu
g6e_4xlarge_task: 16 cpus, 128 gigs of memory, 1 L40s gpu
g6e_8xlarge_task: 32 cpus, 256 gigs of memory, 1 L40s gpu
g6e_12xlarge_task: 48 cpus, 384 gigs of memory, 1 L40s gpu
g6e_16xlarge_task: 64 cpus, 512 gigs of memory, 1 L40s gpu
g6e_24xlarge_task: 96 cpus, 768 gigs of memory, 4 L40s gpus
THe maximum available resources are 126 cpus, 975 GiB memory, and 4949 GiB ephemeral storage.
Dynamic Task Resource
You can dynamically define task resources based on the tasks’ input
parameters by passing functions as arguments for the custom_task decorator.
The provided functions will execute at runtime, and the task will launch
with the resulting resource values:
...from latch import custom_taskfrom latch.types.file import LatchFiledef allocate_cpu(files: List[LatchFile], **kwargs) -> int: # number of cores to allocate return min(8, len(files))def allocate_storage(files: List[LatchFile], **kwargs) -> int: # GiBs of storage to allocate return sum([1.5 * file.size() for file in files]) // 1024**3@custom_task(cpu=allocate_cpu, memory=8, storage_gib=allocate_storage)def my_task(files: List[LatchFile], count: int): ...
In the provided example, the allocate_cpu function is designed to process the
input parameters files. Upon execution, the function returns an integer representing
the total number of CPU cores that should be allocated to the task based on the input
file size.
The parameters passed to the resource functions at runtime are the same as
those passed to the task function. Therefore, the resource functions must only
accept parameters that exist in the task function signature. See how the
my_task function and the allocate_cpu function both accept a parameter
named files of type List[LatchFile].
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"LatchBio","colors":{"primary":"#001AAE","light":"#92A2FF","dark":"#92A2FF"},"logo":{"light":"https://mintcdn.com/latchbio/rAgK9Jh7PMGtmcOA/logo/light.svg?fit=max\u0026auto=format\u0026n=rAgK9Jh7PMGtmcOA\u0026q=85\u0026s=4d10f1ae3113e21d7923ecaec6c9557e","dark":"https://mintcdn.com/latchbio/rAgK9Jh7PMGtmcOA/logo/dark.svg?fit=max\u0026auto=format\u0026n=rAgK9Jh7PMGtmcOA\u0026q=85\u0026s=6385a39407ab99828572d5b3b26c00d6"},"favicon":"https://mintcdn.com/latchbio/AQfMXqpyiLJx3G2h/favicon.png?fit=max\u0026auto=format\u0026n=AQfMXqpyiLJx3G2h\u0026q=85\u0026s=9420e120f36246f73ecd4753289382a6","navbar":{"links":[{"href":"mailto:support@latch.bio","label":"Contact Us"},{"href":"https://console.latch.bio/","label":"Log In"}],"primary":{"type":"button","label":"Sign Up","href":"https://console.latch.bio/signup"}},"footer":{"socials":{"twitter":"https://twitter.com/latchbio","linkedin":"https://www.linkedin.com/company/latchbio"}},"errors":{"404":{"redirect":false,"title":"Page Not Found","description":"The page might have been moved or been removed.\n \u003cCallout icon=\"arrow-right\" color=\"#001AAE\" iconType=\"regular\">Go to [Home](/)\u003c/Callout> \n \u003cCallout icon=\"arrow-right\" color=\"#001AAE\" iconType=\"regular\">Check out [Developer Docs](/docs)\u003c/Callout>"}},"styling":{"latex":true},"integrations":{"koala":{"publicApiKey":"pk_0469d6299947a84c711662e1ed49f0fea8d7"}},"navigation":{"global":{"tabs":[{"tab":"Blog","href":"https://latchbio.substack.com/"},{"tab":"Website","href":"https://latch.bio/"},{"tab":"Change Log","href":"https://latchbio.notion.site/LatchBio-Product-Change-Logs-ca76a6ae05a74a4daf78cb4006ad80ac"}]},"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"latchbio","hasAudioNarration":false,"actualSubdomain":"latchbio","customDomains":["wiki.latch.bio"],"gitSource":{"type":"github","owner":"latchbio","repo":"wiki","deployBranch":"main","contentDirectory":"","isPrivate":false,"mountPath":"","label":""},"feedback":{"thumbs":true,"issues":true},"entitlements":{"AI_CHAT":{"status":"ENABLED"},"WEB_MCP":{"status":"ENABLED"},"NARRATION":{"status":"ENABLED"}},"buildId":"6af265145dfd3b833eca24fb","clientVersion":"0.0.4336","searchFilterCounts":[{"language":"default","tag":"Workflows \u0026 SDK","count":66},{"language":"default","tag":"Plots","count":56},{"language":"default","tag":"Developer Tools","count":37},{"language":"default","tag":"Pods","count":24},{"language":"default","tag":"Agent","count":22},{"language":"default","tag":"Registry","count":20},{"language":"default","tag":"Administration","count":19},{"language":"default","tag":"Data","count":19},{"language":"default","tag":"Ready-to-Use Workflows","count":15},{"language":"default","tag":"Cell Types","count":14}]},"assistantConfig":{},"basePath":"","hasChatPermissions":true,"hasWebMcpPermissions":true,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-rbac-roles","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"site-roles","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-metadata","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"sso-setup-deadline-banner","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"live-agents","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"starter-pricing","enabled":true,"variant":{"name":"control","enabled":true,"payload":{"type":"string","value":"control"},"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"wildcard-email-auth","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"starterQuestions":[],"googleFontsInlined":false},"customCss":[]}
{"page":{"pagePath":"workflows/sdk/python/defining-cloud-resources","slug":"/workflows/sdk/python/defining-cloud-resources","pageMetadata":{"title":"Defining Cloud Resources","description":"When a workflow is executed and tasks are scheduled, the machines needed to run the task are provisioned automatically and managed for the user until task completion. Tasks can be annotated with the resources they are expected to consume (eg. CPU, RAM, GPU) at runtime and these requests will be fullfilled during the scheduling process.","sidebarTitle":"Cloud Resources","icon":"cloud","iconType":"solid","href":"/workflows/sdk/python/defining-cloud-resources"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"When a workflow is executed and tasks are scheduled, the machines needed to run the task are provisioned automatically and managed for the user until task completion. Tasks can be annotated with the resources they are expected to consume (eg. CPU, RAM, GPU) at runtime and these requests will be fullfilled during the scheduling process.\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={code:`code`,li:`li`,p:`p`,pre:`pre`,span:`span`,ul:`ul`,..._provideComponents(),...props.components},{CodeBlock,Heading,Warning}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Warning)_missingMdxReference(`Warning`,true);return _jsxs(_Fragment,{children:[_jsx(Heading,{level:`2`,id:`prespecified-task-resource`,children:`Prespecified Task Resource`}),`\n`,_jsx(_components.p,{children:`The Latch SDK currently supports a set of prespecified task resource requests\nrepresented as decorators:`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`small_task`}),`: 2 cpus, 4 gigs of memory, 0 gpus`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`medium_task`}),`: 32 cpus, 128 gigs of memory, 0 gpus`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`large_task`}),`: 96 cpus, 192 gig sof memory, 0 gpus`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`small_gpu_task`}),`: 8 cpus, 32 gigs of memory, 1 gpu (24 gigs of VRAM, 9,216 cuda cores)`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`large_gpu_task`}),`: 31 cpus, 120 gigs of memory, 1 gpu (24 gigs of VRAM, 9,216 cuda cores)`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`v100_x1_task`}),`: 16 cpus, 64 gigs of memory, 1 V100 gpu (16 gigs of VRAM, 5,120 cuda cores)`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`v100_x4_task`}),`: 64 cpus, 256 gigs of memory, 4 V100 gpus (64 gigs of VRAM, 20,480 cuda cores)`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`v100_x8_task`}),`: 128 cpus, 512 gigs of memory, 8 V100 gpus (128 gigs of VRAM, 40,960 cuda cores)`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`g6e_xlarge_task`}),`: 4 cpus, 32 gigs of memory, 1 L40s gpu`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`g6e_2xlarge_task`}),`: 8 cpus, 64 gigs of memory, 1 L40s gpu`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`g6e_4xlarge_task`}),`: 16 cpus, 128 gigs of memory, 1 L40s gpu`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`g6e_8xlarge_task`}),`: 32 cpus, 256 gigs of memory, 1 L40s gpu`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`g6e_12xlarge_task`}),`: 48 cpus, 384 gigs of memory, 1 L40s gpu`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`g6e_16xlarge_task`}),`: 64 cpus, 512 gigs of memory, 1 L40s gpu`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`g6e_24xlarge_task`}),`: 96 cpus, 768 gigs of memory, 4 L40s gpus`]}),`\n`]}),`\n`,_jsx(_components.p,{children:`We use the tasks as follows:`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`13`,language:`python`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`python`,children:_jsxs(_components.code,{language:`python`,numberOfLines:`13`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` latch.resources.tasks `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` small_task, large_gpu_task, v100_x1_task, g6e_xlarge_task`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`@small_task`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`def`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` my_task`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` ...`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`):`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D4D4D4`},children:` ...`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`@large_gpu_task`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`def`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` inference`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` ...`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`):`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D4D4D4`},children:` ...`})}),`\n`]})})}),`\n`,_jsx(Heading,{level:`2`,id:`custom-task-resource`,children:`Custom Task Resource`}),`\n`,_jsxs(_components.p,{children:[`You can also arbitrarily specify task resources using `,_jsx(_components.code,{children:`@custom_task`}),`:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`7`,language:`python`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`python`,children:_jsxs(_components.code,{language:`python`,numberOfLines:`7`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` latch `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` custom_task`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`@custom_task`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(cpu, memory) `}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# cpu: int, memory: int`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`def`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` my_task`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` ...`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`):`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D4D4D4`},children:` ...`})}),`\n`]})})}),`\n`,_jsx(_components.p,{children:`THe maximum available resources are 126 cpus, 975 GiB memory, and 4949 GiB ephemeral storage.`}),`\n`,_jsx(Heading,{level:`2`,id:`dynamic-task-resource`,children:`Dynamic Task Resource`}),`\n`,_jsxs(_components.p,{children:[`You can dynamically define task resources based on the tasks’ input\nparameters by passing functions as arguments for the `,_jsx(_components.code,{children:`custom_task`}),` decorator.\nThe provided functions will execute at runtime, and the task will launch\nwith the resulting resource values:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`14`,language:`python`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`python`,children:_jsxs(_components.code,{language:`python`,numberOfLines:`14`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D4D4D4`},children:`...`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` latch `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` custom_task`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` latch.types.file `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` LatchFile`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`def`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` allocate_cpu`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`files`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: List[LatchFile], `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`**`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`kwargs`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) -> `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:`int`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# number of cores to allocate`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` return`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:` min`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`8`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:`len`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(files))`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`def`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` allocate_storage`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`files`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: List[LatchFile], `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`**`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`kwargs`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) -> `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:`int`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# GiBs of storage to allocate`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` return`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:` sum`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`([`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`1.5`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` *`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#D4D4D4`},children:` file`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.size() `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`for`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#D4D4D4`},children:` file`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` in`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` files]) `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`//`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:` 1024`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`**`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`3`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`@custom_task`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`cpu`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`allocate_cpu, `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`memory`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`8`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`storage_gib`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`allocate_storage)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`def`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` my_task`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`files`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: List[LatchFile], `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`count`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:`int`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`):`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D4D4D4`},children:` ...`})}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`In the provided example, the `,_jsx(_components.code,{children:`allocate_cpu`}),` function is designed to process the\ninput parameters `,_jsx(_components.code,{children:`files`}),`. Upon execution, the function returns an integer representing\nthe total number of CPU cores that should be allocated to the task based on the input\nfile size.`]}),`\n`,_jsx(Warning,{children:_jsxs(_components.p,{children:[`The parameters passed to the resource functions at runtime are the same as\nthose passed to the task function. Therefore, the resource functions must only\naccept parameters that exist in the task function signature. See how the\n`,_jsx(_components.code,{children:`my_task`}),` function and the `,_jsx(_components.code,{children:`allocate_cpu`}),` function both accept a parameter\nnamed `,_jsx(_components.code,{children:`files`}),` of type `,_jsx(_components.code,{children:`List[LatchFile]`}),`.`]})})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"Defining Cloud Resources","description":"When a workflow is executed and tasks are scheduled, the machines needed to run the task are provisioned automatically and managed for the user until task completion. Tasks can be annotated with the resources they are expected to consume (eg. CPU, RAM, GPU) at runtime and these requests will be fullfilled during the scheduling process.","sidebarTitle":"Cloud Resources","icon":"cloud","iconType":"solid","href":"/workflows/sdk/python/defining-cloud-resources"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Prespecified Task Resource","slug":"prespecified-task-resource","depth":2,"children":[]},{"title":"Custom Task Resource","slug":"custom-task-resource","depth":2,"children":[]},{"title":"Dynamic Task Resource","slug":"dynamic-task-resource","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":["/_mintlify/custom/latchbio/1643336dc262c788/syft.js","/_mintlify/custom/latchbio/1643336dc262c788/data/syft.js","/_mintlify/custom/latchbio/1643336dc262c788/start/syft.js","/_mintlify/custom/latchbio/1643336dc262c788/wiki/syft.js","/_mintlify/custom/latchbio/1643336dc262c788/workflows/syft.js"],"subdomain":"latchbio","siteName":"LatchBio","title":"Defining Cloud Resources - LatchBio","contextualStarterQuestions":[],"navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-01-23T20:48:03.781Z","originalFileLocation":"workflows/sdk/python/defining-cloud-resources.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"When a workflow is executed and tasks are scheduled, the machines needed to run the task are provisioned automatically and managed for the user until task completion. Tasks can be annotated with the resources they are expected to consume (eg. CPU, RAM, GPU) at runtime and these requests will be fullfilled during the scheduling process.\">\u003cmeta data-mint-head name=\"application-name\" content=\"LatchBio\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/latchbio/RhSEdiC7Zz8UPgc7/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/latchbio/RhSEdiC7Zz8UPgc7/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/latchbio/RhSEdiC7Zz8UPgc7/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/latchbio/RhSEdiC7Zz8UPgc7/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/latchbio/RhSEdiC7Zz8UPgc7/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/latchbio/RhSEdiC7Zz8UPgc7/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/latchbio/RhSEdiC7Zz8UPgc7/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/latchbio/RhSEdiC7Zz8UPgc7/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/latchbio/RhSEdiC7Zz8UPgc7/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Defining Cloud Resources - LatchBio\">\u003cmeta data-mint-head property=\"og:description\" content=\"When a workflow is executed and tasks are scheduled, the machines needed to run the task are provisioned automatically and managed for the user until task completion. Tasks can be annotated with the resources they are expected to consume (eg. CPU, RAM, GPU) at runtime and these requests will be fullfilled during the scheduling process.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"LatchBio\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://wiki.latch.bio/workflows/sdk/python/defining-cloud-resources\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://latchbio.mintlify.site/_mintlify/api/og/v2?division=Python+SDK\u0026amp;title=Defining+Cloud+Resources\u0026amp;description=When+a+workflow+is+executed+and+tasks+are+scheduled%2C+the+machines+needed+to+run+the+task+are+provisioned+automatically+and+managed+for+the+user+until+task+compl\u0026amp;theme=d90b8111872316c70d8029f9\u0026amp;signature=f77aeeac1e1251d63e0d9d0617ce6adb1f6b9743e1bbc37e49952c7b32d300f8\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Defining Cloud Resources - LatchBio\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"When a workflow is executed and tasks are scheduled, the machines needed to run the task are provisioned automatically and managed for the user until task completion. Tasks can be annotated with the resources they are expected to consume (eg. CPU, RAM, GPU) at runtime and these requests will be fullfilled during the scheduling process.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://latchbio.mintlify.site/_mintlify/api/og/v2?division=Python+SDK\u0026amp;title=Defining+Cloud+Resources\u0026amp;description=When+a+workflow+is+executed+and+tasks+are+scheduled%2C+the+machines+needed+to+run+the+task+are+provisioned+automatically+and+managed+for+the+user+until+task+compl\u0026amp;theme=d90b8111872316c70d8029f9\u0026amp;signature=f77aeeac1e1251d63e0d9d0617ce6adb1f6b9743e1bbc37e49952c7b32d300f8\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/latchbio/RhSEdiC7Zz8UPgc7/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"LatchBio\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#001AAE\">\u003clink data-mint-head rel=\"canonical\" href=\"https://wiki.latch.bio/workflows/sdk/python/defining-cloud-resources\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/workflows/sdk/python/defining-cloud-resources.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://wiki.latch.bio/#organization\",\"name\":\"LatchBio\",\"url\":\"https://wiki.latch.bio\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/latchbio/rAgK9Jh7PMGtmcOA/logo/light.svg?fit=max\u0026auto=format\u0026n=rAgK9Jh7PMGtmcOA\u0026q=85\u0026s=4d10f1ae3113e21d7923ecaec6c9557e\"}},{\"@type\":\"WebSite\",\"@id\":\"https://wiki.latch.bio#website\",\"name\":\"LatchBio\",\"url\":\"https://wiki.latch.bio\",\"publisher\":{\"@id\":\"https://wiki.latch.bio/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://wiki.latch.bio/workflows/sdk/python/defining-cloud-resources#webpage\",\"url\":\"https://wiki.latch.bio/workflows/sdk/python/defining-cloud-resources\",\"name\":\"Defining Cloud Resources\",\"description\":\"When a workflow is executed and tasks are scheduled, the machines needed to run the task are provisioned automatically and managed for the user until task completion. Tasks can be annotated with the resources they are expected to consume (eg. CPU, RAM, GPU) at runtime and these requests will be fullfilled during the scheduling process.\",\"dateModified\":\"2026-01-23T20:48:03.781Z\",\"isPartOf\":{\"@id\":\"https://wiki.latch.bio#website\"},\"breadcrumb\":{\"@id\":\"https://wiki.latch.bio/workflows/sdk/python/defining-cloud-resources#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://wiki.latch.bio/workflows/sdk/python/defining-cloud-resources#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Developer Tools\",\"item\":\"https://wiki.latch.bio/workflows/sdk/python/overview\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Python SDK\",\"item\":\"https://wiki.latch.bio/workflows/sdk/python/overview\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Defining Cloud Resources\",\"item\":\"https://wiki.latch.bio/workflows/sdk/python/defining-cloud-resources\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://wiki.latch.bio/workflows/sdk/python/defining-cloud-resources#article\",\"headline\":\"Defining Cloud Resources\",\"name\":\"Defining Cloud Resources\",\"description\":\"When a workflow is executed and tasks are scheduled, the machines needed to run the task are provisioned automatically and managed for the user until task completion. Tasks can be annotated with the resources they are expected to consume (eg. CPU, RAM, GPU) at runtime and these requests will be fullfilled during the scheduling process.\",\"url\":\"https://wiki.latch.bio/workflows/sdk/python/defining-cloud-resources\",\"mainEntityOfPage\":{\"@id\":\"https://wiki.latch.bio/workflows/sdk/python/defining-cloud-resources#webpage\"},\"dateModified\":\"2026-01-23T20:48:03.781Z\",\"publisher\":{\"@id\":\"https://wiki.latch.bio/#organization\"},\"isPartOf\":{\"@id\":\"https://wiki.latch.bio#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"LatchBio\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"LatchBio\"},\"provider\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","agentPointerHref":"/workflows/sdk/python/defining-cloud-resources.md","siteName":"LatchBio","nav":{"global":{"tabs":[{"tab":"Blog","href":"https://latchbio.substack.com/"},{"tab":"Website","href":"https://latch.bio/"},{"tab":"Change Log","href":"https://latchbio.notion.site/LatchBio-Product-Change-Logs-ca76a6ae05a74a4daf78cb4006ad80ac"}]},"anchors":[{"anchor":"Introduction","icon":"house","pages":[{"title":"Introduction","href":"/start/introduction"}]},{"anchor":"Data","icon":"file-chart-column","pages":[{"title":"Data","href":"/data/overview"}]},{"anchor":"Registry","icon":"table","pages":[{"title":"Registry","href":"/registry/what-is-a-registry"}]},{"anchor":"Workflows \u0026 SDK","icon":"screwdriver-wrench","groups":[{"group":"Workflows \u0026 SDK","pages":[{"title":"What are Latch Workflows?","sidebarTitle":"Overview","icon":"window","iconType":"solid","href":"/workflows/overview"}]},{"group":"Developer Tools","pages":[{"group":"Python SDK","icon":"https://upload.wikimedia.org/wikipedia/commons/c/c3/Python-logo-notext.svg","pages":[{"title":"Overview","sidebarTitle":"Overview","icon":"magnifying-glass","iconType":"solid","href":"/workflows/sdk/python/overview"},{"title":"Quick Start","icon":"play","iconType":"solid","href":"/workflows/sdk/python/quick-start"},{"title":"Tutorial","icon":"arrow-progress","iconType":"duotone","href":"/workflows/sdk/python/authorizing-your-own-workflow"},{"title":"Workflow Environment","sidebarTitle":"Workflow Environment","icon":"docker","href":"/workflows/sdk/python/workflow-environment/overview"},{"title":"Environments for Individual Tasks","sidebarTitle":"Per Task Environments","icon":"docker","description":null,"href":"/workflows/sdk/python/workflow-environment/environments-for-individual-tasks"},{"title":"Defining Cloud Resources","sidebarTitle":"Cloud Resources","icon":"cloud","iconType":"solid","href":"/workflows/sdk/python/defining-cloud-resources"},{"title":"Caching and Resuming","icon":"window-restore","iconType":"solid","description":null,"href":"/workflows/sdk/python/caching"},{"title":"Conditional Sections","icon":"code-branch","iconType":"solid","href":"/workflows/sdk/python/conditional-sections"},{"title":"Map Task","sidebarTitle":"Task Parallelization","icon":"grip-lines-vertical","iconType":"solid","href":"/workflows/sdk/python/map-task"}]},{"group":"Nextflow SDK","icon":"https://files.svgcdn.io/vscode-icons/file-type-nextflow.png","pages":[{"title":"Overview","icon":"magnifying-glass","iconType":"solid","href":"/workflows/sdk/nextflow/overview"},{"title":"Tutorial","icon":"arrow-progress","iconType":"duotone","href":"/workflows/sdk/nextflow/tutorial"},{"title":"Execution Profiles","icon":"user","iconType":"solid","href":"/workflows/sdk/nextflow/profiles"},{"title":"Caching and Resuming","icon":"window-restore","iconType":"solid","href":"/workflows/sdk/nextflow/caching"},{"title":"Dependencies","icon":"arrow-progress","iconType":"solid","href":"/workflows/sdk/nextflow/dependencies"},{"title":"Private Registries","icon":"lock","iconType":"solid","href":"/workflows/sdk/nextflow/registries"},{"title":"Shared Storage","icon":"hard-drive","iconType":"solid","href":"/workflows/sdk/nextflow/shared-storage"},{"title":"Using GPU Accelerators","icon":"microchip","iconType":"solid","href":"/workflows/sdk/nextflow/gpus"},{"title":"Debugging Nextflow","icon":"bug","iconType":"solid","href":"/workflows/sdk/nextflow/debugging"}]},{"group":"Snakemake SDK","icon":"https://avatars.githubusercontent.com/u/33450111?s=200\u0026v=4","pages":[{"title":"Overview","icon":"magnifying-glass","iconType":"solid","href":"/workflows/sdk/snakemake-v2/overview"},{"title":"Tutorial","icon":"arrow-progress","iconType":"duotone","href":"/workflows/sdk/snakemake-v2/tutorial"},{"title":"Metadata","icon":"palette","iconType":"solid","href":"/workflows/sdk/snakemake-v2/metadata"},{"title":"Parameter Encoding","icon":"file-code","iconType":"solid","href":"/workflows/sdk/snakemake-v2/encoding"},{"title":"The Entrypoint","icon":"circle-play","href":"/workflows/sdk/snakemake-v2/entrypoint"},{"title":"Using Latch Storage","icon":"database","iconType":"solid","href":"/workflows/sdk/snakemake-v2/storage"},{"title":"Using the Latch Executor Plugin","icon":"person-biking","iconType":"solid","href":"/workflows/sdk/snakemake-v2/executor"},{"title":"Writing the Dockerfile","icon":"docker","iconType":"solid","href":"/workflows/sdk/snakemake-v2/dockerfile"}]},{"group":"CLI","icon":"square-terminal","pages":[{"title":"Commands","icon":"terminal","iconType":"solid","href":"/workflows/sdk/cli/commands"},{"title":"Latch URLs","icon":"link","iconType":"solid","href":"/workflows/sdk/python/latch-urls"}]},{"group":"API","icon":"webhook","pages":[{"group":"Registry","icon":"table","pages":[{"title":"Overview","icon":"table-tree","iconType":"solid","href":"/registry/sdk/latch-sdk-registry-integration"},{"title":"Account Objects","icon":"user","iconType":"solid","href":"/registry/sdk/account-objects"},{"title":"Registry Projects","icon":"diagram-project","iconType":"solid","href":"/registry/sdk/registry-projects"},{"title":"Table Objects","icon":"table","iconType":"solid","href":"/registry/sdk/table-objects"},{"title":"Record Objects","icon":"table-rows","iconType":"solid","href":"/registry/sdk/record-objects"},{"title":"Registry Usage Tutorial","sidebarTitle":"Usage Tutorial","icon":"arrow-progress","iconType":"duotone","href":"/workflows/sdk/api/registry-usage-tutorial"}]},{"title":"Plot Artifacts","sidebarTitle":"Plots Artifacts","icon":"file","iconType":"solid","href":"/plots/developer/artifacts"},{"title":"Remote Files","sidebarTitle":"Remote Files","icon":"file-arrow-down","iconType":"solid","href":"/workflows/sdk/api/working-with-files"},{"title":"LatchFile / LatchDir (Legacy)","icon":"file-arrow-down","iconType":"solid","href":"/workflows/sdk/python/legacy-file-support"},{"title":"Storing and Using Secrets","sidebarTitle":"Secrets","icon":"key","iconType":"solid","href":"/workflows/sdk/api/storing-and-using-secrets"}]}]},{"group":"Workflow User Interface","pages":[{"title":"UI Definition","icon":"palette","iconType":"solid","href":"/workflows/sdk/ui/latch-metadata"},{"title":"Launch Plans","icon":"rocket","iconType":"solid","href":"/workflows/sdk/ui/launch-plans"},{"title":"Messages","icon":"message","iconType":"solid","href":"/workflows/sdk/ui/messages"},{"title":"Results","icon":"square-poll-vertical","iconType":"solid","href":"/workflows/sdk/ui/results"}]},{"group":"Testing","pages":[{"title":"Development and Debugging","icon":"bug","iconType":"solid","href":"/workflows/sdk/testing-and-debugging-a-workflow/development-and-debugging"},{"title":"Programmatic Execution","icon":"code","iconType":"solid","href":"/workflows/sdk/testing-and-debugging-a-workflow/programmatic-execution"}]},{"group":"Latch Console Dashboard","pages":[{"title":"Overview","icon":"umbrella","iconType":"solid","href":"/workflows/sdk/console/execution-monitoring"},{"title":"Resource Monitoring","icon":"memory","iconType":"solid","href":"/workflows/sdk/console/resource-monitoring"},{"title":"Versioning","icon":"code-compare","iconType":"solid","href":"/workflows/sdk/console/versioning"},{"group":"Automation","icon":"robot","pages":[{"title":"Overview","icon":"magnifying-glass","iconType":"solid","href":"/workflows/sdk/automation/overview"},{"title":"Data Addition Trigger","sidebarTitle":"Example Data Addition Trigger","icon":"table","iconType":"solid","href":"/workflows/sdk/automation/example-data-addition"},{"title":"Interval Trigger","sidebarTitle":"Example Interval Trigger","icon":"alarm-snooze","iconType":"solid","href":"/workflows/sdk/automation/example-interval"}]}]},{"group":"Ready-to-Use Workflows","pages":[{"group":"Bulk RNA-seq","pages":[{"title":"What is Bulk RNAseq?","icon":"flask-gear","iconType":"solid","sidebarTitle":"Bulk RNA Seq Overview","href":"/workflows/bulk-rna-seq-deep-dive"},{"title":"Bulk RNAseq Quantification Walkthrough","icon":"screwdriver-wrench","iconType":"solid","sidebarTitle":"Bulk RNA Seq","href":"/workflows/bulk-rna-seq"}]},{"group":"ATAC-seq","pages":[{"title":"What is ATAC seq?","icon":"flask-gear","iconType":"solid","sidebarTitle":"ATAC Seq Overview","href":"/workflows/ATAC-Seq-Deep-Dive"},{"title":null,"icon":"screwdriver-wrench","iconType":"solid","sidebarTitle":"ATAC Seq","href":"/workflows/ATAC-Seq"}]},{"title":"CRISPResso2","href":"/workflows/crispresso2"},{"title":"CAS-OFFinder","href":"/workflows/cas-offinder"},{"title":"CRISPOR","href":"/workflows/crispor"},{"title":"AlphaFold","href":"/workflows/alphafold"},{"group":"MAGeCK","pages":[{"title":"Overview - MAGeCK","href":"/workflows/mageck-overview"},{"title":"MAGeCK - Count","href":"/workflows/mageck-count"},{"title":"MAGeCK - Test","href":"/workflows/mageck-test"},{"title":"MAGeCK - MLE","href":"/workflows/mageck-mle"},{"title":"MAGeCK - Pathway","href":"/workflows/mageck-pathway"},{"title":"MAGeCK - Plot","href":"/workflows/mageck-plot"}]},{"title":"CSV Parameter Import","icon":"file-import","iconType":"solid","href":"/workflows/csv-import"}]}]},{"anchor":"Pods","icon":"hexagon","pages":[{"title":"Pods","href":"/pods/overview"}]},{"anchor":"Plots","icon":"chart-scatter-bubble","pages":[{"title":"Plots","href":"/plots/overview"}]},{"anchor":"Agent","icon":"robot","pages":[{"title":"Agent","href":"/agent/overview"}]},{"anchor":"Curate","icon":"dna","pages":[{"title":"Curate","href":"/curate/overview"}]},{"anchor":"Administration","icon":"screen-users","pages":[{"title":"Administration","href":"/admin/overview"}]},{"anchor":"Resources","icon":"clipboard-question","pages":[{"title":"Resources","href":"/resources/faq"}]},{"anchor":"API Reference","icon":"webhook","pages":[{"title":"API Reference","href":"/reference/sdk"}]}]},"basePath":"","title":"Defining Cloud Resources - LatchBio","deploymentId":"dpl_9bQLTw9nc2h9csDGYcKwWenPcQWn","buildId":"dpl_9bQLTw9nc2h9csDGYcKwWenPcQWn","dynamics":[],"chunks":[]}