Skip to main content
Start an HTTP server that wraps the agent at the given import path.

Usage

motus serve start <agent> [options]

Positional argument

agent
string
required
Python import path to the agent object in module:variable format. For example, myapp:my_agent imports my_agent from myapp.py. The object must be importable from the working directory.

Options

FlagDefaultDescription
--host0.0.0.0Network address to bind to
--port8000Port to listen on
--workersCPU countMaximum concurrent worker processes
--ttl0Idle/error session expiry in seconds (0 disables expiry)
--timeout0Maximum seconds per agent turn before the worker is killed (0 means no limit)
--max-sessions0Maximum number of concurrent sessions (0 means unlimited)
--shutdown-timeout0Seconds to wait for in-flight tasks on shutdown before cancelling (0 waits indefinitely)
--allow-custom-idsfalseEnable PUT /sessions/{id} so clients can specify their own session IDs
--log-levelinfoLog verbosity: debug, info, warning, or error

Examples

Start with custom port and workers

motus serve start myapp:my_agent --port 8080 --workers 8

Enable custom session IDs with idle TTL

motus serve start myapp:my_agent --allow-custom-ids --ttl 3600

Limit concurrency and set a per-turn timeout

motus serve start myapp:my_agent --max-sessions 50 --timeout 30