Skip to content

Templates

A template stores a launch configuration: an image, an instance type, a startup command and, optionally, a fixed resource pool and size. The Gallery and the ready-made templates under Deploy type: Model API on Home are templates.

Except for browsing public templates, these endpoints accept only a browser session. Paths are relative to your site’s console address.

GET /api/templates None, API key or session

Returns published templates. With an API key or a session, it also returns your own private templates.

GET /api/inference/templates Session

Returns the public vLLM templates that Deploy type → Model API offers, each with the command it runs and the size it needs.

{
"templates": [
{
"id": 412,
"title": "MiniCPM5-1B",
"description": "...",
"model_source": "modelscope",
"start_command": "vllm serve OpenBMB/MiniCPM5-1B --host 0.0.0.0 --port 8000 --served-model-name MiniCPM5-1B",
"pod_type": "one-click",
"resource_template": "resource-16c55g1u",
"gpu_count": 1
}
]
}
POST /api/templates/{template_id}/launch Session

The console sends an empty body. A template with a fixed pool and size launches on that size.

FieldTypeDescription
gpu_countintegerOptionalOnly for templates without a fixed size. Defaults to 1.
ssh_enabledbooleanOptionalTurn on SSH for this launch.

Only jupyter and vllm templates can be launched. The response and the follow-up calls are the same as for any other launch: poll GET /api/notebook/status, or GET /api/inference/current for a vllm template.

Launches are rate limited per IP address. Going over returns 429 with a Retry-After header.

MethodPathDoes
GET/api/profile/templatesLists your templates and the images you can pick.
POST/api/profile/templatesCreates a template.
PUT/api/profile/templates/{template_id}Replaces a template. Same body as creating.
DELETE/api/profile/templates/{template_id}Deletes a template.

The main fields:

FieldTypeDescription
titlestringRequiredDisplay name.
imagestringRequiredAn image from the catalog.
instance_typestringOptionaljupyter or vllm. Other types can be saved but can’t be launched.
start_commandstringOptionalCommand run at startup. Required for vllm.
model_sourcestringOptionalhuggingface or modelscope, for vllm.
pod_type, resource_templatestringOptionalA fixed pool and size. Send both or neither.
use_pvcbooleanOptionalLaunch with your persistent /workspace.
description, category, tags, cover_urlOptionalHow the template appears in the Gallery.
repo_url, branch, notebook_pathstringOptionalA Git repository to clone and a notebook to open on start.
enabledbooleanOptionalPublish to everyone. Only editors can publish; for everyone else it’s forced to false.

Changing or deleting a template doesn’t affect an instance already running from it.