synth-ai modal-serve streams a task app into Modal for an interactive session.
- App selection works the same as other task-app commands: skip
APP_IDto pick from the discovered list, or specify one directly. .envfiles supplied via--env-file, declared on the registry entry, or auto-discovered are loaded before launch. If no file exists the helper walks you through creating one soENVIRONMENT_API_KEYis always available.- Missing keys trigger prompts (and minting when supported) before the Modal CLI runs. Successful values are written back to disk for future reuse.
- When an entry ships its own Modal script the CLI runs it verbatim; otherwise it generates a temporary entrypoint that installs
synth-ai, mounts the necessary directories, appliesModalDeploymentConfig, and boots your FastAPI app. - Secrets for
ENVIRONMENT_API_KEY,ENVIRONMENT_API_KEY_ALIASES, and optional vendor keys are inlined into the Modal command so you don’t need to configure them separately. - The command resolves which Modal CLI to use automatically—preferring a real
modalbinary on PATH, falling back to the built-in shim when only the Python package is installed, and honoring--modal-cliorSYNTH_FORCE_MODAL_WRAPPER=1when you need explicit control. - Output from
modal serveis streamed back in real time. If Modal prints a public URL (e.g.=> https://your-app.modal.run) it is saved to the first.envasTASK_APP_BASE_URLfor follow-on commands.
Options
APP_ID— Task app identifier. Omit to open the interactive picker; provide one to bypass the prompt.--env-file PATH— One or more.envfiles to load before invoking Modal. Repeat the flag to merge multiple files.--modal-cli PATH— Explicit Modal CLI executable. Useful when the binary lives outside your PATH or when you need to pin a specific version.--name VALUE— Modal app name override passed directly tomodal serve --name. Handy when you want distinct app names for development vs. staging runs.
Notes
- Script-backed apps (
modal_script) bypass the generated entrypoint and run the author-provided script instead. - Inline secrets let Modal reach your backend without further setup, but you can still mount Modal secrets via
ModalDeploymentConfigwhen you need long-term storage. - Because this command starts an interactive Modal session, closing the CLI stops the app. Use
synth-ai deploywhen you need a persistent deployment.