Skip to main content
Using an AI coding assistant? Install the Konduktor Skills plugin (npx skills add Trainy-ai/konduktor-skills) to let your AI generate Python SDK code for you — run /draft-python-task to get started.

When to use the Python API

The CLI YAML format remains the primary way to describe jobs, but the same capabilities are exposed through the Python package. Use it when you want to:
  • Generate tasks dynamically inside your own tooling.
  • Share a reusable Python helper that sets up common resources or file mounts.
  • Launch quick experiments without writing YAML files.

Available entry points

konduktor.Task

Useful setters:
  • task.set_resources(konduktor.Resources(...))
  • task.set_file_mounts({"/remote/path": "./local"})
  • task.set_serving(konduktor.Serving(...)) when serving deployments.

konduktor.Resources

konduktor.Serving

konduktor.launch

Submits the task. When dryrun=True, Konduktor prints the rendered spec instead of launching. detach_run=True returns immediately after submission; otherwise logs stream until completion. The return value is the job ID when available.

Example

Save the file (for example as launch_from_python.py) and run: