Model settings allow you to configure how the model behaves and what capabilities it has access to. These settings are defined in the metadata.model.settings section of your prompt’s frontmatter.

You can control basic parameters like temperature and max tokens, enable streaming, configure tools for agent capabilities, and define schemas for structured output. All settings are optional, allowing you to use only what you need for your specific use case.

Example Configuration

example.prompt.mdx
---
name: example-prompt
metadata:
  model:
    name: gpt-4
    settings:
      temperature: 0.7
      max_tokens: 1000
      top_p: 1
      stream: true
      max_llm_calls: 3
      tools:
        calculate:
          description: Performs basic arithmetic calculations
          parameters:
            type: object
            properties:
              expression:
                type: string
                description: The mathematical expression to evaluate
            required: ["expression"]
---

<System>You are a math tutor that can perform calculations.</System>
<User>What's 235 * 18?</User>

Available Settings

PropertyTypeDescriptionOptional/Required
streambooleanIndicates whether to stream the response.Optional
max_tokensnumberMaximum number of tokens to generate.Optional
temperaturenumberControls the randomness of the output; higher values result in more random outputs.Optional
top_pnumberControls the cumulative probability for nucleus sampling.Optional
top_knumberLimits the next token selection to the top k tokens.Optional
presence_penaltynumberPenalizes new tokens based on their presence in the text so far, encouraging the model to discuss new topics.Optional
frequency_penaltynumberPenalizes new tokens based on their frequency in the text so far, reducing the likelihood of repeating the same line verbatim.Optional
stop_sequencesstring[]Array of strings where the generation will stop if any of the strings are encountered.Optional
seednumberSeed value for random number generation, ensuring reproducibility.Optional
max_retriesnumberMaximum number of retries for the request in case of failures.Optional
headersRecord<string, string>Additional headers to include in the request.Optional
max_llm_callsnumberMaximum number of LLM calls allowed for agent mode.Optional
toolsRecord<string, { description: string; parameters: JSONSchema; }>A record of tools available to the model, where each tool includes a description and JSON Schema parameters.Optional
schemaJSONSchemaA schema defining the expected structure of the model’s output.Optional

Only use one of tools or schema or neither.

Have Questions?

We’re here to help! Choose the best way to reach us: