Modal logo
GuideExamplesReferencePlayground
Log In Sign Up
Changelog API Reference modal.Appmodal.Clientmodal.CloudBucketMountmodal.Clsmodal.Cronmodal.Dictmodal.Errormodal.FilePatternMatchermodal.Functionmodal.FunctionCallmodal.Imagemodal.NetworkFileSystemmodal.Periodmodal.Proxymodal.Queuemodal.Retriesmodal.Sandboxmodal.SandboxSnapshotmodal.Secretmodal.Tunnelmodal.Volumemodal.asgi_appmodal.batchedmodal.call_graphmodal.concurrentmodal.container_processmodal.current_function_call_idmodal.current_input_idmodal.enable_outputmodal.entermodal.exitmodal.fastapi_endpointmodal.file_iomodal.forwardmodal.gpumodal.interactmodal.io_streamsmodal.is_localmodal.methodmodal.parametermodal.web_endpointmodal.web_servermodal.wsgi_appmodal.exceptionmodal.config CLI Reference modal appmodal configmodal containermodal deploymodal dictmodal environmentmodal launchmodal nfsmodal profilemodal queuemodal runmodal secretmodal servemodal setupmodal shellmodal tokenmodal volume

modal.parameter

def parameter(*, default: Any = _no_default, init: bool = True) -> Any:

Used to specify options for modal.cls parameters, similar to dataclass.field for dataclasses

class A:
    a: str = modal.parameter()

If init=False is specified, the field is not considered a parameter for the Modal class and not used in the synthesized constructor. This can be used to optionally annotate the type of a field that’s used internally, for example values being set by @enter lifecycle methods, without breaking type checkers, but it has no runtime effect on the class.

modal.parameter
Modal logo © 2025
About Status Changelog Documentation Slack Community Pricing Examples