Skip to content
qgonDEV DOCSSDK 0.3.31
ENKR

qgon command

In the appBuild › Scheduling

qgon run

Runs a script with tracking in this workspace, or sends it to a GPU queue to run on an agent.

qgon run [options] [python] script.py | -m module [args...]
Options
OptionNotes
--waitfollows the log and exits with the run's exit code when it ends (completed 0 · script sys.exit(n) gives n · exception 1 · code download failed 3 · package install failed 4 · removed from the queue 5 · status check failed 75 · --timeout exceeded 124 · run stopped 130 · Ctrl-C while waiting 130, and the run keeps going)
--timeout SEClimits --wait to this many seconds
--dry-runshows the files to upload, the files left out and the packages to install, without sending anything
--jsonprints the result as one line of JSON, the last line of standard output (for the web app and scripts, no prompts): {"ok":true,"task_id":…,"url":…,"project":…,"name":…,"queue":…,"image":…,"env":…,"files":…,"bytes":…} On failure {"ok":false,"error":"…","code":2}. With --wait, "status" and "exit_code" are added after the run ends. Cannot be combined with --dry-run. Messages always go to standard error
--packagesextra packages to install (comma-separated). requirements.txt and pyproject.toml are installed automatically
--env VERSIONruns with the image of an environment version saved from a workspace with "Save environment". 3 or v3 = v3 of the current workspace, team-a:v3 = another workspace (you must be a member). The server checks that it exists and that you may use it when the run is sent. Cannot be combined with --image
--imagetask image (advanced: only images the admin allows that derive from the device task image; the entry script needs Python and the engine. The default is the device task image)
--draftcreates a draft (status created) without queueing it, as the source of a pipeline step. It goes to the hidden subproject <project>/.qgon-pipeline-steps with the tag qgon-pipe-step. Queue checks and policy are the same as --queue. No --wait
--task-typerun type: training (default) | data_processing | custom
--team TEAMthe team this run counts against (hyperparameter qgon/team). If left out, the server decides: workspace team, then primary team. Only teams you belong to are accepted. If you are not a member, or that team may not use this queue's pool, the run is not sent. Without --queue, in this workspace the team is only recorded on the run (if you clone the run in the web app and queue it, it counts against that team)
Full help text (qgon run -h)
qgon commands.
Run in this workspace with tracking:
qgon run [--project P] [--name N] [--tags a,b] python train.py --lr 0.01
qgon run --project P train.py --lr 0.01 # python can be left out
qgon run --project P -m mypkg.train --lr 0.01 # run a module
qgon run --team vision python train.py # set the team (see --team below)
Send to a GPU agent (uploads the code in the current folder and runs it from a queue):
qgon run --queue gpu [--project P] [--name N] [--tags a,b] [--packages a,b] [--no-requirements]
[--env VERSION | --image IMAGE] [--wait [--timeout SEC]] [--dry-run] -- python train.py --lr 0.01
qgon run --remote … # without --queue, the default queue (gpu, env var QGON_QUEUE)
--wait follows the log and exits with the run's exit code when it ends
(completed 0 · script sys.exit(n) gives n · exception 1 · code download failed 3 · package install failed 4 ·
removed from the queue 5 · status check failed 75 · --timeout exceeded 124 · run stopped 130 ·
Ctrl-C while waiting 130, and the run keeps going)
--timeout SEC limits --wait to this many seconds
--dry-run shows the files to upload, the files left out and the packages to install, without sending anything
--json prints the result as one line of JSON, the last line of standard output (for the web app and scripts, no prompts):
{"ok":true,"task_id":…,"url":…,"project":…,"name":…,"queue":…,"image":…,"env":…,"files":…,"bytes":…}
On failure {"ok":false,"error":"…","code":2}. With --wait, "status" and "exit_code" are added after the run ends.
Cannot be combined with --dry-run. Messages always go to standard error
--packages extra packages to install (comma-separated). requirements.txt and pyproject.toml are installed automatically
--env VERSION runs with the image of an environment version saved from a workspace with "Save environment".
3 or v3 = v3 of the current workspace, team-a:v3 = another workspace (you must be a member).
The server checks that it exists and that you may use it when the run is sent. Cannot be combined with --image
--image task image (advanced: only images the admin allows that derive from the device task image;
the entry script needs Python and the engine. The default is the device task image)
--draft creates a draft (status created) without queueing it, as the source of a pipeline step. It goes to the hidden
subproject <project>/.qgon-pipeline-steps with the tag qgon-pipe-step. Queue checks and policy are the same as --queue. No --wait
--task-type run type: training (default) | data_processing | custom
--team TEAM the team this run counts against (hyperparameter qgon/team). If left out, the server decides: workspace team, then primary team.
Only teams you belong to are accepted. If you are not a member, or that team may not use this queue's pool,
the run is not sent. Without --queue, in this workspace the team is only recorded on the run
(if you clone the run in the web app and queue it, it counts against that team)
Left out of the upload: .gitignore and .qgonignore entries, secret files (.env, keys, certificates), virtual environments and caches, checkpoints, files over 10MB
qgon hpo --spec spec.json [--json] # hyperparameter search from a JSON spec; this process is the controller until it ends (qgon hpo -h)
qgon pipeline --spec spec.json [--json] [--def-id ID] # pipeline from a JSON spec; this process is the controller until it ends (qgon pipeline -h)
qgon info [--diag] # connected server and versions (--diag: diagnostic information for a support request)
GPU queue (qgon queue -h; admin actions need your own API key):
qgon queue ls [QUEUE] [--json] # queue order, wait reasons, running tasks
qgon queue move <task> --up | --down | --swap <task> | --top | --bottom (top and bottom are admin-only)
qgon queue urgent <task> --reason 'REASON' # urgent request · urgent ls · urgent cancel <number> · (admin) urgent approve|reject <number>
qgon queue yield <task> [--cancel] # request or cancel a GPU yield (admin, or your own task)
Inference code (predict.py) for custom inference code in the Playground (qgon serve -h):
qgon serve test --entry predict.py --model best.pt [--image a.jpg | --table '{"alcohol": 10}'] [--params '{}']
runs it once in this workspace before deploying, with the same input parsing and output checks as test serving
qgon serve pack [--json] [--entry predict.py] --out bundle.zip <code folder>
the code bundle pinned at deploy time (same exclusion rules as qgon run; limits: 20MB compressed, 50MB extracted, 2000 files, 10MB per file)
`run` turns on tracking without changing your code: it calls init() right before the script starts, so
argparse arguments, print output, framework model saves and GPU utilization are recorded automatically. If the script calls qgon.init(), it continues the same run.

