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

# Config

# Config

Configuration types for controlling model behavior.

## Config

The `Config` function creates a Zod schema for parsing model configuration. All fields are optional and provider-specific.

```typescript theme={null}
import { Config } from "@adaline/types";

const config = Config().parse({
  temperature: 0.7,
  maxTokens: 500,
  topP: 0.9,
  frequencyPenalty: 0,
  presencePenalty: 0,
  stop: ["\n"],
});
```

### Common Fields

<ParamField body="temperature" type="number" optional>
  Controls randomness. `0` is deterministic, higher values are more creative. Range: `0` to `2`.
</ParamField>

<ParamField body="maxTokens" type="number" optional>
  Maximum number of tokens to generate.
</ParamField>

<ParamField body="topP" type="number" optional>
  Nucleus sampling threshold. Range: `0` to `1`.
</ParamField>

<ParamField body="frequencyPenalty" type="number" optional>
  Penalize tokens based on frequency. Range: `-2` to `2`.
</ParamField>

<ParamField body="presencePenalty" type="number" optional>
  Penalize tokens based on presence. Range: `-2` to `2`.
</ParamField>

<ParamField body="stop" type="string[]" optional>
  Stop sequences that halt generation.
</ParamField>

<ParamField body="seed" type="number" optional>
  Random seed for deterministic outputs (provider support varies).
</ParamField>

## Embedding Config

For embedding models, the config supports:

```typescript theme={null}
const embeddingConfig = Config().parse({
  encodingFormat: "float",
  dimensions: 256,
});
```

<ParamField body="encodingFormat" type="string" optional>
  The encoding format for embeddings. Common values: `"float"`, `"base64"`.
</ParamField>

<ParamField body="dimensions" type="number" optional>
  The number of dimensions for the output embeddings.
</ParamField>
