> ## Documentation Index
> Fetch the complete documentation index at: https://novita.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Template Tags

Tags let you label template builds for release management without changing the underlying template name.

## Assign tags

Use `novita.template.assignTags` (JS) / `novita.template.assign_tags` (Python) to assign one or more tags to an existing template build.

<CodeGroup>
  ```js JavaScript & TypeScript icon="js" theme={"system"}
  import { Novita } from 'novita-sandbox'

  const novita = new Novita()

  await novita.template.assignTags('my-template:v1.0', 'production')
  await novita.template.assignTags('my-template:v1.0', ['production', 'stable'])
  ```

  ```python Python icon="python" theme={"system"}
  from novita_sandbox import Novita

  novita = Novita()

  novita.template.assign_tags('my-template:v1.0', 'production')
  novita.template.assign_tags('my-template:v1.0', ['production', 'stable'])
  ```
</CodeGroup>

## Remove tags

Use `novita.template.removeTags` (JS) / `novita.template.remove_tags` (Python) to remove one or more tags from a template by name.

<CodeGroup>
  ```js JavaScript & TypeScript icon="js" theme={"system"}
  import { Novita } from 'novita-sandbox'

  const novita = new Novita()

  await novita.template.removeTags('my-template', 'production')
  await novita.template.removeTags('my-template', ['production', 'staging'])
  ```

  ```python Python icon="python" theme={"system"}
  from novita_sandbox import Novita

  novita = Novita()

  novita.template.remove_tags('my-template', 'production')
  novita.template.remove_tags('my-template', ['production', 'staging'])
  ```
</CodeGroup>

## Assign tags at build time

You can also assign tags when a template is built, through the `tags` option of `novita.template.build`.

<CodeGroup>
  ```js JavaScript & TypeScript icon="js" theme={"system"}
  import { Novita } from 'novita-sandbox'

  const novita = new Novita()
  const template = novita.template.new().fromPythonImage('3.12')

  const build = await novita.template.build(template, 'my-template', {
    tags: ['v1.0.0', 'latest'],
  })
  ```

  ```python Python icon="python" theme={"system"}
  from novita_sandbox import Novita

  novita = Novita()
  template = novita.template.new().from_python_image('3.12')

  build = novita.template.build(
      template,
      'my-template',
      tags=['v1.0.0', 'latest'],
  )
  ```
</CodeGroup>

<Note>
  `assignTags` / `assign_tags` returns tag info. `removeTags` / `remove_tags` returns nothing. Both accept either a single tag string or a list of tags.
</Note>