qgon hpo

Starts a hyperparameter search from a JSON spec, with this process running as its controller until the search ends.

qgon hpo --spec <file|-> [--json]
Help
qgon hpo --spec <file|-> [--json]: starts a search from a JSON spec, with this process running as its controller until it ends.
Starting a new search on the Build › Hyperparameter search screen runs this command inside your workspace with your account. You can also run it yourself.
--json: once started, prints one line {"ok":true,"task_id":…,"project":…,"name":…} to standard output; on failure {"ok":false,"error":…,"code":2}.
When the search ends, it prints one more line {"done":true,"status":…,"best":{…}|null}. Engine logs go to standard error.
To stop: abort the search task in the web app (the server status becomes stopped) or send SIGTERM/SIGINT to this process. Running trials are aborted too.

qgon pipeline

Starts a pipeline from a JSON spec, with this process running as its controller until the pipeline ends.

qgon pipeline --spec <file|-> [--json] [--def-id ID]
Help
qgon pipeline --spec <file|-> [--json] [--def-id ID]: starts a pipeline from a JSON spec, with this process running as its controller until it ends.
Starting a new pipeline on the Build › Pipelines screen runs this command inside your workspace with your account. You can also run it yourself.
Spec form: {"name", "project", "steps":[{"id","base_task","params","queue","parents",
"condition","time_limit_min"}], "defaults":{"queue"}}. A step clones a finished experiment, changes only its parameters and sends it to a queue.
--json: once started, prints one line {"ok":true,"task_id":…,"project":…,"name":…} to standard output; on failure {"ok":false,"error":…,"code":2}.
When the pipeline ends, it prints one more line {"done":true,"status":"completed|failed|stopped","task_id":…,"steps":{step: result}}. Engine logs go to standard error.
To stop: abort the pipeline task in the web app (the server status becomes stopped) or send SIGTERM/SIGINT to this process. Running steps are aborted too.
Exit codes: completed 0 · failed 1 · stopped 130 · could not start 2.
Script steps (kind script): each time the pipeline starts, a code folder of the controller workspace is uploaded as a draft and used as the step.
--def-id <32hex>: the definition id from the pipeline list in the web app; the controller task gets the tag qgon-pipe:<id>.

