VLM – Tasks
This page is part of the Custom Vision Language Models (VLM) API reference. See the overview for task modes, key concepts, the end-to-end workflow and the list of all endpoints.
Task Endpoints
A task defines the model you train. Its mode (instruction, agentic or retrieval) is fixed at creation and must match every connected dataset.
List Tasks
List all VLM tasks in your workspace. Returns paginated results.
Required attributes
- Name
Authorization- Type
- string
- Description
Unique API token for authentication.
Optional attributes
- Name
workspace- Type
- string
- Description
Filter by workspace ID.
- Name
search- Type
- string
- Description
Search tasks by name.
- Name
page_size- Type
- integer
- Description
Number of results per page.
Request
curl -v -XGET \
-H 'Authorization: Token __API_TOKEN__' \
https://api.ximilar.com/vlm/v2/task/
Response
{
"count": 1,
"next": null,
"previous": null,
"results": [
{
"id": "dbb498ba-cf24-4400-9897-d5196444a880",
"name": "Card grading",
"created": "2025-12-17T14:59:34.529951Z",
"description": "Grades collectible cards",
"mode": "instruction",
"production_version": 2,
"dataset_count": 1,
"model_count": 2,
"is_training": false,
"system_prompt_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"user_prompt_id": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
"workspace": "748e50e4-d081-4924-b9e7-f500aac6a71d"
}
]
}
Get Task
Get details of a specific VLM task by its ID.
Required attributes
- Name
Authorization- Type
- string
- Description
Unique API token for authentication.
- Name
task_id- Type
- string
- Description
UUID of the task.
Returns
- Name
id- Type
- string
- Description
UUID of the task.
- Name
name- Type
- string
- Description
Name of the task.
- Name
mode- Type
- string
- Description
Task mode:
instruction,agenticorretrieval. Read-only after creation.
- Name
created- Type
- string
- Description
Timestamp when the task was created (ISO 8601 format).
- Name
description- Type
- string
- Description
Description of the task.
- Name
auto_deploy- Type
- boolean
- Description
Whether to automatically deploy the latest trained model version.
- Name
production_version- Type
- integer
- Description
Currently active model version (
0when no model is deployed).
- Name
last_version- Type
- integer
- Description
Latest trained model version number.
- Name
max_tokens- Type
- integer
- Description
Maximum number of tokens for model output (default
1000). Not used by retrieval tasks.
- Name
datasets- Type
- array
- Description
List of dataset IDs connected to this task.
- Name
dataset_count- Type
- integer
- Description
Number of datasets connected to this task.
- Name
training_params- Type
- object
- Description
Training configuration (base model, training type, LoRA rank, image resize, augmentation). Filled with the default for the mode when omitted on creation.
- Name
training_config_status- Type
- string
- Description
Compatibility state of the stored
training_params(read-only):valid,legacy,invalidormissing. UsePOST /v2/task/{task_id}/reset-training-config/to restore the default configuration for the mode.
- Name
training_time- Type
- integer
- Description
Maximum training time in minutes.
0means unrestricted.
- Name
system_prompt_id- Type
- string
- Description
UUID of the referenced system prompt. Set to a prompt ID to assign a system prompt.
- Name
user_prompt_id- Type
- string
- Description
UUID of the referenced user prompt. Set to a prompt ID to assign a user prompt.
- Name
system_prompt- Type
- string
- Description
Resolved system prompt text content (read-only, derived from the referenced prompt).
- Name
user_prompt- Type
- string
- Description
Resolved user prompt text content (read-only, derived from the referenced prompt).
Request
curl -v -XGET \
-H 'Authorization: Token __API_TOKEN__' \
https://api.ximilar.com/vlm/v2/task/__TASK_ID__/
Response
{
"id": "dbb498ba-cf24-4400-9897-d5196444a880",
"name": "Card grading",
"created": "2025-12-17T14:59:34.529951Z",
"description": "Grades collectible cards",
"mode": "instruction",
"auto_deploy": true,
"production_version": 2,
"last_version": 2,
"max_tokens": 1000,
"datasets": ["8797c273-b1d3-4e6f-82bb-adfb719415fe"],
"dataset_count": 1,
"training_params": {
"training_config_version": 1,
"training_config": {
"model": {"model_name": "LiquidAI/LFM2.5-VL-450M", "training_type": "lora"},
"lora": {"lora_rank": 16, "target_modules_preset": "language"},
"data": {"image_resize": {"enabled": true, "maximum_pixel_count": 262144, "do_image_splitting": true}}
}
},
"training_config_status": "valid",
"training_time": 0,
"system_prompt_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"user_prompt_id": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
"system_prompt": "You are a helpful assistant...",
"user_prompt": "Analyse the image[s]...",
"workspace": "748e50e4-d081-4924-b9e7-f500aac6a71d"
}
Create Task
Create a new VLM task. Choose the mode carefully: it cannot be changed later and every dataset you connect must have the same mode.
Instruction and agentic tasks need a system prompt and a user prompt before they can be trained. Retrieval tasks train an embedding model and use no prompts at all.
Required attributes
- Name
Authorization- Type
- string
- Description
Unique API token for authentication.
- Name
name- Type
- string
- Description
Name of the task.
- Name
mode- Type
- string
- Description
Task mode:
instruction,agenticorretrieval.
Optional attributes
- Name
description- Type
- string
- Description
Human-readable description.
- Name
system_prompt_id- Type
- string
- Description
UUID of a prompt with type
system.
- Name
user_prompt_id- Type
- string
- Description
UUID of a prompt with type
user.
- Name
datasets- Type
- array
- Description
List of dataset UUIDs to connect. All must have the same mode as the task. You can also connect datasets later with Add Dataset to Task.
- Name
max_tokens- Type
- integer
- Description
Maximum number of output tokens (default
1000).
- Name
auto_deploy- Type
- boolean
- Description
Automatically set
production_versionto each newly trained model (defaulttrue).
- Name
training_time- Type
- integer
- Description
Maximum training time in minutes.
0(default) means unrestricted.
- Name
training_params- Type
- object
- Description
Training configuration. Omit it to get the default configuration for the mode (LoRA on
LiquidAI/LFM2.5-VL-450M, or onQwen/Qwen3-VL-Embedding-2Bfor retrieval).
- Name
workspace- Type
- string
- Description
UUID of the workspace to create the task in.
Errors
{"mode": ["This field is required."]}whenmodeis missing.{"system_prompt_id": "Prompt must be type 'system'."}(and the same foruser_prompt_id) when a prompt of the wrong type is referenced.Dataset mode 'agentic' does not match task mode 'instruction'.when a connected dataset has a different mode.
Request
curl -v -XPOST \
-H 'Authorization: Token __API_TOKEN__' \
-H 'Content-Type: application/json' \
-d '{
"name": "Card grading",
"mode": "instruction",
"description": "Grades collectible cards and explains the grade",
"system_prompt_id": "__SYSTEM_PROMPT_ID__",
"user_prompt_id": "__USER_PROMPT_ID__",
"max_tokens": 1000
}' \
https://api.ximilar.com/vlm/v2/task/
Response
{
"id": "dbb498ba-cf24-4400-9897-d5196444a880",
"name": "Card grading",
"created": "2026-03-02T10:12:41.101823Z",
"description": "Grades collectible cards and explains the grade",
"mode": "instruction",
"auto_deploy": true,
"production_version": 0,
"last_version": 0,
"max_tokens": 1000,
"datasets": [],
"dataset_count": 0,
"training_params": {"training_config_version": 1, "training_config": {"...": "..."}},
"training_config_status": "valid",
"training_time": 0,
"system_prompt_id": "__SYSTEM_PROMPT_ID__",
"user_prompt_id": "__USER_PROMPT_ID__",
"system_prompt": "You are a helpful assistant...",
"user_prompt": "Analyse the image[s]...",
"workspace": "748e50e4-d081-4924-b9e7-f500aac6a71d"
}
Update Task
Update an existing task. Only the provided fields are changed.
Required attributes
- Name
Authorization- Type
- string
- Description
Unique API token for authentication.
- Name
task_id- Type
- string
- Description
UUID of the task to update.
Optional attributes
- Name
name- Type
- string
- Description
Updated name.
- Name
description- Type
- string
- Description
Updated description.
- Name
system_prompt_id- Type
- string
- Description
UUID of a
systemprompt, ornullto unset.
- Name
user_prompt_id- Type
- string
- Description
UUID of a
userprompt, ornullto unset.
- Name
max_tokens- Type
- integer
- Description
Maximum number of output tokens.
- Name
auto_deploy- Type
- boolean
- Description
Automatically deploy newly trained models.
- Name
training_time- Type
- integer
- Description
Maximum training time in minutes (
0= unrestricted).
- Name
training_params- Type
- object
- Description
Training configuration.
- Name
production_version- Type
- integer
- Description
Version of a
TRAINEDmodel to deploy. See also Set Production Version.
mode is immutable: sending it returns 400 {"mode": ["Mode cannot be changed after creation."]}.
datasets cannot be changed here, use Add Dataset to Task and Remove Dataset from Task.
Request
curl -v -XPATCH \
-H 'Authorization: Token __API_TOKEN__' \
-H 'Content-Type: application/json' \
-d '{
"description": "Grades cards on a 1-10 scale",
"max_tokens": 1500,
"auto_deploy": false
}' \
https://api.ximilar.com/vlm/v2/task/__TASK_ID__/
Delete Task
Delete a task together with its trained models. Datasets, samples and prompts are not deleted.
Required attributes
- Name
Authorization- Type
- string
- Description
Unique API token for authentication.
- Name
task_id- Type
- string
- Description
UUID of the task to delete.
Request
curl -v -XDELETE \
-H 'Authorization: Token __API_TOKEN__' \
https://api.ximilar.com/vlm/v2/task/__TASK_ID__/
Add Dataset to Task
Connect a dataset to a VLM task. A task can have multiple datasets for training. The dataset must have the same mode as the task and belong to the same workspace.
Required attributes
- Name
Authorization- Type
- string
- Description
Unique API token for authentication.
- Name
task_id- Type
- string
- Description
UUID of the task.
- Name
dataset_id- Type
- string
- Description
UUID of the dataset to add.
Errors
Dataset mode 'retrieval' does not match task mode 'instruction'.when the modes differ.
Request
curl -v -XPOST \
-H 'Authorization: Token __API_TOKEN__' \
-H 'Content-Type: application/json' \
-d '{"dataset_id": "__DATASET_ID__"}' \
https://api.ximilar.com/vlm/v2/task/__TASK_ID__/add-dataset/
Remove Dataset from Task
Remove a dataset from a VLM task. The dataset itself is kept.
Required attributes
- Name
Authorization- Type
- string
- Description
Unique API token for authentication.
- Name
task_id- Type
- string
- Description
UUID of the task.
- Name
dataset_id- Type
- string
- Description
UUID of the dataset to remove.
Request
curl -v -XPOST \
-H 'Authorization: Token __API_TOKEN__' \
-H 'Content-Type: application/json' \
-d '{"dataset_id": "__DATASET_ID__"}' \
https://api.ximilar.com/vlm/v2/task/__TASK_ID__/remove-dataset/
Validate Task
Check the configuration of a task and of its datasets without starting training. Instruction and agentic tasks need a non-empty system and user prompt; every connected dataset must pass Validate Dataset. Sample counts and per-sample issues are not checked here; they are reported by the dataset and sample validate endpoints and by Train Task.
Use POST /v2/task/validate-batch/ with a body {"ids": ["__TASK_ID__", "..."]} to validate several tasks at once.
The response is {"results": {"<task_id>": {...}}}.
Required attributes
- Name
Authorization- Type
- string
- Description
Unique API token for authentication.
- Name
task_id- Type
- string
- Description
UUID of the task.
Returns
- Name
valid- Type
- boolean
- Description
truewhen the task and all connected datasets are configured correctly.
- Name
validation_errors- Type
- array
- Description
Task-level problems, e.g.
"Missing system prompt","Missing user prompt".
- Name
not_valid_datasets- Type
- array
- Description
Datasets with configuration problems, each with
dataset_id,dataset_nameandvalidation_errors.
Request
curl -v -XPOST \
-H 'Authorization: Token __API_TOKEN__' \
https://api.ximilar.com/vlm/v2/task/__TASK_ID__/validate/
Response
{
"valid": false,
"validation_errors": ["Missing user prompt"],
"not_valid_datasets": [
{
"dataset_id": "8797c273-b1d3-4e6f-82bb-adfb719415fe",
"dataset_name": "Grading dataset",
"validation_errors": ["Missing variables: explain"]
}
]
}
Train Task
Start training a new model version for the task. All samples of the connected datasets are used;
samples flagged as test are held out for evaluation. Invalid samples are skipped, they do not block training.
Before the training is queued the task must pass these checks:
- the task has at least one dataset and all datasets have the task's mode
- instruction and agentic tasks have a non-empty system prompt and user prompt
- at least 20 samples across all datasets; for retrieval tasks at least 20 anchors that have a positive (
1.0000) document - the base model in
training_paramsmatches the mode (Qwen/Qwen3-VL-Embedding-2Bfor retrieval, a generative model otherwise) - no video or audio media is attached (media assets can be stored but not trained on yet)
- no other model of the task is currently training
- you have enough credits for the training operation
Training runs in the background. Poll List Models for the train_status. When auto_deploy is on, the new version becomes the production_version as soon as it is TRAINED.
Required attributes
- Name
Authorization- Type
- string
- Description
Unique API token for authentication.
- Name
task_id- Type
- string
- Description
UUID of the task to train.
Optional attributes
- Name
training_provider_scope- Type
- string
- Description
Where the training may run:
ANY(default),CLOUD_ONLYorKUBERNETES_ONLY.
Errors
Validation failures return 400 with {"detail": "VLM training data validation failed.", "validation_errors": [...]}.
Each entry has error_type and reason, for example:
not_enough_samples:There are fewer than 20 samples across all datasets (found 12).missing_system_prompt/missing_user_prompt:Task must have a non-empty system prompt.mode_mismatch:Dataset mode 'agentic' does not match task mode 'instruction'.invalid_config:Retrieval tasks require embedding model 'Qwen/Qwen3-VL-Embedding-2B', got 'LiquidAI/LFM2.5-VL-450M'.unsupported_media: video and audio attachments cannot be trained yet.
Request
curl -v -XPOST \
-H 'Authorization: Token __API_TOKEN__' \
https://api.ximilar.com/vlm/v2/task/__TASK_ID__/train/
Response
{
"id": "dbb498ba-cf24-4400-9897-d5196444a880",
"workspace": "748e50e4-d081-4924-b9e7-f500aac6a71d"
}
Set Production Version
Deploy a specific trained model version. Requests without an explicit version will use this version.
The same effect can be achieved with PATCH /v2/task/{task_id}/ and {"production_version": 2}.
Required attributes
- Name
Authorization- Type
- string
- Description
Unique API token for authentication.
- Name
task_id- Type
- string
- Description
UUID of the task.
- Name
version- Type
- integer
- Description
Version number of a model with
train_statusTRAINED.
Errors
No TRAINED model with version 3 exists for this task.
Request
curl -v -XPOST \
-H 'Authorization: Token __API_TOKEN__' \
-H 'Content-Type: application/json' \
-d '{"version": 2}' \
https://api.ximilar.com/vlm/v2/task/__TASK_ID__/set-production-version/
Response
{
"id": "dbb498ba-cf24-4400-9897-d5196444a880",
"production_version": 2
}