Deployment Config Reference
LlamaDeploy reads configuration from your repository to run your app. This appears in either a pyproject.toml
, or a llama_deploy.yaml
/llama_deploy.toml
If a UI is configured, values can also be extended from the UI’s package.json
.
File Formats
Section titled “File Formats”pyproject.toml
Section titled “pyproject.toml”[tool.llamadeploy]name = "my-app"env_files = [".env"]# specify only one of app or workflows.# Use an app to configure your workflow names# in code.# app = "my_package.app:app"[tool.llamadeploy.workflows]my_workflow = "my_package.my_workflow:workflow"
[tool.llamadeploy.ui]directory = "ui"build_output_dir = "ui/static"
YAML/TOML
Section titled “YAML/TOML”You can also create a yaml or toml configuration file that contains the same keys and values under the tool.llamadeploy
name: my-appenv_files: - .envworkflows: my_workflow: "my_package.my_workflow:workflow"ui: directory: "ui" build_output_dir: "ui/static"
name = "my-app"env_files = [".env"]
[workflows]my_workflow = "my_package.my_workflow:workflow"
[ui]directory = "ui"build_output_dir = "ui/static"
You can also define the UI attributes in your package.json
. Note however that you must still configure
the ui
> directory
, otherwise the package.json
won’t be discovered.
{ "name": "my-ui", // ... "llamadeploy": { "build_output_dir": "static" }}
Schema
Section titled “Schema”DeploymentConfig fields
Section titled “DeploymentConfig fields”Field | Type | Default | Description |
---|---|---|---|
name | string | "default" | URL-safe deployment name. In pyproject.toml , if omitted it falls back to project.name . |
app | string "module.path:app_name" | — | Single app entrypoint. Mutually exclusive with workflows . |
workflows | map<string,string> | — | Map of workflowName -> "module.path:workflow" . Do not use with app . |
env_files | list<string> | [".env"] | Paths to env files to load. Relative to the config file. Duplicates are de-duplicated. |
env | map<string,string> | {} | Environment variables injected at runtime. |
ui | UIConfig | null | Optional UI configuration. directory is required if ui is present. |
UIConfig fields
Section titled “UIConfig fields”Field | Type | Default | Description |
---|---|---|---|
directory | string | — | Path to UI source, relative to the config directory. Required when ui is set. |
build_output_dir | string | ${directory}/dist | Built UI output directory. If set in TOML/pyproject , path is relative to the config file. If set via package.json llamadeploy.build_output_dir , it is resolved as ${directory}/${build_output_dir} . |
package_manager | string | "npm" (or inferred) | Package manager used to build the UI. If not set, inferred from package.json packageManager (e.g., pnpm@9.0.0 → pnpm ). |
build_command | string | "build" | NPM script name used to build. |
serve_command | string | "dev" | NPM script name used to serve in development. |
proxy_port | integer | 4502 | Port the appserver proxies to in development. |
Validation
Section titled “Validation”- You must set either
app
or at least one entry inworkflows
. - You cannot set both
app
andworkflows
at the same time.
UI Integration via package.json
Section titled “UI Integration via package.json”Example package.json
snippet in ui.directory
:
{ "name": "my-ui", "packageManager": "pnpm@9.7.0", "scripts": { "build": "vite build", "dev": "vite" }, "llamadeploy": { "build_output_dir": "dist", "package_manager": "pnpm", "build_command": "build", "serve_command": "dev", "proxy_port": 5173 }}
Build output resolution
Section titled “Build output resolution”config.build_output_path()
returnsui.build_output_dir
when set; otherwise${ui.directory}/dist
.- Use
build_output_dir
for production builds; the default is suitable for typical Vite/React build layouts.