---
title: "Create the template."
method: POST
path: "/users/{login_name}/templates"
tags: ["template"]
---

# Create the template.

`POST /users/{login_name}/templates`

Create the template.

## Path parameters

- `login_name` string, required

## Request body

- TemplateCreateRequest
  - `command` string
  - `deployment_source` DeploymentSource
    - `docker` DeploymentDockerSource
      - `image` string
    - `git` DeploymentGitSource
      - `branch` string
      - `builder` string
      - `directory` string — directory is the target directory name. Must not contain or start with '..'. If '.' is supplied, the volume directory will be the git repository. Otherwise, if specified, the volume will contain the git repository in the subdirectory with the given name. +optional
      - `image` string
      - `image_tag` string
      - `repo` string
      - `revision` string
    - `huggingface` DeploymentHuggingfaceSpaceSource
      - `space` string
      - `tag` string — tag is the tag of the docker image. (Optional) If not set, we will get from the huggingface API.
  - `description` string
  - `env_vars` object
  - `framework` 'mosec' | 'gradio' | 'streamlit' | 'other' | 'unknown'
  - `http_probe_path` string
  - `id` string
  - `is_public` boolean
  - `name` string
  - `port` integer
  - `readme` string
  - `repo` string
  - `server_source` 'nvidia-tesla-t4-4c-16g' | 'cpu-4c-16g' | 'nvidia-ampere-a100-40g-12c-85g' | 'nvidia-ada-l4-8c-32g' | 'nvidia-ada-l4-4-48c-192g' | 'nvidia-ada-l4-2-24c-96g'
  - `suggest_name` string
  - `tags` string[]

## Response `201`

Created

- GithubComTensorchordModelzApiserverPkgQueryTemplate
  - `command` SqlNullString
    - `string` string
    - `valid` boolean — Valid is true if String is not NULL
  - `created_at` string
  - `deployment_source` PgtypeJSONB
    - `bytes` integer[]
    - `status` 0 | 1 | 2
  - `description` SqlNullString
    - `string` string
    - `valid` boolean — Valid is true if String is not NULL
  - `env_vars` PgtypeJSONB
    - `bytes` integer[]
    - `status` 0 | 1 | 2
  - `framework` SqlNullString
    - `string` string
    - `valid` boolean — Valid is true if String is not NULL
  - `http_probe_path` SqlNullString
    - `string` string
    - `valid` boolean — Valid is true if String is not NULL
  - `id` string
  - `image` SqlNullString
    - `string` string
    - `valid` boolean — Valid is true if String is not NULL
  - `is_public` SqlNullBool
    - `bool` boolean
    - `valid` boolean — Valid is true if Bool is not NULL
  - `name` string
  - `port` SqlNullInt32
    - `int32` integer
    - `valid` boolean — Valid is true if Int32 is not NULL
  - `readme` SqlNullString
    - `string` string
    - `valid` boolean — Valid is true if String is not NULL
  - `repo` SqlNullString
    - `string` string
    - `valid` boolean — Valid is true if String is not NULL
  - `server_resource` SqlNullString
    - `string` string
    - `valid` boolean — Valid is true if String is not NULL
  - `suggest_name` SqlNullString
    - `string` string
    - `valid` boolean — Valid is true if String is not NULL
  - `tags` PgtypeJSONB
    - `bytes` integer[]
    - `status` 0 | 1 | 2
  - `updated_at` string
  - `user_id` string

---

[API](https://skmtc.dev/modelz/apis/modelz-api.md) · [All operations](https://skmtc.dev/modelz/apis/modelz-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/modelz/modelz-api/revisions/b68d575c96e8/schema)