qgon info

Shows the SDK version, the configuration file in use, the device addresses (API, web and file server) and the default queue for qgon run --queue.

qgon info
Help
qgon info [--diag]: shows the SDK version, the configuration file in use, the device addresses (API, web and file server) and the default queue for qgon run --queue.
--diag: also shows diagnostic information to attach to a support request: the underlying engine version, the Python version and location, and the Optuna version (needed for HPO method="optuna").
It reads the addresses from this SDK's configuration file. If no device address is configured, it shows the API address as (not configured) and prints a hint on standard error.
In a workspace terminal the configuration is already in place.
Exit codes: 0 configured · 2 no device address configured, or a usage error.

qgon serve

Tests and packages inference code (predict.py) for custom inference code in the Playground.

qgon serve test|pack ...
qgon serve test
OptionNotes
--entry-
--modelrequiredModel file or folder.
--image-
--tableJSON: {column: value} · [value…] · [{…}, …]
--paramsJSON object.
--codeCode folder (default: the current folder).
--save-imageFile to write the result image (serve.image) to.
qgon serve pack
OptionNotes
--jsonlast line of standard output {"ok":true,"out":…,"files":n,"bytes":…,"zip_bytes":…,"sha256":…,"entry_found":…,"excluded":{…}} on failure {"ok":false,"error":"…","code":"…"}
--entry-
--outrequired-
dir-
Full help text (qgon serve -h)
qgon serve: commands for deploying inference code (predict.py) as custom inference code in the Playground
qgon serve test --entry predict.py --model <file|folder> [--image picture.jpg | --table JSON] [--params JSON] [--code FOLDER]
[--save-image result.png]
Runs predict.py once in this process: load(model_dir), then predict() if an input is given, then the same checks as test serving, then the response JSON.
If --model is a file, it is linked into a temporary folder so serve.model_file() finds it. Exit codes: success 0 · failure 1 · usage error 2.
Result images (serve.image) appear in the JSON as their size instead of base64; --save-image writes them to a file (-2, -3 added to the name when there are several).
qgon serve pack [--json] [--entry predict.py] --out bundle.zip <code folder>
Builds the code bundle pinned at deploy time, with the same exclusion rules as qgon run (secret files always, .qgonignore, .gitignore,
virtual environments, checkpoint extensions, symbolic links). Limits: 10MB per file · 50MB extracted · 2000 files · 20MB compressed.
The device calls it with your account when deploying.
--json: last line of standard output {"ok":true,"out":…,"files":n,"bytes":…,"zip_bytes":…,"sha256":…,"entry_found":…,"excluded":{…}}
on failure {"ok":false,"error":"…","code":"…"}

qgon queue

Reorders the GPU queue and sends urgent requests and yield requests.

