---
title: "Create a generation preset"
method: POST
path: "/v2/generation_presets"
tags: ["Generation Presets"]
---

# Create a generation preset

`POST /v2/generation_presets`

Creates a custom generation preset for use in query and chat requests. A generation preset bundles a prompt template, an LLM, and model parameters into a reusable configuration.

Reference the created preset by name with the `generation_preset_name` field in query or chat requests.

## Headers

- `Request-Timeout` integer
- `Request-Timeout-Millis` integer

## Request body

- CreateGenerationPresetRequest — A bundle of default values for generation. You can override any of these values at generation time. Set `model_parameters.llm_name` to override the model that the preset selects.
  - `id` string — The ID of the generation preset.
  - `name` string, required — The name of the generation preset. Use this name to configure generation.
  - `description` string — Description of the generation preset.
  - `llm_name` string — The name of the model that this preset is used with. The `GET /v2/llms` endpoint lists the available names.
  - `prompt_template` string — The preset template that renders the prompt sent to generation.
  - `max_used_search_results` integer — The preset maximum number of search results available to the prompt.
  - `max_tokens` integer — The preset maximum number of tokens that generation returns.
  - `temperature` number, float — The sampling temperature to use. Higher values make the output more random, while lower values make it more focused and deterministic.
  - `frequency_penalty` number, float — Higher values penalize new tokens based on their existing frequency in the generation so far, decreasing the model's likelihood to repeat the same line verbatim.
  - `presence_penalty` number, float — Higher values penalize new tokens based on whether they appear in the generation so far, increasing the model's likelihood to talk about new topics.
  - `additional_model_params` object — Additional model parameters beyond the standard fields above.
  - `enabled` boolean — Indicates whether the generation preset is enabled.
  - `default` boolean — Indicates whether this is the default generation preset for the LLM.
  - `ownership` 'platform' | 'customer' — Indicates whether the generation preset is provided by the platform or created by the customer. Platform presets are pre-configured and cannot be modified or deleted. Customer presets are created and managed by the customer.

## Response `201`

The created generation preset.

- GenerationPreset — A bundle of default values for generation. You can override any of these values at generation time. Set `model_parameters.llm_name` to override the model that the preset selects.
  - `id` string — The ID of the generation preset.
  - `name` string, required — The name of the generation preset. Use this name to configure generation.
  - `description` string — Description of the generation preset.
  - `llm_name` string — The name of the model that this preset is used with. The `GET /v2/llms` endpoint lists the available names.
  - `prompt_template` string — The preset template that renders the prompt sent to generation.
  - `max_used_search_results` integer — The preset maximum number of search results available to the prompt.
  - `max_tokens` integer — The preset maximum number of tokens that generation returns.
  - `temperature` number, float — The sampling temperature to use. Higher values make the output more random, while lower values make it more focused and deterministic.
  - `frequency_penalty` number, float — Higher values penalize new tokens based on their existing frequency in the generation so far, decreasing the model's likelihood to repeat the same line verbatim.
  - `presence_penalty` number, float — Higher values penalize new tokens based on whether they appear in the generation so far, increasing the model's likelihood to talk about new topics.
  - `additional_model_params` object — Additional model parameters beyond the standard fields above.
  - `enabled` boolean — Indicates whether the generation preset is enabled.
  - `default` boolean — Indicates whether this is the default generation preset for the LLM.
  - `ownership` 'platform' | 'customer' — Indicates whether the generation preset is provided by the platform or created by the customer. Platform presets are pre-configured and cannot be modified or deleted. Customer presets are created and managed by the customer.

## Other responses

- `400` — Invalid request parameters.
- `403` — Permissions do not allow creating generation presets.

---

[API](https://skmtc.net/vectara/apis/vectara-rest-api-v2.md) · [All operations](https://skmtc.net/vectara/apis/vectara-rest-api-v2/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/vectara/vectara-rest-api-v2/versions/e85040b266cc/schema)