qgon queue ls|move|urgent|yield|status ...
Options
OptionNotes
--up/--downmembers: swap with their nearest own task ahead or behind (other users' tasks keep their places) · admins: one place
--top/--bottomadmins only (members send an urgent request)
--swap <task>swap with that task: members only with their own task right ahead or behind, admins only with the adjacent task (only cases a single up or down can do)
--jsonone line of result JSON on standard output: success {"ok":true,…}, failure {"ok":false,"error":"…","code":"<server error code>","status":<HTTP>}.
Full help text (qgon queue -h)
qgon queue: reorder the GPU queue, send urgent requests and yield requests (Python: from qgon import queue)
qgon queue ls [QUEUE] [--json] queue order, owners, marks and wait reasons, plus running tasks (default queue gpu, env var QGON_QUEUE)
qgon queue move <task> (--up | --down | --top | --bottom | --swap <task>) [--queue QUEUE] [--json]
--up/--down members: swap with their nearest own task ahead or behind (other users' tasks keep their places) · admins: one place
--top/--bottom admins only (members send an urgent request)
--swap <task> swap with that task: members only with their own task right ahead or behind, admins only with the adjacent task
(only cases a single up or down can do)
(moving to an arbitrary position, such as "in front of X", is not available on the server)
qgon queue urgent <task> --reason 'REASON' [--queue QUEUE] [--json] urgent request (your waiting task; moves to the front when an admin approves)
qgon queue urgent ls [--state pending|approving|approved|rejected|cancelled|all] [--json] (admins see all, members their own)
qgon queue urgent cancel <request number> [--json]
qgon queue urgent approve|reject <request number> [--note 'NOTE'] [--json] (admin)
qgon queue yield <task> [--reason 'REASON'] [--for <urgent task>] [--force] [--json] yield request (admin, or the owner for their own task)
qgon queue yield <task> --cancel [--json] cancels a yield request (only before the SDK has started to exit)
--for and --force are admin-only. When owners yield their own task, it rejoins the back of the queue after a checkpoint
qgon queue status [--json] dispatch status (dispatcher, memory, wait reasons, running tasks, yields)
A task is a 32-character id or a prefix of at least 4 characters (when it matches exactly one task in that list). A request number is the # number in 'urgent ls'.
Exit codes: success 0 · refused by the server or server unreachable 1 · usage error or no configuration 2.
--json: one line of result JSON on standard output: success {"ok":true,…}, failure {"ok":false,"error":"…","code":"<server error code>","status":<HTTP>}.
It also works inside a workspace. A workspace key cannot perform admin actions (urgent approve and reject, move --top and --bottom,
yield --for and --force); use the web app (Scheduling) or the SDK with your own key from Settings › API credentials.

python -m qgon.finetune

The LLM fine-tuning runner itself: training (SFT-LoRA) and merging.

python -m qgon.finetune local-train|local-merge ...
python -m qgon.finetune local-train
OptionNotes
--specrequired-
--baserequired-
--datarequired-
--outrequired-
--resume-
python -m qgon.finetune local-merge
OptionNotes
--baserequired-
--adapterrequired-
--outrequired-
Full help text (python -m qgon.finetune -h)
The LLM fine-tuning runner itself: training (SFT-LoRA) and merging. See the qgon.finetune module for an overview.
Exit codes: 0 done · 2 settings or data error · 3 base model or adapter file error · 5 out of GPU memory · 1 anything else.
Status while running (run properties the device reads for the LLM fine-tuning screen): qgon_ft_phase (loading · sampling · training · saving · merging · uploading · done ·
failed) · qgon_ft_adapter (adapter model id) · qgon_ft_merged (merged model id) · qgon_ft_tps (training tokens per second) · qgon_ft_peak_gpu_gb ·
qgon_ft_rows (training and validation rows) · qgon_ft_error (one-line failure reason) · qgon_ft_samples_error (why not all before/after samples were made).
Progress goes through qgon.progress (qgon_step, qgon_total). When training ends, it records step=total once more and waits.
Metrics: train/loss · train/lr · train/grad_norm · train/token_accuracy · eval/loss · eval/perplexity · ft/tokens_per_sec.
Before/after samples: the table 'ft-samples' (a table in the run record) and the artifact 'qgon-ft-samples' (JSON {items:[{prompt, before, after}], max_new_tokens, stage, error}).
As soon as the pre-training samples exist, it uploads them once with stage 'before' (after is null), then uploads again with stage 'done' after training,
so the pre-training answers remain even if training or uploading fails midway. If generation fails, that field is null and the reason is in error and qgon_ft_samples_error.